summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-07-12 04:26:41 +0200
committerThomas Bächler <thomas@archlinux.org>2010-07-12 09:37:03 +0200
commit9ef825cedd8228957f9bdd8df7ae543afd7e0001 (patch)
tree7ee6edfb9bd24221016320df1287958858153c9b
parent28d58c91370f8531661ea1b150dc8b398f923bdd (diff)
downloadmkinitcpio-9ef825cedd8228957f9bdd8df7ae543afd7e0001.tar.gz
mkinitcpio-9ef825cedd8228957f9bdd8df7ae543afd7e0001.tar.xz
mkinitcpio: mount real root device instead of symlink
If a symlink such as /dev/disk/by-uuid/xxxxx is provided on the kernel cmdline, resolve it and mount that device instead of the symlink. This prevents some ugliness in the output of commands such as mount or df. Signed-off-by: Dave Reisner <d@falconindy.com>
-rw-r--r--init_functions3
1 files changed, 3 insertions, 0 deletions
diff --git a/init_functions b/init_functions
index 1ae844b..37b9ebb 100644
--- a/init_functions
+++ b/init_functions
@@ -93,5 +93,8 @@ default_mount_handler() {
else
rwopt="ro"
fi
+ if [ -L "${root}" ]; then
+ root=$(readlink -f "${root}")
+ fi
mount ${fstype:+-t ${fstype}} -o ${rwopt}${rootflags:+,${rootflags}} "${root}" "$1"
}