From 17f59cf905d295ca7e2cfccab3d0d05a1bd45f6e Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 21:56:17 +0100 Subject: [PATCH] 99squash-live: added patch to resync with 90dmsquash-live to fix recent boot problems [release 049-2mamba;Sat Jan 12 2019] --- ...49-squash-overlayfs-live-openmamba-2.patch | 165 ++++++++++++++++++ dracut.spec | 22 ++- 2 files changed, 185 insertions(+), 2 deletions(-) create mode 100644 dracut-049-squash-overlayfs-live-openmamba-2.patch diff --git a/dracut-049-squash-overlayfs-live-openmamba-2.patch b/dracut-049-squash-overlayfs-live-openmamba-2.patch new file mode 100644 index 0000000..b55b5f3 --- /dev/null +++ b/dracut-049-squash-overlayfs-live-openmamba-2.patch @@ -0,0 +1,165 @@ +diff -Nru dracut-049.orig/modules.d/99squash-live/module-setup.sh dracut-049/modules.d/99squash-live/module-setup.sh +--- dracut-049.orig/modules.d/99squash-live/module-setup.sh 2019-01-12 15:30:47.223331178 +0100 ++++ dracut-049/modules.d/99squash-live/module-setup.sh 2019-01-12 17:07:25.742047276 +0100 +@@ -25,6 +25,7 @@ + inst_hook pre-pivot 20 "$moddir/apply-live-updates.sh" + inst_script "$moddir/squash-live-root.sh" "/sbin/squash-live-root" + inst_script "$moddir/iso-scan.sh" "/sbin/iso-scan" ++ inst_script "$moddir/squash-generator.sh" $systemdutildir/system-generators/dracut-squash-generator + # should probably just be generally included + inst_rules 60-cdrom_id.rules + inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service" +diff -Nru dracut-049.orig/modules.d/99squash-live/parse-squash-live.sh dracut-049/modules.d/99squash-live/parse-squash-live.sh +--- dracut-049.orig/modules.d/99squash-live/parse-squash-live.sh 2019-01-12 15:30:47.223331178 +0100 ++++ dracut-049/modules.d/99squash-live/parse-squash-live.sh 2019-01-12 18:52:41.335714197 +0100 +@@ -15,7 +15,7 @@ + liveroot=$root + fi + +-[ "${liveroot%%:*}" = "live" ] || return ++[ "${liveroot%%:*}" = "live" ] || return 1 + + modprobe -q loop + +@@ -51,7 +51,13 @@ + live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg]) + [ -f "${root#live:}" ] && rootok=1 ;; + esac ++[ "$rootok" = "1" ] || return 1 ++ + info "root was $liveroot, is now $root" + + # make sure that init doesn't complain + [ -z "$root" ] && root="live" ++ ++wait_for_dev -n /dev/root ++ ++return 0 +diff -Nru dracut-049.orig/modules.d/99squash-live/squash-generator.sh dracut-049/modules.d/99squash-live/squash-generator.sh +--- dracut-049.orig/modules.d/99squash-live/squash-generator.sh 1970-01-01 01:00:00.000000000 +0100 ++++ dracut-049/modules.d/99squash-live/squash-generator.sh 2019-01-12 17:08:06.813220403 +0100 +@@ -0,0 +1,89 @@ ++#!/bin/sh ++ ++type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh ++ ++[ -z "$root" ] && root=$(getarg root=) ++ ++# support legacy syntax of passing liveimg and then just the base root ++if getargbool 0 rd.live.image -d -y liveimg; then ++ liveroot="live:$root" ++fi ++ ++if [ "${root%%:*}" = "live" ] ; then ++ liveroot=$root ++fi ++ ++[ "${liveroot%%:*}" = "live" ] || exit 0 ++ ++case "$liveroot" in ++ live:LABEL=*|LABEL=*) \ ++ root="${root#live:}" ++ root="${root//\//\\x2f}" ++ root="live:/dev/disk/by-label/${root#LABEL=}" ++ rootok=1 ;; ++ live:CDLABEL=*|CDLABEL=*) \ ++ root="${root#live:}" ++ root="${root//\//\\x2f}" ++ root="live:/dev/disk/by-label/${root#CDLABEL=}" ++ rootok=1 ;; ++ live:UUID=*|UUID=*) \ ++ root="${root#live:}" ++ root="live:/dev/disk/by-uuid/${root#UUID=}" ++ rootok=1 ;; ++ live:PARTUUID=*|PARTUUID=*) \ ++ root="${root#live:}" ++ root="live:/dev/disk/by-partuuid/${root#PARTUUID=}" ++ rootok=1 ;; ++ live:PARTLABEL=*|PARTLABEL=*) \ ++ root="${root#live:}" ++ root="live:/dev/disk/by-partlabel/${root#PARTLABEL=}" ++ rootok=1 ;; ++ live:/*.[Ii][Ss][Oo]|/*.[Ii][Ss][Oo]) ++ root="${root#live:}" ++ root="liveiso:${root}" ++ rootok=1 ;; ++ live:/dev/*) ++ rootok=1 ;; ++ live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg]) ++ [ -f "${root#live:}" ] && rootok=1 ;; ++esac ++ ++[ "$rootok" != "1" ] && exit 0 ++ ++GENERATOR_DIR="$2" ++[ -z "$GENERATOR_DIR" ] && exit 1 ++[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR" ++ ++getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay="" ++getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes" ++[ -e /xor_overlayfs ] && xor_overlayfs="yes" ++[ -e /xor_readonly ] && xor_readonly="--readonly" ++ROOTFLAGS="$(getarg rootflags)" ++{ ++ echo "[Unit]" ++ echo "Before=initrd-root-fs.target" ++ echo "[Mount]" ++ echo "Where=/sysroot" ++ if [ "$overlayfs$xor_overlayfs" = "yes" ]; then ++ echo "What=LiveOS_rootfs" ++ if [ "$readonly_overlay$xor_readonly" = "--readonly" ]; then ++ ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase ++ else ++ ovlfs=lowerdir=/run/rootfsbase ++ fi ++ echo "Options=${ROOTFLAGS},${ovlfs},upperdir=/run/overlayfs,workdir=/run/ovlwork" ++ echo "Type=overlay" ++ _dev=LiveOS_rootfs ++ else ++ echo "What=/dev/mapper/live-rw" ++ [ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}" ++ _dev=$'dev-mapper-live\\x2drw' ++ fi ++} > "$GENERATOR_DIR"/sysroot.mount ++ ++mkdir -p "$GENERATOR_DIR/$_dev.device.d" ++{ ++ echo "[Unit]" ++ echo "JobTimeoutSec=3000" ++ echo "JobRunningTimeoutSec=3000" ++} > "$GENERATOR_DIR/$_dev.device.d/timeout.conf" +diff -Nru dracut-049.orig/modules.d/99squash-live/squash-live-genrules.sh dracut-049/modules.d/99squash-live/squash-live-genrules.sh +--- dracut-049.orig/modules.d/99squash-live/squash-live-genrules.sh 2019-01-12 15:30:47.223331178 +0100 ++++ dracut-049/modules.d/99squash-live/squash-live-genrules.sh 2019-01-12 18:57:20.519965163 +0100 +@@ -1,16 +1,18 @@ + #!/bin/sh +-if [ "${root%%:*}" = "live" ]; then ++ ++case "$root" in ++ live:/dev/*) + { +- printf 'KERNEL=="%s", SYMLINK+="live"\n' \ +- ${root#live:/dev/} +- printf 'SYMLINK=="%s", SYMLINK+="live"\n' \ +- ${root#live:/dev/} +- } >> /etc/udev/rules.d/99-live-mount.rules +- { +- printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/squash-live-root $env{DEVNAME}"\n' \ +- ${root#live:/dev/} +- printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/squash-live-root $env{DEVNAME}"\n' \ +- ${root#live:/dev/} ++ printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/squash-live-root %s"\n' \ ++ "${root#live:/dev/}" "${root#live:}" ++ printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/squash-live-root %s"\n' \ ++ "${root#live:/dev/}" "${root#live:}" + } >> /etc/udev/rules.d/99-live-squash.rules +- echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/squash.sh +-fi ++ wait_for_dev -n "${root#live:}" ++ ;; ++ live:*) ++ if [ -f "${root#live:}" ]; then ++ /sbin/initqueue --settled --onetime --unique /sbin/squash-live-root "${root#live:}" ++ fi ++ ;; ++esac diff --git a/dracut.spec b/dracut.spec index a851d15..565d72a 100644 --- a/dracut.spec +++ b/dracut.spec @@ -1,6 +1,6 @@ Name: dracut -Version: 048 -Release: 3mamba +Version: 049 +Release: 2mamba Summary: Generic, modular initramfs generation tool that can be used across various distributions Group: System/Kernel and Hardware Vendor: openmamba @@ -25,6 +25,7 @@ Patch20: dracut-040-fix-autofs4-ipv6-modules.patch Patch21: dracut-040-dmsetup_fix_path.patch Patch22: dracut-040-add_systemd_journald_socket.patch Patch23: dracut-044-bash-4.4.patch +Patch24: dracut-049-squash-overlayfs-live-openmamba-2.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -116,6 +117,7 @@ This package conatins extra optional modules for dracut. %patch21 -p1 #%patch22 -p1 #%patch23 -p1 +%patch24 -p1 chmod +x modules.d/99squash-live/* # remove *.orig files created by patched to prevent from being installed @@ -186,6 +188,8 @@ fi %{_prefix}/lib/dracut/modules.d/00dash/* %dir %{_prefix}/lib/dracut/modules.d/00systemd %{_prefix}/lib/dracut/modules.d/00systemd/* +%dir %{_prefix}/lib/dracut/modules.d/00warpclock +%{_prefix}/lib/dracut/modules.d/00warpclock/* %dir %{_prefix}/lib/dracut/modules.d/01systemd-initrd %{_prefix}/lib/dracut/modules.d/01systemd-initrd/* %dir %{_prefix}/lib/dracut/modules.d/02systemd-networkd @@ -206,6 +210,10 @@ fi #%{_prefix}/lib/dracut/modules.d/10rpmversion/* %dir %{_prefix}/lib/dracut/modules.d/30convertfs %{_prefix}/lib/dracut/modules.d/30convertfs/* +%dir %{_prefix}/lib/dracut/modules.d/35network-legacy +%{_prefix}/lib/dracut/modules.d/35network-legacy/* +%dir %{_prefix}/lib/dracut/modules.d/35network-manager +%{_prefix}/lib/dracut/modules.d/35network-manager/* %dir %{_prefix}/lib/dracut/modules.d/40network %{_prefix}/lib/dracut/modules.d/40network/* %dir %{_prefix}/lib/dracut/modules.d/45ifcfg @@ -242,6 +250,8 @@ fi %{_prefix}/lib/dracut/modules.d/90kernel-modules/* %dir %{_prefix}/lib/dracut/modules.d/90kernel-network-modules %{_prefix}/lib/dracut/modules.d/90kernel-network-modules/* +%dir %{_prefix}/lib/dracut/modules.d/90kernel-modules-extra +%{_prefix}/lib/dracut/modules.d/90kernel-modules-extra/* %dir %{_prefix}/lib/dracut/modules.d/90livenet %{_prefix}/lib/dracut/modules.d/90livenet/* %dir %{_prefix}/lib/dracut/modules.d/90mdraid @@ -330,6 +340,8 @@ fi %{_prefix}/lib/dracut/modules.d/99shutdown/* %dir %{_prefix}/lib/dracut/modules.d/99squash-live %{_prefix}/lib/dracut/modules.d/99squash-live/* +%dir %{_prefix}/lib/dracut/modules.d/99squash +%{_prefix}/lib/dracut/modules.d/99squash/* %dir %{_prefix}/lib/dracut/modules.d/99uefi-lib %{_prefix}/lib/dracut/modules.d/99uefi-lib/* %dir %{_prefix}/lib/kernel @@ -384,6 +396,12 @@ fi #%doc NEWS README README.generic README.kernel README.modules TODO %changelog +* Sat Jan 12 2019 Silvan Calarco 049-2mamba +- 99squash-live: added patch to resync with 90dmsquash-live to fix recent boot problems + +* Sat Jan 12 2019 Silvan Calarco 049-1mamba +- update to 049 + * Fri Aug 10 2018 Silvan Calarco 048-3mamba - move stratis module to -extras package