From 6f1f3a529f80afc0799c3f63ddbbeb5c2c508b7d Mon Sep 17 00:00:00 2001 From: Valeria Fadeeva Date: Sun, 29 Oct 2023 13:28:39 +0500 Subject: [PATCH] Update --- .../menu-template-efi-first.txt | 8 +++---- .../menu-template-vmlinuz-first.txt | 8 +++---- etc/refind-menu-generator/menu-template.txt | 8 +++---- usr/bin/refind-menu-generator | 21 ++++++++++--------- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/etc/refind-menu-generator/menu-template-efi-first.txt b/etc/refind-menu-generator/menu-template-efi-first.txt index ee0bd4c..fb66f5c 100644 --- a/etc/refind-menu-generator/menu-template-efi-first.txt +++ b/etc/refind-menu-generator/menu-template-efi-first.txt @@ -15,20 +15,20 @@ menuentry "EFI {OSNAME} ({KERNEL})" { submenuentry "{OSNAME} ({KERNEL})" { loader /EFI/Linux/{KERNEL_VMLINUZ} - initrd /EFI/Linux/{INITRAMFS} + initrd /EFI/Linux/{INITRAMFS}.img options "{CMDLINE}" } submenuentry "{OSNAME} ({KERNEL}) fallback" { loader /EFI/Linux/{KERNEL_VMLINUZ} - initrd /EFI/Linux/{INITRAMFS_FALLBACK} + initrd /EFI/Linux/{INITRAMFS}-fallback.img options "{CMDLINE}" } submenuentry "{OSNAME} ({KERNEL}) fallback terminal" { loader /EFI/Linux/{KERNEL_VMLINUZ} - initrd /EFI/Linux/{INITRAMFS_FALLBACK} - options "{CMDLINE} systemd.unit=multi-user.target" + initrd /EFI/Linux/{INITRAMFS}-fallback-terminal.img + options "{CMDLINE_TERMINAL}" } } diff --git a/etc/refind-menu-generator/menu-template-vmlinuz-first.txt b/etc/refind-menu-generator/menu-template-vmlinuz-first.txt index 05d41f2..5765a9c 100644 --- a/etc/refind-menu-generator/menu-template-vmlinuz-first.txt +++ b/etc/refind-menu-generator/menu-template-vmlinuz-first.txt @@ -4,19 +4,19 @@ menuentry "{OSNAME} ({KERNEL})" { graphics on loader /EFI/Linux/{KERNEL_VMLINUZ} - initrd /EFI/Linux/{INITRAMFS} + initrd /EFI/Linux/{INITRAMFS}.img options "{CMDLINE}" submenuentry "{OSNAME} ({KERNEL}) fallback" { loader /EFI/Linux/{KERNEL_VMLINUZ} - initrd /EFI/Linux/{INITRAMFS_FALLBACK} + initrd /EFI/Linux/{INITRAMFS}-fallback.img options "{CMDLINE}" } submenuentry "{OSNAME} ({KERNEL}) fallback terminal" { loader /EFI/Linux/{KERNEL_VMLINUZ} - initrd /EFI/Linux/{INITRAMFS_FALLBACK} - options "{CMDLINE} systemd.unit=multi-user.target" + initrd /EFI/Linux/{INITRAMFS}-fallback-terminal.img + options "{CMDLINE_TERMINAL}" } submenuentry "EFI {OSNAME} ({KERNEL})" { diff --git a/etc/refind-menu-generator/menu-template.txt b/etc/refind-menu-generator/menu-template.txt index ee0bd4c..fb66f5c 100644 --- a/etc/refind-menu-generator/menu-template.txt +++ b/etc/refind-menu-generator/menu-template.txt @@ -15,20 +15,20 @@ menuentry "EFI {OSNAME} ({KERNEL})" { submenuentry "{OSNAME} ({KERNEL})" { loader /EFI/Linux/{KERNEL_VMLINUZ} - initrd /EFI/Linux/{INITRAMFS} + initrd /EFI/Linux/{INITRAMFS}.img options "{CMDLINE}" } submenuentry "{OSNAME} ({KERNEL}) fallback" { loader /EFI/Linux/{KERNEL_VMLINUZ} - initrd /EFI/Linux/{INITRAMFS_FALLBACK} + initrd /EFI/Linux/{INITRAMFS}-fallback.img options "{CMDLINE}" } submenuentry "{OSNAME} ({KERNEL}) fallback terminal" { loader /EFI/Linux/{KERNEL_VMLINUZ} - initrd /EFI/Linux/{INITRAMFS_FALLBACK} - options "{CMDLINE} systemd.unit=multi-user.target" + initrd /EFI/Linux/{INITRAMFS}-fallback-terminal.img + options "{CMDLINE_TERMINAL}" } } diff --git a/usr/bin/refind-menu-generator b/usr/bin/refind-menu-generator index 67fa367..47f15d5 100755 --- a/usr/bin/refind-menu-generator +++ b/usr/bin/refind-menu-generator @@ -87,25 +87,27 @@ theme=$(cat "/etc/refind-menu-generator/theme.conf" | awk '{$1=$1;print}') if [ -d "$KERNEL_DIR" ]; then if [ -f "${ESP}/EFI/Linux/cmdline.txt" ]; then - CMDLINE=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "${ESP}/EFI/Linux/cmdline.txt") + cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "${ESP}/EFI/Linux/cmdline.txt") elif [ -f "/etc/kernel/cmdline" ]; then - CMDLINE=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "/etc/kernel/cmdline") + cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "/etc/kernel/cmdline") elif [ -f "/boot/refind_linux.conf" ]; then - CMDLINE=$(head -n 1 < "/boot/refind_linux.conf" | 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=$(head -n 1 < "/efi/refind_linux.conf" | 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=$(head -n 1 < "/boot/efi/refind_linux.conf" | 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") + cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' -e 's/initrd.*$//g' "/proc/cmdline") fi - echo "$CMDLINE" + cmdline_terminal="$cmdline systemd.unit=multi-user.target" + + echo "$cmdline" manual_conf=$(mktemp) @@ -124,10 +126,9 @@ if [ -d "$KERNEL_DIR" ]; then initramfs_tpl=$(echo "initramfs-$kernel" | sed "s/vmlinuz-//g") initramfs="$initramfs_tpl.img" - initramfs_fallback="$initramfs_tpl-fallback.img" - echo "OSNAME: $osname; THEME: $theme; ICON: $icon; KERNEL: $kernel; KERNEL_EFI: $kernel_efi; KERNEL_VMLINUZ: $kernel_vmlinuz; INITRAMFS: $initramfs; INITRAMFS_FALLBACK: $initramfs_fallback; CMDLINE: $CMDLINE" - sed -e "s|{OSNAME}|$osname|g" -e "s|{THEME}|$theme|g" -e "s|{ICON}|$icon|g" -e "s|{KERNEL}|$kernel|g" -e "s|{KERNEL_EFI}|$kernel_efi|g" -e "s|{KERNEL_VMLINUZ}|$kernel_vmlinuz|g" -e "s|{INITRAMFS}|$initramfs|g" -e "s|{INITRAMFS_FALLBACK}|$initramfs_fallback|g" -e "s|{CMDLINE}|$CMDLINE|g" "$template" >> "$manual_conf" + echo "OSNAME: $osname; THEME: $theme; ICON: $icon; KERNEL: $kernel; KERNEL_EFI: $kernel_efi; KERNEL_VMLINUZ: $kernel_vmlinuz; INITRAMFS: $initramfs; CMDLINE: $cmdline" + sed -e "s|{OSNAME}|$osname|g" -e "s|{THEME}|$theme|g" -e "s|{ICON}|$icon|g" -e "s|{KERNEL}|$kernel|g" -e "s|{KERNEL_EFI}|$kernel_efi|g" -e "s|{KERNEL_VMLINUZ}|$kernel_vmlinuz|g" -e "s|{INITRAMFS}|$initramfs|g" -e "s|{CMDLINE}|$cmdline|g" -e "s|{CMDLINE_TERMINAL}|$cmdline_terminal|g" "$template" >> "$manual_conf" done manual_end_conf=$(mktemp)