Execute mount-overlayfs later in the boot process as a pre-pivot
hook. The existing mount hook is skipped for network boot.
Without this change
`dracut -a "overlayfs nfs"`
would not work as expected.
Improved the existing test case to test for this scenario.
}
install() {
- inst_hook mount 01 "$moddir/mount-overlayfs.sh"
inst_hook pre-mount 01 "$moddir/prepare-overlayfs.sh"
+ inst_hook mount 01 "$moddir/mount-overlayfs.sh" # overlay on top of block device
+ inst_hook pre-pivot 10 "$moddir/mount-overlayfs.sh" # overlay on top of network device (e.g. nfs)
}
break
done < /proc/mounts
+# fail the test of rd.live.overlay did not worked as expected
+if grep -qF 'rd.live.overlay' /proc/cmdline; then
+ if ! strstr "$(cat /proc/mounts)" LiveOS_rootfs; then
+ echo "nfs-FAIL" | dd oflag=direct,dsync of=/dev/disk/by-id/ata-disk_marker
+ fi
+fi
+
if [ "$fstype" = "nfs" -o "$fstype" = "nfs4" ]; then
serverip=${dev%:*}