]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Move root option processing into a pre-mount hook.
authorVictor Lowther <victor.lowther@gmail.com>
Sat, 7 Mar 2009 14:02:03 +0000 (08:02 -0600)
committerVictor Lowther <victor.lowther@gmail.com>
Sat, 7 Mar 2009 14:02:03 +0000 (08:02 -0600)
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
modules.d/99base/mount-root.sh [new file with mode: 0755]
modules.d/99base/parse-root-opts.sh [moved from modules.d/99base/mount-partition.sh with 86% similarity]

index f59bc43996dad52af818fa0916fc3555688215cd..922dca9dcca4600ca3da400bc4353b47e9b4a74d 100755 (executable)
@@ -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 (executable)
index 0000000..b0c8250
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ "$root" ] && mount $fstype -o "$rflags" "$root" "$NEWROOT" && \
+    ROOTFS_MOUNTED=yes
similarity index 86%
rename from modules.d/99base/mount-partition.sh
rename to modules.d/99base/parse-root-opts.sh
index f554c28b250157d505605f1fe4736bcdf5f05444..799c956500608b3b3a74a81d28a0b2a0949534df 100755 (executable)
@@ -22,6 +22,3 @@
 [ "$fstype" ] || {
     fstype="$(getarg rootfstype=)" && fstype="-t ${fstype}"
 }
-
-[ -e "$root" ] && mount $fstype -o "$rflags" "$root" "$NEWROOT" && \
-    ROOTFS_MOUNTED=yes