From 05988c6a16621c75d2fe3ed0cfddfb6ce2d18f93 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Feb 21 2023 21:03:22 +0000 Subject: Revert PR#1934 https://bugzilla.redhat.com/show_bug.cgi?id=2172269#c3 --- diff --git a/1934-revert-add-overlayfs-module.patch b/1934-revert-add-overlayfs-module.patch new file mode 100644 index 0000000..94cbf13 --- /dev/null +++ b/1934-revert-add-overlayfs-module.patch @@ -0,0 +1,205 @@ +From 59105d4a8e51f7d3e7fe716b4382bf604933abdd Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Tue, 21 Feb 2023 21:47:34 +0100 +Subject: [PATCH] Revert PR#1934 + +--- + .github/labeler.yml | 3 -- + .../90dmsquash-live/dmsquash-live-root.sh | 17 ++++++++++ + modules.d/90dmsquash-live/module-setup.sh | 4 +-- + .../90dmsquash-live/parse-dmsquash-live.sh | 3 -- + modules.d/90overlayfs/module-setup.sh | 18 ---------- + modules.d/90overlayfs/mount-overlayfs.sh | 33 ------------------- + test/TEST-16-DMSQUASH/test.sh | 6 ---- + test/TEST-20-NFS/test.sh | 10 +----- + 8 files changed, 20 insertions(+), 74 deletions(-) + delete mode 100755 modules.d/90overlayfs/module-setup.sh + delete mode 100755 modules.d/90overlayfs/mount-overlayfs.sh + +diff --git a/.github/labeler.yml b/.github/labeler.yml +index ba47d04..faa782a 100644 +--- a/.github/labeler.yml ++++ b/.github/labeler.yml +@@ -138,9 +138,6 @@ multipath: + nvdimm: + - modules.d/90nvdimm/* + +-overlayfs: +- - modules.d/90overlayfs/* +- + ppcmac: + - modules.d/90ppcmac/* + +diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh +index 62d1b5e..d5b03bc 100755 +--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh ++++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh +@@ -410,6 +410,23 @@ if [ -n "$overlayfs" ]; then + else + ln -sf /run/initramfs/live /run/rootfsbase + fi ++ mkdir -m 0755 -p /run/overlayfs ++ mkdir -m 0755 -p /run/ovlwork ++ if [ -n "$reset_overlay" ] && [ -h /run/overlayfs ]; then ++ ovlfs=$(readlink /run/overlayfs) ++ info "Resetting the OverlayFS overlay directory." ++ rm -r -- "${ovlfs:?}"/* "${ovlfs:?}"/.* > /dev/null 2>&1 ++ fi ++ if [ -n "$readonly_overlay" ] && [ -h /run/overlayfs-r ]; then ++ ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase ++ else ++ ovlfs=lowerdir=/run/rootfsbase ++ fi ++ if [ -z "$DRACUT_SYSTEMD" ]; then ++ printf 'mount -t overlay LiveOS_rootfs -o%s,%s %s\n' "$ROOTFLAGS" \ ++ "$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork \ ++ "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh ++ fi + else + if [ -z "$DRACUT_SYSTEMD" ]; then + [ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS" +diff --git a/modules.d/90dmsquash-live/module-setup.sh b/modules.d/90dmsquash-live/module-setup.sh +index b905e3d..cf3dfe5 100755 +--- a/modules.d/90dmsquash-live/module-setup.sh ++++ b/modules.d/90dmsquash-live/module-setup.sh +@@ -11,13 +11,13 @@ check() { + depends() { + # if dmsetup is not installed, then we cannot support fedora/red hat + # style live images +- echo dm rootfs-block img-lib overlayfs ++ echo dm rootfs-block img-lib + return 0 + } + + # called by dracut + installkernel() { +- instmods squashfs loop iso9660 ++ instmods squashfs loop iso9660 overlay + } + + # called by dracut +diff --git a/modules.d/90dmsquash-live/parse-dmsquash-live.sh b/modules.d/90dmsquash-live/parse-dmsquash-live.sh +index 1a316a2..8c4423b 100755 +--- a/modules.d/90dmsquash-live/parse-dmsquash-live.sh ++++ b/modules.d/90dmsquash-live/parse-dmsquash-live.sh +@@ -39,9 +39,6 @@ case "$liveroot" in + live:/*.[Ii][Mm][Gg] | /*.[Ii][Mm][Gg]) + [ -f "${root#live:}" ] && rootok=1 + ;; +- live:nfs*) +- rootok=1 +- ;; + esac + + [ "$rootok" = "1" ] || return 1 +diff --git a/modules.d/90overlayfs/module-setup.sh b/modules.d/90overlayfs/module-setup.sh +deleted file mode 100755 +index 27aa7cf..0000000 +--- a/modules.d/90overlayfs/module-setup.sh ++++ /dev/null +@@ -1,18 +0,0 @@ +-#!/bin/bash +- +-check() { +- [[ $hostonly ]] && return 1 +- return 255 +-} +- +-depends() { +- echo base +-} +- +-installkernel() { +- instmods overlay +-} +- +-install() { +- inst_hook mount 01 "$moddir/mount-overlayfs.sh" +-} +diff --git a/modules.d/90overlayfs/mount-overlayfs.sh b/modules.d/90overlayfs/mount-overlayfs.sh +deleted file mode 100755 +index 7e2da1a..0000000 +--- a/modules.d/90overlayfs/mount-overlayfs.sh ++++ /dev/null +@@ -1,33 +0,0 @@ +-#!/bin/sh +- +-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh +- +-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="" +- +-ROOTFLAGS="$(getarg rootflags)" +- +-if [ -n "$overlayfs" ]; then +- if ! [ -e /run/rootfsbase ]; then +- mkdir -m 0755 -p /run/rootfsbase +- mount --bind "$NEWROOT" /run/rootfsbase +- fi +- +- mkdir -m 0755 -p /run/overlayfs +- mkdir -m 0755 -p /run/ovlwork +- if [ -n "$reset_overlay" ] && [ -h /run/overlayfs ]; then +- ovlfsdir=$(readlink /run/overlayfs) +- info "Resetting the OverlayFS overlay directory." +- 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 +- else +- ovlfs=lowerdir=/run/rootfsbase +- fi +- +- if ! strstr "$(cat /proc/mounts)" LiveOS_rootfs; then +- mount -t overlay LiveOS_rootfs -o "$ROOTFLAGS,$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork "$NEWROOT" +- fi +-fi +diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh +index d8a7bc7..5854ab8 100755 +--- a/test/TEST-16-DMSQUASH/test.sh ++++ b/test/TEST-16-DMSQUASH/test.sh +@@ -15,12 +15,6 @@ test_run() { + 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 \ +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index c637b57..2af41f4 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -173,14 +173,6 @@ test_nfsv3() { + client_test "NFSv3 root=dhcp DHCP proto:IP:path,options" 52:54:00:12:34:07 \ + "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 +- + return 0 + } + +@@ -400,7 +392,7 @@ test_setup() { + # Make client's dracut image + "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + -o "plymouth" \ +- -a "dmsquash-live debug watchdog ${USE_NETWORK}" \ ++ -a "debug watchdog ${USE_NETWORK}" \ + --no-hostonly-cmdline -N \ + -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 + +-- +2.39.1 + diff --git a/dracut.spec b/dracut.spec index 575594d..9dae606 100644 --- a/dracut.spec +++ b/dracut.spec @@ -7,7 +7,7 @@ %global __requires_exclude pkg-config # rpmdev-bumpspec and releng automation compatible variable -%global baserelease 1 +%global baserelease 2 Name: dracut Version: 059 @@ -40,6 +40,10 @@ Patch2: 1825-Skip-creating-initrd-when-initrd-is-provided.patch # https://github.com/dracutdevs/dracut/pull/2218 Patch3: 2218-add-module-driver-support-for-macbook-keyboards.patch +# Revert PR#1934 +# https://bugzilla.redhat.com/show_bug.cgi?id=2172269#c3 +Patch4: 1934-revert-add-overlayfs-module.patch + BuildRequires: bash BuildRequires: git-core BuildRequires: pkgconfig(libkmod) >= 23 @@ -324,7 +328,6 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/90mdraid %{dracutlibdir}/modules.d/90multipath %{dracutlibdir}/modules.d/90nvdimm -%{dracutlibdir}/modules.d/90overlayfs %{dracutlibdir}/modules.d/90ppcmac %{dracutlibdir}/modules.d/90qemu %{dracutlibdir}/modules.d/91crypt-gpg @@ -446,6 +449,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Tue Feb 21 2023 Pavel Valena - 059-2 +- Revert: PR#1934 add overlayfs module + * Mon Feb 13 2023 Pavel Valena - 059-1 - Update to 059 - feat(dracut.sh): option to skip creating initrd