From 6d2df689d904fdc69ad20f914368caa951f62912 Mon Sep 17 00:00:00 2001 From: Valeria Fadeeva Date: Wed, 18 Oct 2023 13:32:11 +0500 Subject: [PATCH] Update --- usr/bin/dracut-ukify | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/usr/bin/dracut-ukify b/usr/bin/dracut-ukify index 74b305e..e11fce8 100755 --- a/usr/bin/dracut-ukify +++ b/usr/bin/dracut-ukify @@ -71,7 +71,7 @@ EOF echo "Check Secure Boot keys" declare -a keys=("/etc/kernel/secure-boot.key.pem" "/etc/kernel/secure-boot.cert.pem" "/etc/kernel/pcr-initrd.key.pem" "/etc/kernel/pcr-initrd.pub.pem" "/etc/kernel/pcr-system.key.pem" "/etc/kernel/pcr-system.pub.pem") - for i in ${keys[@]} + for i in "${keys[@]}" do if [ -f "${i}" ] then @@ -80,9 +80,9 @@ EOF fi done - if [[ $keys_count < 6 ]] + if [[ $keys_count -lt 6 ]] then - for i in ${keys[@]} + for i in "${keys[@]}" do if [ -f "${i}" ] then @@ -142,12 +142,12 @@ while getopts ":hag:xyz" arg; do efi_image_fallback="$BOOT_PATH/$kernel_name-fallback.efi" declare -a images=() - images+=($efi_image) - images+=($efi_image_fallback) + images+=("$efi_image") + images+=("$efi_image_fallback") for image in "${images[@]}"; do - if [ -f ]; then + if [ -f "$image" ]; then echo "==> Removing $image..." rm -f $image fi @@ -205,12 +205,16 @@ function gen_image() { if [ -f "/etc/kernel/cmdline" ]; then cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "/etc/kernel/cmdline") + elif [ -f "/boot/refind_linux.conf" ]; then cmdline=$(cat "/boot/refind_linux.conf" | head -n 1 | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') + elif [ -f "/efi/refind_linux.conf" ]; then cmdline=$(cat "/efi/refind_linux.conf" | head -n 1 | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') + elif [ -f "/boot/efi/refind_linux.conf" ]; then cmdline=$(cat "/boot/efi/refind_linux.conf" | head -n 1 | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') + else cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' -e 's/initrd.*$//g' "/proc/cmdline") fi