summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2010-02-16 20:15:16 +0100
committerThomas Bächler <thomas@archlinux.org>2010-02-16 20:15:16 +0100
commit9c5f5683d087aafd03bebdeb71b7d8a116c3a250 (patch)
treee8438f9813f33d939a255729468bb533683d1cd0 /init
parent99e387a0be8ef22b9a266667a97093b35ac569b1 (diff)
downloadmkinitcpio-9c5f5683d087aafd03bebdeb71b7d8a116c3a250.tar.gz
mkinitcpio-9c5f5683d087aafd03bebdeb71b7d8a116c3a250.tar.xz
When use stat -c %D instead of stat -f -c %i for testing if /new_root is a mount point
The old check couldn't distinguish different tmpfs mounts and failed to work with aufs (archiso). This check is actually the same one that busybox/switch_root uses to determine where to stop deleting files. If this check fails and we still launch switch_root it may start deleting data.
Diffstat (limited to 'init')
-rw-r--r--init2
1 files changed, 1 insertions, 1 deletions
diff --git a/init b/init
index 3134530..3dbe916 100644
--- a/init
+++ b/init
@@ -110,7 +110,7 @@ mkdir -p /new_root
${mount_handler} /new_root
[ -z "${init}" ] && init="/sbin/init"
-if [ "$(stat -f -c %i /)" = "$(stat -f -c %i /new_root)" ]; then
+if [ "$(stat -c %D /)" = "$(stat -c %D /new_root)" ]; then
# Nothing got mounted on /new_root. This is the end, we don't know what to do anymore
# We fall back into a shell, but the shell has now PID 1
# This way, manual recovery is still possible.