From 4bfed7232748225f3faec9895fd84e69bd621dfb Mon Sep 17 00:00:00 2001 From: Valeria Fadeeva Date: Wed, 20 Dec 2023 20:50:16 +0500 Subject: [PATCH] Update --- .github/FUNDING.yml | 15 ---------- .../menu-template-fallback-only-efi-first.txt | 24 ++++++++++++++++ ...u-template-fallback-only-vmlinuz-first.txt | 28 +++++++++++++++++++ etc/refind-menu-generator/menu-template.conf | 1 + etc/refind-menu-generator/theme.conf | 1 - push.sh | 2 ++ usr/bin/refind-menu-generator | 10 ++++++- 7 files changed, 64 insertions(+), 17 deletions(-) delete mode 100755 .github/FUNDING.yml create mode 100644 etc/refind-menu-generator/menu-template-fallback-only-efi-first.txt create mode 100644 etc/refind-menu-generator/menu-template-fallback-only-vmlinuz-first.txt create mode 100644 etc/refind-menu-generator/menu-template.conf mode change 100755 => 100644 usr/bin/refind-menu-generator diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100755 index 77389e0..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,15 +0,0 @@ -# These are supported funding model platforms - -#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] - -#patreon: # Replace with a single Patreon username -#open_collective: # Replace with a single Open Collective username -#ko_fi: # Replace with a single Ko-fi username -#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -#liberapay: # Replace with a single Liberapay username -#issuehunt: # Replace with a single IssueHunt username -#otechie: # Replace with a single Otechie username -#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] -#github: [Valeria-Fadeeva] -custom: ["https://www.tinkoff.ru/rm/fadeeva.valeriya96/9bLRi79066", "https://yoomoney.ru/to/4100115921160758", "https://qiwi.com/n/VALERIAFADEEVA", "valeria.fadeeva.me"] diff --git a/etc/refind-menu-generator/menu-template-fallback-only-efi-first.txt b/etc/refind-menu-generator/menu-template-fallback-only-efi-first.txt new file mode 100644 index 0000000..110b5af --- /dev/null +++ b/etc/refind-menu-generator/menu-template-fallback-only-efi-first.txt @@ -0,0 +1,24 @@ +menuentry "EFI {OSNAME} ({KERNEL})" { + icon /EFI/refind/themes/{THEME}/icons/os_{ICON}.png + ostype Linux + graphics on + + loader /EFI/Linux/{KERNEL_EFI}-fallback.efi + + submenuentry "EFI {OSNAME} ({KERNEL}) terminal" { + loader /EFI/Linux/{KERNEL_EFI}-fallback-terminal.efi + } + + submenuentry "{OSNAME} ({KERNEL})" { + loader /EFI/Linux/{KERNEL_VMLINUZ} + initrd /EFI/Linux/{INITRAMFS}-fallback.img + options "{CMDLINE}" + } + + submenuentry "{OSNAME} ({KERNEL}) terminal" { + loader /EFI/Linux/{KERNEL_VMLINUZ} + initrd /EFI/Linux/{INITRAMFS}-fallback-terminal.img + options "{CMDLINE_TERMINAL}" + } +} + diff --git a/etc/refind-menu-generator/menu-template-fallback-only-vmlinuz-first.txt b/etc/refind-menu-generator/menu-template-fallback-only-vmlinuz-first.txt new file mode 100644 index 0000000..bb39abd --- /dev/null +++ b/etc/refind-menu-generator/menu-template-fallback-only-vmlinuz-first.txt @@ -0,0 +1,28 @@ +menuentry "{OSNAME} ({KERNEL})" { + icon /EFI/refind/themes/{THEME}/icons/os_{ICON}.png + ostype Linux + graphics on + + loader /EFI/Linux/{KERNEL_VMLINUZ} + initrd /EFI/Linux/{INITRAMFS}-fallback.img + options "{CMDLINE}" + + submenuentry "{OSNAME} ({KERNEL}) terminal" { + loader /EFI/Linux/{KERNEL_VMLINUZ} + initrd /EFI/Linux/{INITRAMFS}-fallback-terminal.img + options "{CMDLINE_TERMINAL}" + } + + submenuentry "EFI {OSNAME} ({KERNEL})" { + loader /EFI/Linux/{KERNEL_EFI}-fallback.efi + initrd + options + } + + submenuentry "EFI {OSNAME} ({KERNEL}) terminal" { + loader /EFI/Linux/{KERNEL_EFI}-fallback-terminal.efi + initrd + options + } +} + diff --git a/etc/refind-menu-generator/menu-template.conf b/etc/refind-menu-generator/menu-template.conf new file mode 100644 index 0000000..3078a40 --- /dev/null +++ b/etc/refind-menu-generator/menu-template.conf @@ -0,0 +1 @@ +menu-template-efi-first diff --git a/etc/refind-menu-generator/theme.conf b/etc/refind-menu-generator/theme.conf index 8d1c8b6..e69de29 100644 --- a/etc/refind-menu-generator/theme.conf +++ b/etc/refind-menu-generator/theme.conf @@ -1 +0,0 @@ - diff --git a/push.sh b/push.sh index a9a24d8..345883e 100755 --- a/push.sh +++ b/push.sh @@ -1,3 +1,5 @@ #!/bin/bash git add . && git commit -m "Update" && git push + +echo "Ready" diff --git a/usr/bin/refind-menu-generator b/usr/bin/refind-menu-generator old mode 100755 new mode 100644 index 06ae9cc..5c68782 --- a/usr/bin/refind-menu-generator +++ b/usr/bin/refind-menu-generator @@ -111,7 +111,15 @@ if [ -d "$KERNEL_DIR" ]; then manual_conf=$(mktemp) - template="/etc/refind-menu-generator/menu-template.txt" + + template_choice=$(cat "/etc/refind-menu-generator/menu-template.conf" | awk '{$1=$1;print}') + + if [ ! -f "/etc/refind-menu-generator/${template_choice}.txt" ] || [ "$(ls -s /etc/refind-menu-generator/${template_choice}.txt | awk '{print $1}')" -lt 10 ]; then + template="/etc/refind-menu-generator/menu-template.txt" + else + template="/etc/refind-menu-generator/${template_choice}.txt" + fi + kernels_list=$(ls -1 "${ESP}/EFI/Linux/" | grep 'linu' | grep -v 'fallback' | grep '\.efi$')