summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-08-02 20:55:41 +0200
committerDave Reisner <dreisner@archlinux.org>2011-10-01 05:22:48 +0200
commit39d7c2925a71d631cdb7711898eaeefa93af816a (patch)
tree7526bb740ed107ace30270ab2e2ebfefee31bb90
parenta0ea96ea0126814c518ffdc50449005b5b55d28e (diff)
downloadmkinitcpio-39d7c2925a71d631cdb7711898eaeefa93af816a.tar.gz
mkinitcpio-39d7c2925a71d631cdb7711898eaeefa93af816a.tar.xz
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 <dreisner@archlinux.org>
-rwxr-xr-xmkinitcpio4
1 files changed, 4 insertions, 0 deletions
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