summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-11-06 01:57:13 +0100
committerDave Reisner <dreisner@archlinux.org>2011-11-15 01:11:09 +0100
commit854b285e70b21321d8c29aa3548dca9de8e08b6a (patch)
treefb67de5ffe8dc83e6dffaddecbc71bc3cc812336
parentc06a144a66ec24b9e2b4fd52c9abd655f352f685 (diff)
downloadmkinitcpio-854b285e70b21321d8c29aa3548dca9de8e08b6a.tar.gz
mkinitcpio-854b285e70b21321d8c29aa3548dca9de8e08b6a.tar.xz
init_functions: move root resolution to separate function
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--init_functions6
1 files changed, 5 insertions, 1 deletions
diff --git a/init_functions b/init_functions
index 33a749f..ff21b42 100644
--- a/init_functions
+++ b/init_functions
@@ -74,7 +74,7 @@ parse_cmdline() {
done
}
-default_mount_handler() {
+resolve_device() {
# resolve tag name to block device
if [ "${root:0:5}" = 'UUID=' ] || [ "${root:0:6}" = 'LABEL=' ]; then
device=$(blkid -l -t "$root" -o device)
@@ -117,6 +117,10 @@ default_mount_handler() {
msg "Trying to continue (this will most likely fail) ..."
fi
fi
+}
+
+default_mount_handler() {
+ resolve_device
if ! mount ${fstype:+-t $fstype} -o ${rwopt:-ro}${rootflags:+,$rootflags} "$root" "$1"; then
echo "You are now being dropped into an emergency shell."