From 9b3a34a754a12cfa73921bf2a4f8aea32cdb5fba Mon Sep 17 00:00:00 2001 From: Mateusz Sylwestrzak <401237-mattz7@users.noreply.gitlab.com> Date: Sat, 24 Feb 2024 01:53:23 +0100 Subject: [PATCH 1/2] refind: account for btrfs setups when generating manual stanzas --- srcpkgs/refind/files/kernel.post-install | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/srcpkgs/refind/files/kernel.post-install b/srcpkgs/refind/files/kernel.post-install index fd18f9c45ffe07..3b416721222f3e 100755 --- a/srcpkgs/refind/files/kernel.post-install +++ b/srcpkgs/refind/files/kernel.post-install @@ -22,12 +22,27 @@ tmpfile=$(mktemp /tmp/refind.XXXXXXX) zversion=$(echo "$VERSION" | sed 's/[.]/[.]/g') +# establish ESP mounting point +efipath=$(echo $REFIND_CONF | sed 's/\/EFI.*$//') +if [ $efipath = "/boot" ]; then # mounting ESP to /boot with vmlinuz- and intramfs- stored on the EFI partition + efiprefix="" +else + efiprefix="\/$(dirname $efipath)" # mounting ESP to /boot/efi or another path +fi +rootfslabel=$(blkid -s LABEL -o value $(df -P / | awk 'NR==2 {print $1}')) + +# account for the BTRFS setups including subvolumes +if df -T / | awk 'NR==2 && $2 == "btrfs" {print "Root filesystem is Btrfs"}'; then + rootfssubvol=$(btrfs subvolume show / | head -n1) + echo "Btrfs subvol for ROOT is: $rootfssubvol" +fi + zentry=$(cat < Date: Sun, 25 Feb 2024 15:58:55 +0100 Subject: [PATCH 2/2] refind: add LABEL and PREFIX variables --- srcpkgs/refind/files/kernel.post-install | 24 +++++--------------- srcpkgs/refind/files/refind-kernel-hook.conf | 8 ++++++- srcpkgs/refind/template | 1 - 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/srcpkgs/refind/files/kernel.post-install b/srcpkgs/refind/files/kernel.post-install index 3b416721222f3e..0a31aa747fe563 100755 --- a/srcpkgs/refind/files/kernel.post-install +++ b/srcpkgs/refind/files/kernel.post-install @@ -20,28 +20,16 @@ touch "$REFIND_CONF" tmpfile=$(mktemp /tmp/refind.XXXXXXX) -zversion=$(echo "$VERSION" | sed 's/[.]/[.]/g') - -# establish ESP mounting point -efipath=$(echo $REFIND_CONF | sed 's/\/EFI.*$//') -if [ $efipath = "/boot" ]; then # mounting ESP to /boot with vmlinuz- and intramfs- stored on the EFI partition - efiprefix="" -else - efiprefix="\/$(dirname $efipath)" # mounting ESP to /boot/efi or another path -fi -rootfslabel=$(blkid -s LABEL -o value $(df -P / | awk 'NR==2 {print $1}')) +: ${REFIND_LABEL:="Void Linux"} +: ${REFIND_BOOT_PREFIX:=""} -# account for the BTRFS setups including subvolumes -if df -T / | awk 'NR==2 && $2 == "btrfs" {print "Root filesystem is Btrfs"}'; then - rootfssubvol=$(btrfs subvolume show / | head -n1) - echo "Btrfs subvol for ROOT is: $rootfssubvol" -fi +zversion=$(echo "$VERSION" | sed 's/[.]/[.]/g') zentry=$(cat <