From 8df03273a2a71038d487bad266c9548e3704bda6 Mon Sep 17 00:00:00 2001 From: Davide Depau Date: Thu, 16 Apr 2020 23:55:17 +0200 Subject: [PATCH] Create /dev/null in new root to prevent hangs gnupg post install script does "dirmngr /dev/null". Since "pacman -r" does not mount any filesystems but it does chroot into the new root, /dev/null does not exist, making the script hang forever. --- pacstrap-docker | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pacstrap-docker b/pacstrap-docker index e0b0330..646aca8 100755 --- a/pacstrap-docker +++ b/pacstrap-docker @@ -19,7 +19,13 @@ mkdir -m 0755 -p "$newroot"/var/{cache/pacman/pkg,lib/pacman,log} "$newroot"/{de mkdir -m 1777 -p "$newroot"/tmp mkdir -m 0555 -p "$newroot"/{sys,proc} +echo 'Creating /dev/null in new root' +mknod "$newroot/dev/null" c 1 3 + echo 'Installing packages to %s' "$newroot" if ! pacman -r "$newroot" -Sy --noconfirm "${pacman_args[@]}"; then die 'Failed to install packages to new root' fi + +echo 'Deleting /dev/null from new root' +rm "$newroot/dev/null"