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.
master
Victor Lowther 2009-03-07 08:02:03 -06:00
parent 5cad5bb50e
commit 76c88488c4
3 changed files with 5 additions and 4 deletions

View File

@ -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"

3
modules.d/99base/mount-root.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
[ "$root" ] && mount $fstype -o "$rflags" "$root" "$NEWROOT" && \
ROOTFS_MOUNTED=yes

View File

@ -22,6 +22,3 @@
[ "$fstype" ] || {
fstype="$(getarg rootfstype=)" && fstype="-t ${fstype}"
}

[ -e "$root" ] && mount $fstype -o "$rflags" "$root" "$NEWROOT" && \
ROOTFS_MOUNTED=yes