From: Victor Lowther Date: Sat, 7 Mar 2009 14:02:03 +0000 (-0600) Subject: Move root option processing into a pre-mount hook. X-Git-Tag: 0.1~302 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76c88488c427f8e342d49672cfb605160acb7649;p=thirdparty%2Fdracut.git 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. --- diff --git a/modules.d/99base/install b/modules.d/99base/install index f59bc4399..922dca9dc 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 000000000..b0c825085 --- /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 f554c28b2..799c95650 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