diff --git a/dracut-initramfs b/dracut-initramfs index e028a37..06fb865 100755 --- a/dracut-initramfs +++ b/dracut-initramfs @@ -20,7 +20,24 @@ fi declare -a ukify_global_args=() ESP_PATH=$(bootctl --print-esp-path) -BOOT_PATH="${ESP_PATH}/EFI/Linux" +if [ -z "$ESP_PATH" ]; then + exit +else + + if [ ! -d "${ESP_PATH}/EFI/Linux" ]; then + if [ -d "${ESP_PATH}/EFI/linux" ]; then + BOOT_PATH="${ESP_PATH}/EFI/linux" + fi + else + BOOT_PATH="${ESP_PATH}/EFI/Linux" + fi + + if [ -z "$BOOT_PATH" ]; then + mkdir -p "${ESP_PATH}/EFI/Linux" + BOOT_PATH="${ESP_PATH}/EFI/linux" + fi + +fi declare -A kernels update_all=0