dracut/0011-fix-dracut-functions-allow-for-in-get_maj_min-file-p.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

32 lines
967 B
Diff

From a891ae527aaf3c015d3b4b0290655b89fdf8f03d Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Thu, 8 Aug 2024 01:30:50 +0200
Subject: [PATCH 11/24] fix(dracut-functions): allow for \ in get_maj_min file
path
as the path might be f.e. /dev/disk/by-partlabel/EFI\x20System\x20Partition
which would produce Warning 'grep: warning: stray \ before x' in get_maj_min
Resolves: RHEL-47145
---
dracut-functions.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index f9e5d3bc..c8cb2e15 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -243,7 +243,7 @@ get_maj_min() {
local _out
if [[ $get_maj_min_cache_file ]]; then
- _out="$(grep -m1 -oE "^$1 \S+$" "$get_maj_min_cache_file" | awk '{print $NF}')"
+ _out="$(grep -m1 -oE "^${1//\\/\\\\} \S+$" "$get_maj_min_cache_file" | awk '{print $NF}')"
fi
if ! [[ "$_out" ]]; then
--
2.42.0