Also split ovlfs variable with two different meaning.
nvdimm:
- modules.d/90nvdimm/*
+overlayfs:
+ - modules.d/90overlayfs/*
+
ppcmac:
- modules.d/90ppcmac/*
/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root "${root#live:}"
fi
;;
- nfs*)
- cp /sbin/mount-overlayfs "$hookdir/mount/99-mount-overlayfs.sh"
- ;;
esac
else
ln -sf /run/initramfs/live /run/rootfsbase
fi
- if [ -z "$DRACUT_SYSTEMD" ]; then
- ln -sf /sbin/mount-overlayfs "$hookdir"/mount/01-$$-live.sh
- fi
else
if [ -z "$DRACUT_SYSTEMD" ]; then
[ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS"
depends() {
# if dmsetup is not installed, then we cannot support fedora/red hat
# style live images
- echo dm rootfs-block img-lib
+ echo dm rootfs-block img-lib overlayfs
return 0
}
# called by dracut
installkernel() {
- instmods squashfs loop iso9660 overlay
+ instmods squashfs loop iso9660
}
# called by dracut
inst_hook pre-pivot 20 "$moddir/apply-live-updates.sh"
inst_script "$moddir/dmsquash-live-root.sh" "/sbin/dmsquash-live-root"
inst_script "$moddir/iso-scan.sh" "/sbin/iso-scan"
- inst_script "$moddir/mount-overlayfs.sh" "/sbin/mount-overlayfs"
if dracut_module_included "systemd-initrd"; then
inst_script "$moddir/dmsquash-generator.sh" "$systemdutildir"/system-generators/dracut-dmsquash-generator
inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service"
--- /dev/null
+#!/bin/bash
+
+check() {
+ [[ $hostonly ]] && return 1
+ return 255
+}
+
+depends() {
+ echo base
+}
+
+installkernel() {
+ instmods overlay
+}
+
+install() {
+ inst_hook mount 01 "$moddir/mount-overlayfs.sh"
+}
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-PATH=/usr/sbin:/usr/bin:/sbin:/bin
-
getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes"
getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
mkdir -m 0755 -p /run/overlayfs
mkdir -m 0755 -p /run/ovlwork
if [ -n "$reset_overlay" ] && [ -h /run/overlayfs ]; then
- ovlfs=$(readlink /run/overlayfs)
+ ovlfsdir=$(readlink /run/overlayfs)
info "Resetting the OverlayFS overlay directory."
- rm -r -- "${ovlfs:?}"/* "${ovlfs:?}"/.* > /dev/null 2>&1
+ rm -r -- "${ovlfsdir:?}"/* "${ovlfsdir:?}"/.* > /dev/null 2>&1
fi
if [ -n "$readonly_overlay" ] && [ -h /run/overlayfs-r ]; then
ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase
qemu_add_drive_args disk_index disk_args "$TESTDIR"/marker.img marker
qemu_add_drive_args disk_index disk_args "$TESTDIR"/root.img root
+ "$testdir"/run-qemu \
+ "${disk_args[@]}" \
+ -boot order=d \
+ -append "rd.live.overlay.overlayfs=1 root=LABEL=dracut console=ttyS0,115200n81 quiet selinux=0 rd.info rd.shell=0 panic=1 oops=panic softlockup_panic=1 $DEBUGFAIL" \
+ -initrd "$TESTDIR"/initramfs.testing
+
"$testdir"/run-qemu \
"${disk_args[@]}" \
-boot order=d \
"root=dhcp" 192.168.50.3 wsize=4096 || return 1
client_test "NFSv3 Overlayfs root=nfs:..." 52:54:00:12:34:04 \
+ "root=nfs:192.168.50.1:/nfs/client rd.live.overlay.overlayfs=1" \
+ 192.168.50.1 -wsize=4096 || return 1
+
+ client_test "NFSv3 Live Overlayfs root=nfs:..." 52:54:00:12:34:04 \
"root=nfs:192.168.50.1:/nfs/client rd.live.image rd.live.overlay.overlayfs=1" \
192.168.50.1 -wsize=4096 || return 1