From bdfdbdee356cb83dad86f1d49fc21df9117ba8eb Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 8 Aug 2024 01:30:50 +0200 Subject: [PATCH 08/32] 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 1f7a9052..d436a357 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" | grep -oE "\S+$")" + _out="$(grep -m1 -oE "^${1//\\/\\\\} \S+$" "$get_maj_min_cache_file" | grep -oE "\S+$")" fi if ! [[ "$_out" ]]; then -- 2.42.0