2024-10-31 20:03:00 +00:00
|
|
|
From ac4b18bf89bfa440ff741557fe9928cd2b19b66e Mon Sep 17 00:00:00 2001
|
2024-07-22 17:47:47 +00:00
|
|
|
From: Philipp Rudo <prudo@redhat.com>
|
|
|
|
Date: Tue, 30 Jul 2024 17:24:28 +0200
|
2024-10-31 20:03:00 +00:00
|
|
|
Subject: [PATCH 18/32] feat(dracut-initramfs-restore): unpack erofs images
|
2024-07-22 17:47:47 +00:00
|
|
|
|
|
|
|
Follow the example for squashfs images and also unpack erofs images in
|
|
|
|
dracut-initramfs-restore.
|
|
|
|
|
|
|
|
Signed-off-by: Philipp Rudo <prudo@redhat.com>
|
|
|
|
|
|
|
|
(cherry picked from commit b390e194911835e6bd24eeeb0946e374852b8ddc)
|
|
|
|
|
|
|
|
Resolves: RHEL-43460
|
|
|
|
---
|
|
|
|
dracut-initramfs-restore.sh | 10 ++++++++--
|
|
|
|
modules.d/95squash-erofs/module-setup.sh | 2 +-
|
|
|
|
2 files changed, 9 insertions(+), 3 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
|
2024-10-31 20:03:00 +00:00
|
|
|
index 74725308..98cfaed7 100755
|
2024-07-22 17:47:47 +00:00
|
|
|
--- a/dracut-initramfs-restore.sh
|
|
|
|
+++ b/dracut-initramfs-restore.sh
|
2024-10-31 20:03:00 +00:00
|
|
|
@@ -81,12 +81,18 @@ else
|
2024-07-22 17:47:47 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
-if [[ -d squash ]]; then
|
|
|
|
- if ! unsquashfs -no-xattrs -f -d . squash-root.img > /dev/null; then
|
|
|
|
+if [[ -f squashfs-root.img ]]; then
|
|
|
|
+ if ! unsquashfs -no-xattrs -f -d . squashfs-root.img > /dev/null; then
|
|
|
|
echo "Squash module is enabled for this initramfs but failed to unpack squash-root.img" >&2
|
|
|
|
rm -f -- /run/initramfs/shutdown
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
+elif [[ -f erofs-root.img ]]; then
|
|
|
|
+ if ! fsck.erofs --extract=. --overwrite erofs-root.img > /dev/null; then
|
|
|
|
+ echo "Squash module is enabled for this initramfs but failed to unpack erofs-root.img" >&2
|
|
|
|
+ rm -f -- /run/initramfs/shutdown
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if grep -q -w selinux /sys/kernel/security/lsm 2> /dev/null \
|
|
|
|
diff --git a/modules.d/95squash-erofs/module-setup.sh b/modules.d/95squash-erofs/module-setup.sh
|
|
|
|
index 71c2b672..d763a902 100755
|
|
|
|
--- a/modules.d/95squash-erofs/module-setup.sh
|
|
|
|
+++ b/modules.d/95squash-erofs/module-setup.sh
|
|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
check() {
|
|
|
|
- require_binaries mkfs.erofs || return 1
|
|
|
|
+ require_binaries mkfs.erofs fsck.erofs || return 1
|
|
|
|
require_kernel_modules erofs || return 1
|
|
|
|
|
|
|
|
return 255
|
|
|
|
--
|
|
|
|
2.42.0
|
|
|
|
|