dracut/0022-fix-squash-explicitly-create-required-directories.patch
Pavel Valena 52fb8f6eda Rebase to dracut-102, and additional fixes.
From-source-git-commit: 56bf1917de004cd3f9032a68a6cd09d5bd972b04

Additional fixes:

 - support for erofs in squash modules
 - always include the resume module
 - include systemd config files from /usr/lib/systemd
 - only return block devices from get_persistent_dev
 - allow for \ in get_maj_min file path
 - install blk modules using symbol blk_alloc_disk

Resolves: RHEL-32237,RHEL-32506,RHEL-43460,RHEL-47145,RHEL-49744,RHEL-53350
2024-08-08 04:43:00 +02:00

56 lines
1.9 KiB
Diff

From a3ca60929c50f1a1d41cf4567e3a4a8231a92642 Mon Sep 17 00:00:00 2001
From: Philipp Rudo <prudo@redhat.com>
Date: Tue, 30 Jul 2024 13:35:17 +0200
Subject: [PATCH 22/24] fix(squash): explicitly create required directories
At the moment 99squash relies on dracut-install to create the required
directories it later links to. This approach is error prone and will
cause problems when switching to use 99busybox later on, which tries to
add a link to /usr/sbin that hasn't been created. Thus explicitly
create the expected directories before installing the minimal initrd.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
(cherry picked from commit dde95b10ff6b28330370fd697350f8bc5da422da)
Related: RHEL-43460
---
modules.d/99squash/module-setup.sh | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
index 5cbbec63..6aa649b7 100755
--- a/modules.d/99squash/module-setup.sh
+++ b/modules.d/99squash/module-setup.sh
@@ -40,12 +40,15 @@ squash_get_handler() {
}
squash_install() {
- local _busybox
+ local _busybox _dir
_busybox=$(find_binary busybox)
- # Create mount points for squash loader
- mkdir -p "$initdir"/squash/
- mkdir -p "$squashdir"/squash/
+ # Create mount points for squash loader and basic directories
+ mkdir -p "$initdir"/squash
+ for _dir in squash usr/bin usr/sbin usr/lib; do
+ mkdir -p "$squashdir/$_dir"
+ [[ $_dir == usr/* ]] && ln_r "/$_dir" "${_dir#usr}"
+ done
# Install required modules and binaries for the squash image init script.
if [[ $_busybox ]]; then
@@ -67,8 +70,6 @@ squash_install() {
dracut_kernel_post
# Install squash image init script.
- ln_r /usr/bin /bin
- ln_r /usr/sbin /sbin
inst_simple "$moddir"/init-squash.sh /init
# make sure that library links are correct and up to date for squash loader
--
2.42.0