From 1d86ae6e5b8976aade3de34990d289fdd3806032 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 9 Oct 2011 15:42:40 -0400 Subject: mkinitcpio: avoid using mountpoint As it turns out, the mountpoint toy from util-linux isn't really at feature parity with sysvinit's. In particular, and with respect to v2.20: - It throws false negatives when /proc isn't mounted. Rather, it should fall back on using stat(2), as is the basis for sysvinit's tool. - when /proc is mounted with as source of 'none', it segfaults on a null dereference. Patches have been sent upstream to resolve these issues, but in the meantime, we're mounting /dev and /proc for very specific reasons. Instead of relying on a fork/exec to figure out if these API FS's are mounted, use a simple bash test to see if these specific needs are available within the FS. One of many possible fixes for FS#26344. Signed-off-by: Dave Reisner --- mkinitcpio | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mkinitcpio b/mkinitcpio index 37db805..d0ae08c 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -157,8 +157,10 @@ fi readonly NC BOLD BLUE GREEN RED YELLOW # insist that /proc and /dev be mounted (important for chroots) -mountpoint -q /proc || die "/proc must be mounted!" -mountpoint -q /dev || die "/dev must be mounted!" +# NOTE: avoid using mountpoint for this -- look for the paths that we actually +# use in mkinitcpio. Avoids issues like FS#26344. +[[ -e /proc/self/mountinfo ]] || die "/proc must be mounted!" +[[ -e /dev/fd ]] || die "/dev must be mounted!" if [[ $BASEDIR ]]; then # resolve the path. it might be a relative path and/or contain symlinks -- cgit v1.2.3-24-g4f1b