diff options
author | Thomas Bächler <thomas@archlinux.org> | 2010-02-16 20:15:16 +0100 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2010-02-16 20:15:16 +0100 |
commit | 9c5f5683d087aafd03bebdeb71b7d8a116c3a250 (patch) | |
tree | e8438f9813f33d939a255729468bb533683d1cd0 | |
parent | 99e387a0be8ef22b9a266667a97093b35ac569b1 (diff) | |
download | mkinitcpio-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.
-rw-r--r-- | init | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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. |