From 76c88488c427f8e342d49672cfb605160acb7649 Mon Sep 17 00:00:00 2001 From: Victor Lowther Date: Sat, 7 Mar 2009 08:02:03 -0600 Subject: [PATCH] Move root option processing into a pre-mount hook. This will make it easier to add support for root on nfs, root on iscsi, root on multipath, and other such oddities. --- modules.d/99base/install | 3 ++- modules.d/99base/mount-root.sh | 3 +++ modules.d/99base/{mount-partition.sh => parse-root-opts.sh} | 3 --- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100755 modules.d/99base/mount-root.sh rename modules.d/99base/{mount-partition.sh => parse-root-opts.sh} (86%) diff --git a/modules.d/99base/install b/modules.d/99base/install index f59bc43..922dca9 100755 --- a/modules.d/99base/install +++ b/modules.d/99base/install @@ -3,6 +3,7 @@ dracut_install mount mknod mkdir modprobe pidof sleep chroot echo sed sh ls # install our scripts and hooks inst "$moddir/init" "/init" inst "$moddir/switch_root" "/sbin/switch_root" +inst_hook pre-mount 10 "$moddir/parse-root-opts.sh" inst_hook pre-pivot 50 "$moddir/selinux-loadpolicy.sh" inst_hook mount 90 "$moddir/resume.sh" -inst_hook mount 99 "$moddir/mount-partition.sh" +inst_hook mount 99 "$moddir/mount-root.sh" diff --git a/modules.d/99base/mount-root.sh b/modules.d/99base/mount-root.sh new file mode 100755 index 0000000..b0c8250 --- /dev/null +++ b/modules.d/99base/mount-root.sh @@ -0,0 +1,3 @@ +#!/bin/sh +[ "$root" ] && mount $fstype -o "$rflags" "$root" "$NEWROOT" && \ + ROOTFS_MOUNTED=yes diff --git a/modules.d/99base/mount-partition.sh b/modules.d/99base/parse-root-opts.sh similarity index 86% rename from modules.d/99base/mount-partition.sh rename to modules.d/99base/parse-root-opts.sh index f554c28..799c956 100755 --- a/modules.d/99base/mount-partition.sh +++ b/modules.d/99base/parse-root-opts.sh @@ -22,6 +22,3 @@ [ "$fstype" ] || { fstype="$(getarg rootfstype=)" && fstype="-t ${fstype}" } - -[ -e "$root" ] && mount $fstype -o "$rflags" "$root" "$NEWROOT" && \ - ROOTFS_MOUNTED=yes -- 2.7.4