Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] efibootmgr: Add strict EFI support & remove broken restore logic
@ 2021-03-27 12:25 Dko1905
  2021-03-27 12:46 ` [PR REVIEW] " prez
                   ` (66 more replies)
  0 siblings, 67 replies; 68+ messages in thread
From: Dko1905 @ 2021-03-27 12:25 UTC (permalink / raw)
  To: ml

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

There is a new pull request by Dko1905 against master on the void-packages repository

https://github.com/Dko1905/void-packages master
https://github.com/void-linux/void-packages/pull/29780

efibootmgr: Add strict EFI support & remove broken restore logic
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [X] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->

I've just added a new option for using ".efi" suffixes, because some vendors don't support booting from non ".efi" files.
There are also small tab/space changes to make tabs more consistent.
The boot order "restore" functionality has been completely removed.

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

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

From 938735b97ce548b606c5cb6b641dd9fcf7cadcb2 Mon Sep 17 00:00:00 2001
From: Daniel Florescu <Daniel.florescu1905@protonmail.ch>
Date: Sat, 27 Mar 2021 10:16:45 +0100
Subject: [PATCH 1/2] efibootmgr: Add new option to EFI hook

- Add new option "USE_STRICT_EFI_SUFFIX" to post-install hook.
- Update README.voidlinux to show info about the new hook.
- Fix inconsistent use of spaces and tabs in post-install hook.
---
 srcpkgs/efibootmgr/files/README.voidlinux                | 8 ++++++--
 srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd    | 2 ++
 .../efibootmgr/files/kernel.d/efibootmgr.post-install    | 9 +++++++--
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/efibootmgr/files/README.voidlinux b/srcpkgs/efibootmgr/files/README.voidlinux
index 98844fd85a65..b7904be2be64 100644
--- a/srcpkgs/efibootmgr/files/README.voidlinux
+++ b/srcpkgs/efibootmgr/files/README.voidlinux
@@ -2,8 +2,8 @@ efibootmgr can automatically generate EFI boot entries to
 directly boot the kernel after every kernel update or installation.
 Enable this by editing /etc/default/efibootmgr-kernel-hook.
 
-The EFI variables need to be accessible in order for this to work, so
-add this line to your fstab and reboot or mount manually:
+The EFI variables need to be accessible in order for this to work, either
+boot into EFI mode or add this line to your fstab and reboot or mount:
   efivarfs /sys/firmware/efi/efivars efivarfs defaults 0 0
 -----------------------------------------------------------------------
 Kernel cmd options can be configured in /etc/default/efibootmgr-kernel-hook,
@@ -17,3 +17,7 @@ This is also required after the first installation of this package.
 The bootorder itself is not changed, so your previous boot loader will
 stay enabled until you can edit the order in your firmware interface or
 using "efibootmgr -o <hexnum>"
+-----------------------------------------------------------------------
+Some EFI implementations require the stub to end with a .efi suffix. If
+your implementation requires this, edit /etc/default/efibootmgr-kernel-hook
+and enable "USE_STRICT_EFI_SUFFIX=1".
diff --git a/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd b/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd
index 42adfc0da400..a6acde6a0d23 100644
--- a/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd
+++ b/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd
@@ -2,6 +2,8 @@
 MODIFY_EFI_ENTRIES=0
 # To allow efibootmgr to modify boot entries, set
 # MODIFY_EFI_ENTRIES=1
+# Use strict EFI file name spec. Default is 0
+# USE_STRICT_EFI_SUFFIX=0
 # Kernel command-line options.  Example:
 # OPTIONS="root=/dev/sda3 loglevel=4"
 # Disk where EFI Partition is.  Default is /dev/sda
diff --git a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install
index adf523e7b1fa..cbbc318aa58d 100644
--- a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install
+++ b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install
@@ -35,11 +35,16 @@ bootorder=$(efibootmgr |grep "BootOrder: " |cut -c 12-)
 
 # if existing, remove it
 if [ "$existing_entry" != "" ]; then
-  /etc/kernel.d/post-remove/50-efibootmgr $PKGNAME
+	/etc/kernel.d/post-remove/50-efibootmgr $PKGNAME
+fi
+
+# if using strict efi suffix, rename vmlinuz
+if [ "x${USE_STRICT_EFI_SUFFIX}" = x1 -a -f /boot/vmlinuz-${VERSION} ]; then
+	mv -f /boot/vmlinuz-${VERSION} /boot/vmlinuz-${VERSION}.efi
 fi
 
 # create the new entry
-efibootmgr -qc $args -L "Void Linux with kernel ${major_version}" -l /vmlinuz-${VERSION} -u "${OPTIONS}"
+efibootmgr -qc $args -L "Void Linux with kernel ${major_version}" -l /vmlinuz-${VERSION}.efi -u "${OPTIONS}"
 
 # restore the boot order
 efibootmgr -qo $bootorder

From cb1dd884526c04f3b3534d8ed03e0825ed6b4c1d Mon Sep 17 00:00:00 2001
From: Daniel Florescu <Daniel.florescu1905@protonmail.ch>
Date: Sat, 27 Mar 2021 12:55:26 +0100
Subject: [PATCH 2/2] efibootmgr: Remove the half broken boot order restore
 logic.

---
 srcpkgs/efibootmgr/files/README.voidlinux                 | 4 ----
 srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install | 7 -------
 2 files changed, 11 deletions(-)

diff --git a/srcpkgs/efibootmgr/files/README.voidlinux b/srcpkgs/efibootmgr/files/README.voidlinux
index b7904be2be64..7dfb5c05c7ba 100644
--- a/srcpkgs/efibootmgr/files/README.voidlinux
+++ b/srcpkgs/efibootmgr/files/README.voidlinux
@@ -14,10 +14,6 @@ but you always have to reconfigure the kernel:
 
 This is also required after the first installation of this package.
 -----------------------------------------------------------------------
-The bootorder itself is not changed, so your previous boot loader will
-stay enabled until you can edit the order in your firmware interface or
-using "efibootmgr -o <hexnum>"
------------------------------------------------------------------------
 Some EFI implementations require the stub to end with a .efi suffix. If
 your implementation requires this, edit /etc/default/efibootmgr-kernel-hook
 and enable "USE_STRICT_EFI_SUFFIX=1".
diff --git a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install
index cbbc318aa58d..7653d2db9ff3 100644
--- a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install
+++ b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install
@@ -28,11 +28,6 @@ major_version=$(echo $PKGNAME | cut -c 6-)
 # look for previous entry for this major kernel version
 existing_entry=$(efibootmgr | grep "Void Linux with kernel ${major_version}")
 
-# get the boot order
-# this is required because when in the next step the existing entry is removed,
-# it is also removed from the order so it needs to be restored later
-bootorder=$(efibootmgr |grep "BootOrder: " |cut -c 12-)
-
 # if existing, remove it
 if [ "$existing_entry" != "" ]; then
 	/etc/kernel.d/post-remove/50-efibootmgr $PKGNAME
@@ -46,5 +41,3 @@ fi
 # create the new entry
 efibootmgr -qc $args -L "Void Linux with kernel ${major_version}" -l /vmlinuz-${VERSION}.efi -u "${OPTIONS}"
 
-# restore the boot order
-efibootmgr -qo $bootorder

^ permalink raw reply	[flat|nested] 68+ messages in thread

end of thread, other threads:[~2021-09-28  9:16 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-27 12:25 [PR PATCH] efibootmgr: Add strict EFI support & remove broken restore logic Dko1905
2021-03-27 12:46 ` [PR REVIEW] " prez
2021-03-27 12:46 ` prez
2021-03-27 13:14 ` Dko1905
2021-03-27 13:48 ` [PR PATCH] [Updated] " Dko1905
2021-03-27 13:49 ` [PR REVIEW] " Dko1905
2021-03-27 13:50 ` Dko1905
2021-03-27 13:59 ` Dko1905
2021-03-27 16:20 ` Dko1905
2021-03-28  7:54 ` Dko1905
2021-04-11  2:59 ` ericonr
2021-04-11 14:01 ` [PR REVIEW] " sgn
2021-04-11 14:01 ` sgn
2021-04-11 14:01 ` sgn
2021-04-11 14:21 ` Duncaen
2021-04-11 14:23 ` Duncaen
2021-04-11 18:06 ` [PR REVIEW] " Dko1905
2021-04-11 18:07 ` Dko1905
2021-04-11 18:07 ` Dko1905
2021-04-11 18:09 ` Dko1905
2021-04-11 18:12 ` Dko1905
2021-04-27 12:27 ` [PR PATCH] [Updated] " Dko1905
2021-06-16  9:21 ` Dko1905
2021-08-25 20:03 ` Dko1905
2021-08-25 20:13 ` [PR REVIEW] " ericonr
2021-08-25 20:13 ` ericonr
2021-08-26  6:29 ` Dko1905
2021-08-26  6:35 ` Dko1905
2021-08-28 14:52 ` Dko1905
2021-08-28 14:59 ` Dko1905
2021-08-28 15:00 ` Dko1905
2021-08-28 17:46 ` ericonr
2021-08-29 16:15 ` [PR PATCH] [Updated] " Dko1905
2021-08-29 16:17 ` Dko1905
2021-09-04 15:15 ` Dko1905
2021-09-05 10:42 ` [PR PATCH] [Updated] " Dko1905
2021-09-05 10:42 ` Dko1905
2021-09-06 12:54 ` Dko1905
2021-09-06 17:11 ` [PR REVIEW] " tornaria
2021-09-06 17:16 ` tornaria
2021-09-06 17:22 ` tornaria
2021-09-06 17:35 ` tornaria
2021-09-06 17:42 ` ahesford
2021-09-06 17:42 ` ahesford
2021-09-06 17:47 ` tornaria
2021-09-07 15:08 ` Dko1905
2021-09-07 15:09 ` Dko1905
2021-09-07 15:49 ` Dko1905
2021-09-07 15:55 ` [PR PATCH] [Updated] " Dko1905
2021-09-07 15:56 ` [PR REVIEW] " Dko1905
2021-09-07 15:58 ` Dko1905
2021-09-07 16:05 ` ahesford
2021-09-07 22:34 ` tornaria
2021-09-07 22:46 ` tornaria
2021-09-07 22:49 ` tornaria
2021-09-07 22:49 ` tornaria
2021-09-08 11:41 ` [PR PATCH] [Updated] " Dko1905
2021-09-08 11:52 ` Dko1905
2021-09-08 11:52 ` [PR REVIEW] " Dko1905
2021-09-08 11:52 ` Dko1905
2021-09-08 11:52 ` Dko1905
2021-09-08 12:19 ` tornaria
2021-09-08 12:26 ` [PR REVIEW] " tornaria
2021-09-08 12:50 ` ahesford
2021-09-08 12:50 ` ahesford
2021-09-28  8:55 ` [PR PATCH] [Updated] " Dko1905
2021-09-28  8:55 ` [PR PATCH] [Closed]: " Dko1905
2021-09-28  9:16 ` Dko1905

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).