Github messages for voidlinux
 help / color / mirror / Atom feed
From: slymattz <slymattz@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] refind: account for btrfs setups when generating manual stanzas
Date: Wed, 06 Mar 2024 20:49:09 +0100	[thread overview]
Message-ID: <20240306194909.10C3B23E39@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-48906@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2499 bytes --]

There is an updated pull request by slymattz against master on the void-packages repository

https://github.com/slymattz/void-packages refind
https://github.com/void-linux/void-packages/pull/48906

refind: account for btrfs setups when generating manual stanzas
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
I built this PR locally for my native architecture, x86_64-glibc as well as for aarch64-glibc [EDIT: Feb 26 09:34:52 PM CET 2024].

#### My setup
/etc/default/refind-kernel-hook.conf
```
#!/bin/sh

# Change this line to 1 to update refind conf whenever new kernel is installed
UPDATE_REFIND_CONF=1

# refind.conf location
# It usually stays in
#
# /boot/EFI/refind/refind.conf
#       if you use all default configuration and EFI partition mounted to /boot
# /boot/efi/EFI/refind/refind.conf
#       if using default configuration and EFI partition mounted to /boot/efi
# /boot/EFI/BOOT/refind.conf
#       if you run refind-install --usedefault and EFI partition mounted to /boot
# /boot/efi/EFI/BOOT/refind.conf
#       likewise, EFI mounted to /boot/efi
# /efi/EFI/refind/refind.conf
# /efi/EFI/BOOT/refind.conf
REFIND_CONF=/boot/efi/EFI/refind/refind.conf

# addition kernel cmdline
OPTIONS="root=UUID=a9ee6e45-d348-4214-9560-0d0c73ab8077 ro rootflags=subvol=void/ROOT quiet loglevel=4 mem_sleep_default=deep i915.modeset=1 video=1920x1080"
```
/boot/efi/EFI/refind/refind.conf
```
timeout 5
use_nvram false
scanfor internal,optical,manual
also_scan_dirs void/ROOT/boot
dont_scan_volumes FIRE1TB-EFI,FIRE1TB-tank,KC1TB-EFI,KC2TB-EFI,KC2TB-tank,WD1TB-EFI,WD1TB-tank
resolution 1920 1080
```
_scanfor internal_ works as it takes _also_scan_dirs_ as a prefix to where to find _vmlinuz_ and _initramfs_ files.

However, manual stanzas generated by _/etc/kernel.d/post-install/50-refind_ hook get me nowhere near bootable entries.

The patch that I came up with may not be perfect but it works on my installation.

Further testing is needed, especially for people with EFI mounted at /boot and using filesystems other than btrfs. 

To test the changes one needs to run xbps-reconfigure -f linux6.6 or whichever kernel one's running (also make sure to adjust the settings in _/etc/default/refind-kernel-hook.conf_)


A patch file from https://github.com/void-linux/void-packages/pull/48906.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-refind-48906.patch --]
[-- Type: text/x-diff, Size: 2387 bytes --]

From 0797306d299867020e6ffbac07273274eb4ca4c5 Mon Sep 17 00:00:00 2001
From: Mateusz Sylwestrzak <slymattz@gmail.com>
Date: Sat, 24 Feb 2024 01:53:23 +0100
Subject: [PATCH] refind: add BOOT_PREFIX and LABEL for misc setups

refind: add LABEL and PREFIX variables
---
 srcpkgs/refind/files/kernel.post-install     | 11 +++++++----
 srcpkgs/refind/files/refind-kernel-hook.conf |  8 +++++++-
 srcpkgs/refind/template                      |  1 -
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/refind/files/kernel.post-install b/srcpkgs/refind/files/kernel.post-install
index fd18f9c45ffe07..0a31aa747fe563 100755
--- a/srcpkgs/refind/files/kernel.post-install
+++ b/srcpkgs/refind/files/kernel.post-install
@@ -20,14 +20,17 @@ touch "$REFIND_CONF"
 
 tmpfile=$(mktemp /tmp/refind.XXXXXXX)
 
+: ${REFIND_LABEL:="Void Linux"}
+: ${REFIND_BOOT_PREFIX:=""}
+
 zversion=$(echo "$VERSION" | sed 's/[.]/[.]/g')
 
 zentry=$(cat <<EOF
 menuentry "Void Linux $VERSION" {
-	volume   "Void Linux"
-	loader   /vmlinuz-$VERSION
-	initrd   /initramfs-$VERSION.img
-	options  "$OPTIONS"
+        volume   "$REFIND_LABEL"
+        loader   $REFIND_BOOT_PREFIX/vmlinuz-$VERSION
+        initrd   $REFIND_BOOT_PREFIX/initramfs-$VERSION.img
+        options  "$OPTIONS"
 }
 EOF
 )
diff --git a/srcpkgs/refind/files/refind-kernel-hook.conf b/srcpkgs/refind/files/refind-kernel-hook.conf
index 5c48e89ebedad3..61b7ae64284a8a 100644
--- a/srcpkgs/refind/files/refind-kernel-hook.conf
+++ b/srcpkgs/refind/files/refind-kernel-hook.conf
@@ -18,5 +18,11 @@ UPDATE_REFIND_CONF=0
 # /efi/EFI/BOOT/refind.conf
 REFIND_CONF=/boot/EFI/refind/refind.conf
 
-# addition kernel cmdline
+# Set the label of the Void Linux filesystem
+REFIND_LABEL="Void Linux"
+
+# Set the path pointing to where rEFInd should look for vmlinuz and initramfs files, e.g. /boot
+REFIND_BOOT_PREFIX=""
+
+# Additional kernel cmdline parameters
 OPTIONS="quiet loglevel=4"
diff --git a/srcpkgs/refind/template b/srcpkgs/refind/template
index 94eda5ffc19543..9282941fd7114c 100644
--- a/srcpkgs/refind/template
+++ b/srcpkgs/refind/template
@@ -73,7 +73,6 @@ do_install() {
 	vinstall gptsync/gptsync_${_EFI_ARCH}.efi 644 \
 		usr/share/refind/tools_${_EFI_ARCH}/
 
-
 	vinstall "${FILESDIR}/refind-kernel-hook.conf" 644 etc/default
 	vinstall ${FILESDIR}/kernel.post-install 744 \
 		etc/kernel.d/post-install 50-refind

  parent reply	other threads:[~2024-03-06 19:49 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-24  1:28 [PR PATCH] " slymattz
2024-02-24 11:19 ` [PR PATCH] [Updated] " slymattz
2024-02-25 13:45 ` slymattz
2024-02-25 14:51 ` sgn
2024-02-25 14:53 ` [PR REVIEW] " sgn
2024-02-25 15:01 ` [PR PATCH] [Updated] " slymattz
2024-02-25 15:34 ` [PR REVIEW] " ahesford
2024-02-25 16:06 ` slymattz
2024-02-25 16:12 ` slymattz
2024-02-25 16:43 ` [PR PATCH] [Updated] " slymattz
2024-02-25 16:55 ` slymattz
2024-02-25 16:59 ` slymattz
2024-02-27 14:32 ` slymattz
2024-02-27 14:35 ` slymattz
2024-03-04 11:01 ` [PR REVIEW] " slymattz
2024-03-06 19:49 ` slymattz [this message]
2024-03-06 20:27 ` [PR PATCH] [Updated] " slymattz
2024-03-07 12:55 ` slymattz
2024-03-08 16:39 ` [PR PATCH] [Updated] " slymattz
2024-03-08 16:41 ` slymattz
2024-03-09  0:49 ` sgn
2024-03-09  8:21 ` slymattz
2024-03-09 20:30 ` slymattz
2024-03-14 19:05 ` slymattz
2024-03-15 18:15 ` [PR REVIEW] " ahesford
2024-03-15 18:15 ` ahesford
2024-03-15 18:15 ` ahesford
2024-03-16 21:03 ` [PR PATCH] [Updated] " slymattz
2024-03-16 21:09 ` slymattz
2024-03-18 15:18 ` ahesford
2024-03-18 17:33 ` [PR PATCH] [Updated] " slymattz
2024-03-18 17:36 ` slymattz
2024-03-18 17:37 ` slymattz
2024-03-18 18:50 ` [PR PATCH] [Updated] " slymattz
2024-03-18 18:53 ` slymattz
2024-03-18 19:09 ` slymattz
2024-03-18 19:40 ` [PR PATCH] [Updated] " slymattz
2024-03-18 19:47 ` slymattz
2024-03-18 20:12 ` slymattz
2024-03-18 20:13 ` slymattz
2024-03-19 18:31 ` slymattz
2024-03-21 14:49 ` [PR PATCH] [Updated] " slymattz
2024-03-21 15:23 ` [PR PATCH] [Closed]: " ahesford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240306194909.10C3B23E39@inbox.vuxu.org \
    --to=slymattz@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).