From 39d7c2925a71d631cdb7711898eaeefa93af816a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 2 Aug 2011 14:55:41 -0400 Subject: mkinitcpio: insist that /dev and /proc be mounted This avoids errors with process substitutions in chroots, among other things. It's important that /proc be checked first as /etc/mtab might be a link to /proc/self/mounts. Signed-off-by: Dave Reisner --- mkinitcpio | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkinitcpio b/mkinitcpio index 72e7ec8..d8ea31f 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -156,6 +156,10 @@ if [[ -t 2 ]] && (( COLOR )); then 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!" + if [[ $BASEDIR ]]; then # resolve the path. it might be a relative path and/or contain symlinks if ! pushd "$BASEDIR" &>/dev/null; then -- cgit v1.2.3-24-g4f1b