diff --git a/usr/bin/dracut-initramfs b/usr/bin/dracut-initramfs index aea71c1..d243e6c 100755 --- a/usr/bin/dracut-initramfs +++ b/usr/bin/dracut-initramfs @@ -119,7 +119,7 @@ if (( update_all )); then for kernel_path in /usr/lib/modules/*; do [ -f "$kernel_path/pkgbase" ] || continue - kernel_version=$(basename $kernel_path) + kernel_version=$(basename "$kernel_path") kernel_dir="/usr/lib/modules/$kernel_version" pkgbase="$kernel_dir/pkgbase" kernel_name=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "$pkgbase") @@ -141,13 +141,13 @@ function gen_image() { 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') + cmdline=$(head -n 1 < "/boot/refind_linux.conf" | 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') + cmdline=$(head -n 1 < "/efi/refind_linux.conf" | 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') + cmdline=$(head -n 1 < "/boot/efi/refind_linux.conf" | 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") @@ -169,7 +169,7 @@ function gen_image() { #dracut --force --kver "$kernel_version" "$BOOT_PATH/initramfs-$kernel_name-fallback.img" dracut --force --no-hostonly --no-hostonly-i18n --early-microcode --kernel-cmdline="$cmdline" --kver "$kernel_version" "$BOOT_PATH/initramfs-$kernel_name-fallback.img" - cp -vrf $vmlinuz $kernel_image + cp -vrf "$vmlinuz" "$kernel_image" } for kernel_name in "${!kernels[@]}"; do