Init
This commit is contained in:
parent
1219839adb
commit
0275a669f8
|
@ -0,0 +1,25 @@
|
|||
pkgbase = melawy-refind-menu-generator
|
||||
pkgdesc = Menu generator for rEFInd loader for kernels in /ESP_PATH/EFI/Linux for Arch Linux
|
||||
pkgver = 0
|
||||
pkgrel = 1
|
||||
url = https://github.com/Valeria-Fadeeva/melawy-refind-menu-generator
|
||||
arch = any
|
||||
license = AGPL3
|
||||
depends = refind
|
||||
provides = dracut-hook-initramfs
|
||||
source = 10-refind-menu-pre-install.hook
|
||||
source = 60-refind-menu-remove.hook
|
||||
source = 90-refind-menu-install.hook
|
||||
source = menu-end.txt
|
||||
source = menu-template.txt
|
||||
source = menu-template-vmlinuz-first.txt
|
||||
source = refind-menu-generator
|
||||
sha256sums = dc46d6f2030d81a4e5034c1ed84424ce6c4844d933d60eadfacda1e45f17d3cd
|
||||
sha256sums = a27533ae3b81575c5497f18fdd28c4c908c5aff3da6af78095f65d5d350e4331
|
||||
sha256sums = 15152ac9be0ab0c42d343e5f86b2561232e05df2a7bc0cf01bd799494c0ba962
|
||||
sha256sums = e1d51fe5b37e42296dc6357fca48f0b68090ffdb1ec0ba2057320ad50e3e9e25
|
||||
sha256sums = a7381e88f569160a29d756a7bab2dcde4cc1f1e6d3d6b0c78535b24936989be8
|
||||
sha256sums = 8703c455516a95a87ff18e1c43ce98d2a1f74fddebfc9c091c75465e3ca185e9
|
||||
sha256sums = 8e91d5cf0d5bbed8d791acf4485d5c9e4250c8ed3bb13cc6ec1e51edf6ebd5ba
|
||||
|
||||
pkgname = melawy-refind-menu-generator
|
|
@ -0,0 +1,7 @@
|
|||
*.pkg.tar
|
||||
*.pkg.tar.*
|
||||
*.zst
|
||||
*.zst.*
|
||||
pkg/
|
||||
src/
|
||||
.idea/
|
|
@ -0,0 +1,17 @@
|
|||
[Trigger]
|
||||
Type = Path
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Target = efi/EFI/Linux/*
|
||||
Target = usr/lib/modules/*/pkgbase
|
||||
Target = usr/lib/dracut/*
|
||||
Target = usr/lib/systemd/systemd
|
||||
Target = usr/lib/systemd/boot/efi/*.efi.stub
|
||||
Target = usr/share/libalpm/hooks/90-refind-menu-install.hook
|
||||
Target = usr/bin/dracut-ukify
|
||||
Target = usr/src/*/dkms.conf
|
||||
|
||||
[Action]
|
||||
Description = Ensure ESP is mounted...
|
||||
When = PreTransaction
|
||||
Exec = /usr/bin/refind-menu-generator
|
|
@ -0,0 +1,12 @@
|
|||
[Trigger]
|
||||
Type = Path
|
||||
Operation = Remove
|
||||
Target = efi/EFI/Linux/*
|
||||
Target = usr/lib/modules/*/pkgbase
|
||||
Target = usr/src/*/dkms.conf
|
||||
|
||||
[Action]
|
||||
Description = Removing linux images...
|
||||
When = PreTransaction
|
||||
Exec = /usr/bin/refind-menu-generator
|
||||
NeedsTargets
|
|
@ -0,0 +1,18 @@
|
|||
[Trigger]
|
||||
Type = Path
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Target = efi/EFI/Linux/*
|
||||
Target = usr/lib/modules/*/pkgbase
|
||||
Target = usr/lib/dracut/*
|
||||
Target = usr/lib/systemd/systemd
|
||||
Target = usr/lib/systemd/boot/efi/*.efi.stub
|
||||
Target = usr/share/libalpm/hooks/90-refind-menu-install.hook
|
||||
Target = usr/bin/dracut-ukify
|
||||
Target = usr/src/*/dkms.conf
|
||||
|
||||
[Action]
|
||||
Description = Updating linux images...
|
||||
When = PostTransaction
|
||||
Exec = /usr/bin/refind-menu-generator
|
||||
NeedsTargets
|
|
@ -0,0 +1,39 @@
|
|||
# Maintainer: Valeria Fadeeva <valeria@fadeeva.me>
|
||||
|
||||
pkgname=melawy-refind-menu-generator
|
||||
pkgver=0
|
||||
pkgrel=1
|
||||
pkgdesc="Menu generator for rEFInd loader for kernels in /ESP_PATH/EFI/Linux for Arch Linux"
|
||||
url="https://github.com/Valeria-Fadeeva/melawy-refind-menu-generator"
|
||||
arch=(any)
|
||||
license=('AGPL3')
|
||||
depends=(refind)
|
||||
optdepends=()
|
||||
source=('10-refind-menu-pre-install.hook'
|
||||
'60-refind-menu-remove.hook'
|
||||
'90-refind-menu-install.hook'
|
||||
'menu-end.txt'
|
||||
'menu-template.txt'
|
||||
'menu-template-vmlinuz-first.txt'
|
||||
'refind-menu-generator')
|
||||
sha256sums=('dc46d6f2030d81a4e5034c1ed84424ce6c4844d933d60eadfacda1e45f17d3cd'
|
||||
'a27533ae3b81575c5497f18fdd28c4c908c5aff3da6af78095f65d5d350e4331'
|
||||
'15152ac9be0ab0c42d343e5f86b2561232e05df2a7bc0cf01bd799494c0ba962'
|
||||
'e1d51fe5b37e42296dc6357fca48f0b68090ffdb1ec0ba2057320ad50e3e9e25'
|
||||
'a7381e88f569160a29d756a7bab2dcde4cc1f1e6d3d6b0c78535b24936989be8'
|
||||
'8703c455516a95a87ff18e1c43ce98d2a1f74fddebfc9c091c75465e3ca185e9'
|
||||
'8e91d5cf0d5bbed8d791acf4485d5c9e4250c8ed3bb13cc6ec1e51edf6ebd5ba')
|
||||
backup=()
|
||||
provides=(dracut-hook-initramfs)
|
||||
conflicts=()
|
||||
|
||||
package() {
|
||||
install -Dm644 "${srcdir}/10-refind-menu-pre-install.hook" "${pkgdir}/usr/share/libalpm/hooks/10-refind-menu-pre-install.hook"
|
||||
install -Dm644 "${srcdir}/60-refind-menu-remove.hook" "${pkgdir}/usr/share/libalpm/hooks/60-refind-menu-remove.hook"
|
||||
install -Dm644 "${srcdir}/90-refind-menu-install.hook" "${pkgdir}/usr/share/libalpm/hooks/90-refind-menu-install.hook"
|
||||
mkdir -p "${pkgdir}/etc/refind-menu-generator"
|
||||
install -Dm644 "${srcdir}/menu-end.txt" "${pkgdir}/etc/refind-menu-generator/menu-end.txt"
|
||||
install -Dm644 "${srcdir}/menu-template.txt" "${pkgdir}/etc/refind-menu-generator/menu-template.txt"
|
||||
install -Dm644 "${srcdir}/menu-template.txt" "${pkgdir}/etc/refind-menu-generator/menu-template-vmlinuz-first.txt"
|
||||
install -Dm755 "${srcdir}/refind-menu-generator" "${pkgdir}/usr/bin/refind-menu-generator"
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo -n > sha256sum.txt
|
||||
|
||||
for i in *;
|
||||
do
|
||||
([ -f $i ] && [ "$i" != "PKGBUILD" ] && [ "$i" != "$(basename $0)" ] && [ "$i" != "sha256sum.txt" ] ) || continue
|
||||
echo $(sha256sum $i) | column -t >> sha256sum.txt
|
||||
done
|
||||
|
||||
makepkg --printsrcinfo > .SRCINFO
|
|
@ -0,0 +1,37 @@
|
|||
menuentry "rEFInd HARD" {
|
||||
icon /EFI/refind/themes/{THEME}/icons/os_systemd-boot.png
|
||||
ostype Linux
|
||||
graphics on
|
||||
loader /EFI/refind_hard/refind_x64.efi
|
||||
}
|
||||
|
||||
menuentry "Windows 11" {
|
||||
icon /EFI/refind/themes/{THEME}/icons/os_win11.png
|
||||
ostype Windows
|
||||
loader /EFI/ms11/Boot/bootmgfw.efi
|
||||
}
|
||||
|
||||
menuentry "Memtest86+ from EFI" {
|
||||
icon /EFI/refind/themes/{THEME}/icons/tool_memtest.png
|
||||
loader /EFI/memtest/bootx64.efi
|
||||
}
|
||||
|
||||
menuentry "GRUB" {
|
||||
icon /EFI/refind/themes/{THEME}/icons/os_systemd-boot.png
|
||||
ostype Linux
|
||||
graphics on
|
||||
loader /EFI/boot/grubx64.efi
|
||||
|
||||
disabled
|
||||
}
|
||||
|
||||
menuentry "Systemd Boot" {
|
||||
icon /EFI/refind/themes/{THEME}/icons/os_systemd-boot.png
|
||||
ostype Linux
|
||||
graphics on
|
||||
loader /EFI/systemd/systemd-bootx64.efi
|
||||
|
||||
disabled
|
||||
}
|
||||
|
||||
default_selection "linux"
|
|
@ -0,0 +1,32 @@
|
|||
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}
|
||||
options "{CMDLINE} initrd=EFI\Linux\intel-ucode.img initrd=EFI\Linux\amd-ucode.img"
|
||||
|
||||
submenuentry "{OSNAME} ({KERNEL}) fallback" {
|
||||
loader /EFI/Linux/{KERNEL_VMLINUZ}
|
||||
initrd /EFI/Linux/{INITRAMFS_FALLBACK}
|
||||
options "{CMDLINE} initrd=EFI\Linux\intel-ucode.img initrd=EFI\Linux\amd-ucode.img"
|
||||
}
|
||||
|
||||
submenuentry "EFI {OSNAME} ({KERNEL})" {
|
||||
loader /EFI/Linux/{KERNEL_EFI}.efi
|
||||
initrd
|
||||
options
|
||||
}
|
||||
|
||||
submenuentry "EFI {OSNAME} ({KERNEL}) fallback" {
|
||||
loader /EFI/Linux/{KERNEL_EFI}-fallback.efi
|
||||
initrd
|
||||
options
|
||||
}
|
||||
|
||||
submenuentry "Terminal" {
|
||||
add_options "systemd.unit=multi-user.target"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
menuentry "EFI {OSNAME} ({KERNEL})" {
|
||||
icon /EFI/refind/themes/{THEME}/icons/os_{ICON}.png
|
||||
ostype Linux
|
||||
graphics on
|
||||
|
||||
loader /EFI/Linux/{KERNEL_EFI}.efi
|
||||
|
||||
submenuentry "EFI {OSNAME} ({KERNEL}) fallback" {
|
||||
loader /EFI/Linux/{KERNEL_EFI}-fallback.efi
|
||||
}
|
||||
|
||||
submenuentry "Terminal" {
|
||||
add_options "systemd.unit=multi-user.target"
|
||||
}
|
||||
|
||||
submenuentry "{OSNAME} ({KERNEL})" {
|
||||
loader /EFI/Linux/{KERNEL_VMLINUZ}
|
||||
initrd /EFI/Linux/{INITRAMFS}
|
||||
options "{CMDLINE} initrd=EFI\Linux\intel-ucode.img initrd=EFI\Linux\amd-ucode.img"
|
||||
}
|
||||
|
||||
submenuentry "{OSNAME} ({KERNEL}) fallback" {
|
||||
loader /EFI/Linux/{KERNEL_VMLINUZ}
|
||||
initrd /EFI/Linux/{INITRAMFS_FALLBACK}
|
||||
options "{CMDLINE} initrd=EFI\Linux\intel-ucode.img initrd=EFI\Linux\amd-ucode.img"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
#!/bin/bash
|
||||
|
||||
function check_root {
|
||||
[ $EUID -eq 0 ] && return
|
||||
echo "refind-menu-generator requires root privileges to work" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
check_root
|
||||
|
||||
ESP_PATH=$(bootctl --print-esp-path)
|
||||
|
||||
KERNEL_DIR="$ESP_PATH/EFI/Linux"
|
||||
|
||||
theme=$(cat "$ESP_PATH/EFI/refind/refind.conf" | grep themes | cut -d"/" -f2)
|
||||
|
||||
if [ -d $KERNEL_DIR ]; then
|
||||
|
||||
if [ -f "/etc/kernel/cmdline" ]; then
|
||||
CMDLINE=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "/etc/kernel/cmdline")
|
||||
else
|
||||
CMDLINE=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' -e 's/initrd.*$//g' "/proc/cmdline")
|
||||
fi
|
||||
|
||||
manual_conf=$(mktemp)
|
||||
|
||||
template="/etc/refind-menu-generator/menu-template.txt"
|
||||
|
||||
for i in $(ls -1 /efi/EFI/Linux/ | grep 'linu' | grep -v 'fallback' | grep '\.efi$');
|
||||
do
|
||||
kernel=$(echo $i | sed 's/\.efi//g')
|
||||
kernel_efi=$kernel
|
||||
kernel_vmlinuz="vmlinuz-$kernel"
|
||||
|
||||
osname=$(cat /etc/os-release | grep "^NAME=" | cut -d'=' -f2 | sed -e 's/"//g')
|
||||
icon=$(cat /etc/os-release | grep "^ID=" | cut -d'=' -f2 | sed -e 's/"//g')
|
||||
|
||||
initramfs_tpl=$(echo "initramfs-$kernel" | sed "s/vmlinuz-//g")
|
||||
initramfs=$(echo "$initramfs_tpl.img")
|
||||
initramfs_fallback=$(echo "$initramfs_tpl-fallback.img")
|
||||
|
||||
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
|
||||
done
|
||||
|
||||
manual_end_conf=$(mktemp)
|
||||
|
||||
template_end="/etc/refind-menu-generator/menu-end.txt"
|
||||
|
||||
sed -e "s/{THEME}/$theme/g" $template_end >> $manual_end_conf
|
||||
|
||||
cat $manual_end_conf >> $manual_conf
|
||||
|
||||
sudo cp -vf $manual_conf "$ESP_PATH/EFI/refind/manual.conf"
|
||||
sudo cp -vf $manual_conf "$ESP_PATH/EFI/boot/manual.conf"
|
||||
|
||||
rm -f $manual_conf
|
||||
rm -f $manual_end_conf
|
||||
fi
|
|
@ -0,0 +1,8 @@
|
|||
dc46d6f2030d81a4e5034c1ed84424ce6c4844d933d60eadfacda1e45f17d3cd 10-refind-menu-pre-install.hook
|
||||
a27533ae3b81575c5497f18fdd28c4c908c5aff3da6af78095f65d5d350e4331 60-refind-menu-remove.hook
|
||||
15152ac9be0ab0c42d343e5f86b2561232e05df2a7bc0cf01bd799494c0ba962 90-refind-menu-install.hook
|
||||
9c69f495b12c45df9727d3e02219fc008cc2d8de5a519d7008af7f7ad9acaf7a melawy-refind-menu-generator-0-1-any.pkg.tar.zst
|
||||
e1d51fe5b37e42296dc6357fca48f0b68090ffdb1ec0ba2057320ad50e3e9e25 menu-end.txt
|
||||
a7381e88f569160a29d756a7bab2dcde4cc1f1e6d3d6b0c78535b24936989be8 menu-template.txt
|
||||
8703c455516a95a87ff18e1c43ce98d2a1f74fddebfc9c091c75465e3ca185e9 menu-template-vmlinuz-first.txt
|
||||
8e91d5cf0d5bbed8d791acf4485d5c9e4250c8ed3bb13cc6ec1e51edf6ebd5ba refind-menu-generator
|
Loading…
Reference in New Issue