05988c
From 59105d4a8e51f7d3e7fe716b4382bf604933abdd Mon Sep 17 00:00:00 2001
05988c
From: rpm-build <rpm-build>
05988c
Date: Tue, 21 Feb 2023 21:47:34 +0100
05988c
Subject: [PATCH] Revert PR#1934
05988c
05988c
---
05988c
 .github/labeler.yml                           |  3 --
05988c
 .../90dmsquash-live/dmsquash-live-root.sh     | 17 ++++++++++
05988c
 modules.d/90dmsquash-live/module-setup.sh     |  4 +--
05988c
 .../90dmsquash-live/parse-dmsquash-live.sh    |  3 --
05988c
 modules.d/90overlayfs/module-setup.sh         | 18 ----------
05988c
 modules.d/90overlayfs/mount-overlayfs.sh      | 33 -------------------
05988c
 test/TEST-16-DMSQUASH/test.sh                 |  6 ----
05988c
 test/TEST-20-NFS/test.sh                      | 10 +-----
05988c
 8 files changed, 20 insertions(+), 74 deletions(-)
05988c
 delete mode 100755 modules.d/90overlayfs/module-setup.sh
05988c
 delete mode 100755 modules.d/90overlayfs/mount-overlayfs.sh
05988c
05988c
diff --git a/.github/labeler.yml b/.github/labeler.yml
05988c
index ba47d04..faa782a 100644
05988c
--- a/.github/labeler.yml
05988c
+++ b/.github/labeler.yml
05988c
@@ -138,9 +138,6 @@ multipath:
05988c
 nvdimm:
05988c
   - modules.d/90nvdimm/*
05988c
 
05988c
-overlayfs:
05988c
-  - modules.d/90overlayfs/*
05988c
-
05988c
 ppcmac:
05988c
   - modules.d/90ppcmac/*
05988c
 
05988c
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
05988c
index 62d1b5e..d5b03bc 100755
05988c
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
05988c
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
05988c
@@ -410,6 +410,23 @@ if [ -n "$overlayfs" ]; then
05988c
     else
05988c
         ln -sf /run/initramfs/live /run/rootfsbase
05988c
     fi
05988c
+    mkdir -m 0755 -p /run/overlayfs
05988c
+    mkdir -m 0755 -p /run/ovlwork
05988c
+    if [ -n "$reset_overlay" ] && [ -h /run/overlayfs ]; then
05988c
+        ovlfs=$(readlink /run/overlayfs)
05988c
+        info "Resetting the OverlayFS overlay directory."
05988c
+        rm -r -- "${ovlfs:?}"/* "${ovlfs:?}"/.* > /dev/null 2>&1
05988c
+    fi
05988c
+    if [ -n "$readonly_overlay" ] && [ -h /run/overlayfs-r ]; then
05988c
+        ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase
05988c
+    else
05988c
+        ovlfs=lowerdir=/run/rootfsbase
05988c
+    fi
05988c
+    if [ -z "$DRACUT_SYSTEMD" ]; then
05988c
+        printf 'mount -t overlay LiveOS_rootfs -o%s,%s %s\n' "$ROOTFLAGS" \
05988c
+            "$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork \
05988c
+            "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh
05988c
+    fi
05988c
 else
05988c
     if [ -z "$DRACUT_SYSTEMD" ]; then
05988c
         [ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS"
05988c
diff --git a/modules.d/90dmsquash-live/module-setup.sh b/modules.d/90dmsquash-live/module-setup.sh
05988c
index b905e3d..cf3dfe5 100755
05988c
--- a/modules.d/90dmsquash-live/module-setup.sh
05988c
+++ b/modules.d/90dmsquash-live/module-setup.sh
05988c
@@ -11,13 +11,13 @@ check() {
05988c
 depends() {
05988c
     # if dmsetup is not installed, then we cannot support fedora/red hat
05988c
     # style live images
05988c
-    echo dm rootfs-block img-lib overlayfs
05988c
+    echo dm rootfs-block img-lib
05988c
     return 0
05988c
 }
05988c
 
05988c
 # called by dracut
05988c
 installkernel() {
05988c
-    instmods squashfs loop iso9660
05988c
+    instmods squashfs loop iso9660 overlay
05988c
 }
05988c
 
05988c
 # called by dracut
05988c
diff --git a/modules.d/90dmsquash-live/parse-dmsquash-live.sh b/modules.d/90dmsquash-live/parse-dmsquash-live.sh
05988c
index 1a316a2..8c4423b 100755
05988c
--- a/modules.d/90dmsquash-live/parse-dmsquash-live.sh
05988c
+++ b/modules.d/90dmsquash-live/parse-dmsquash-live.sh
05988c
@@ -39,9 +39,6 @@ case "$liveroot" in
05988c
     live:/*.[Ii][Mm][Gg] | /*.[Ii][Mm][Gg])
05988c
         [ -f "${root#live:}" ] && rootok=1
05988c
         ;;
05988c
-    live:nfs*)
05988c
-        rootok=1
05988c
-        ;;
05988c
 esac
05988c
 
05988c
 [ "$rootok" = "1" ] || return 1
05988c
diff --git a/modules.d/90overlayfs/module-setup.sh b/modules.d/90overlayfs/module-setup.sh
05988c
deleted file mode 100755
05988c
index 27aa7cf..0000000
05988c
--- a/modules.d/90overlayfs/module-setup.sh
05988c
+++ /dev/null
05988c
@@ -1,18 +0,0 @@
05988c
-#!/bin/bash
05988c
-
05988c
-check() {
05988c
-    [[ $hostonly ]] && return 1
05988c
-    return 255
05988c
-}
05988c
-
05988c
-depends() {
05988c
-    echo base
05988c
-}
05988c
-
05988c
-installkernel() {
05988c
-    instmods overlay
05988c
-}
05988c
-
05988c
-install() {
05988c
-    inst_hook mount 01 "$moddir/mount-overlayfs.sh"
05988c
-}
05988c
diff --git a/modules.d/90overlayfs/mount-overlayfs.sh b/modules.d/90overlayfs/mount-overlayfs.sh
05988c
deleted file mode 100755
05988c
index 7e2da1a..0000000
05988c
--- a/modules.d/90overlayfs/mount-overlayfs.sh
05988c
+++ /dev/null
05988c
@@ -1,33 +0,0 @@
05988c
-#!/bin/sh
05988c
-
05988c
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
05988c
-
05988c
-getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
05988c
-getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes"
05988c
-getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
05988c
-
05988c
-ROOTFLAGS="$(getarg rootflags)"
05988c
-
05988c
-if [ -n "$overlayfs" ]; then
05988c
-    if ! [ -e /run/rootfsbase ]; then
05988c
-        mkdir -m 0755 -p /run/rootfsbase
05988c
-        mount --bind "$NEWROOT" /run/rootfsbase
05988c
-    fi
05988c
-
05988c
-    mkdir -m 0755 -p /run/overlayfs
05988c
-    mkdir -m 0755 -p /run/ovlwork
05988c
-    if [ -n "$reset_overlay" ] && [ -h /run/overlayfs ]; then
05988c
-        ovlfsdir=$(readlink /run/overlayfs)
05988c
-        info "Resetting the OverlayFS overlay directory."
05988c
-        rm -r -- "${ovlfsdir:?}"/* "${ovlfsdir:?}"/.* > /dev/null 2>&1
05988c
-    fi
05988c
-    if [ -n "$readonly_overlay" ] && [ -h /run/overlayfs-r ]; then
05988c
-        ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase
05988c
-    else
05988c
-        ovlfs=lowerdir=/run/rootfsbase
05988c
-    fi
05988c
-
05988c
-    if ! strstr "$(cat /proc/mounts)" LiveOS_rootfs; then
05988c
-        mount -t overlay LiveOS_rootfs -o "$ROOTFLAGS,$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork "$NEWROOT"
05988c
-    fi
05988c
-fi
05988c
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
05988c
index d8a7bc7..5854ab8 100755
05988c
--- a/test/TEST-16-DMSQUASH/test.sh
05988c
+++ b/test/TEST-16-DMSQUASH/test.sh
05988c
@@ -15,12 +15,6 @@ test_run() {
05988c
     qemu_add_drive_args disk_index disk_args "$TESTDIR"/marker.img marker
05988c
     qemu_add_drive_args disk_index disk_args "$TESTDIR"/root.img root
05988c
 
05988c
-    "$testdir"/run-qemu \
05988c
-        "${disk_args[@]}" \
05988c
-        -boot order=d \
05988c
-        -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" \
05988c
-        -initrd "$TESTDIR"/initramfs.testing
05988c
-
05988c
     "$testdir"/run-qemu \
05988c
         "${disk_args[@]}" \
05988c
         -boot order=d \
05988c
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
05988c
index c637b57..2af41f4 100755
05988c
--- a/test/TEST-20-NFS/test.sh
05988c
+++ b/test/TEST-20-NFS/test.sh
05988c
@@ -173,14 +173,6 @@ test_nfsv3() {
05988c
     client_test "NFSv3 root=dhcp DHCP proto:IP:path,options" 52:54:00:12:34:07 \
05988c
         "root=dhcp" 192.168.50.3 wsize=4096 || return 1
05988c
 
05988c
-    client_test "NFSv3 Overlayfs root=nfs:..." 52:54:00:12:34:04 \
05988c
-        "root=nfs:192.168.50.1:/nfs/client rd.live.overlay.overlayfs=1" \
05988c
-        192.168.50.1 -wsize=4096 || return 1
05988c
-
05988c
-    client_test "NFSv3 Live Overlayfs root=nfs:..." 52:54:00:12:34:04 \
05988c
-        "root=nfs:192.168.50.1:/nfs/client rd.live.image rd.live.overlay.overlayfs=1" \
05988c
-        192.168.50.1 -wsize=4096 || return 1
05988c
-
05988c
     return 0
05988c
 }
05988c
 
05988c
@@ -400,7 +392,7 @@ test_setup() {
05988c
     # Make client's dracut image
05988c
     "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \
05988c
         -o "plymouth" \
05988c
-        -a "dmsquash-live debug watchdog ${USE_NETWORK}" \
05988c
+        -a "debug watchdog ${USE_NETWORK}" \
05988c
         --no-hostonly-cmdline -N \
05988c
         -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
05988c
 
05988c
-- 
05988c
2.39.1
05988c