From: Dko1905 <Dko1905@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] efibootmgr: Add strict EFI support & remove broken restore logic
Date: Tue, 07 Sep 2021 17:55:59 +0200 [thread overview]
Message-ID: <20210907155559.LTRcSqxrfvN-W0wz614t7umm8r0C_2GqoLtqEBL9Xuo@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-29780@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]
There is an updated 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: 5036 bytes --]
From f9e622ff3b98f20a24a42c03ad3c3da337e4b25b 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] 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.
- Bump revision number in template.
---
srcpkgs/efibootmgr/files/README.voidlinux | 10 +++----
.../files/efibootmgr-kernel-hook.confd | 2 ++
.../files/kernel.d/efibootmgr.post-install | 29 ++++++++++++-------
srcpkgs/efibootmgr/template | 2 +-
4 files changed, 26 insertions(+), 17 deletions(-)
diff --git a/srcpkgs/efibootmgr/files/README.voidlinux b/srcpkgs/efibootmgr/files/README.voidlinux
index 98844fd85a65..91d92e02ddd6 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, make sure
+efivarfs is mounted 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,
@@ -14,6 +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/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..aacf3c2aa9dd 100644
--- a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install
+++ b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install
@@ -28,18 +28,25 @@ 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
+ /etc/kernel.d/post-remove/50-efibootmgr $PKGNAME
fi
-# create the new entry
-efibootmgr -qc $args -L "Void Linux with kernel ${major_version}" -l /vmlinuz-${VERSION} -u "${OPTIONS}"
-
-# restore the boot order
-efibootmgr -qo $bootorder
+# if using strict efi suffix
+if [ "x${USE_STRICT_EFI_SUFFIX}" = x1 ]; then
+ # rename vmlinuz
+ if [ -f /boot/vmlinuz-${VERSION} ]; then
+ cp -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}.efi -u "${OPTIONS}"
+else
+ # remove efi
+ if [ -f /boot/vmlinuz-${VERSION}.efi ]; then
+ # vmlinuz is not generated on every reconfigure
+ cp -f /boot/vmlinuz-${VERSION}.efi /boot/vmlinuz-${VERSION}
+ fi
+ # create the new entry
+ efibootmgr -qc $args -L "Void Linux with kernel ${major_version}" -l /vmlinuz-${VERSION} -u "${OPTIONS}"
+fi
diff --git a/srcpkgs/efibootmgr/template b/srcpkgs/efibootmgr/template
index bd2e88bbbeac..deeb8dffc583 100644
--- a/srcpkgs/efibootmgr/template
+++ b/srcpkgs/efibootmgr/template
@@ -1,7 +1,7 @@
# Template file for 'efibootmgr'
pkgname=efibootmgr
version=17
-revision=6
+revision=7
hostmakedepends="pkg-config"
makedepends="libefivar-devel popt-devel"
short_desc="Tool to modify UEFI Firmware Boot Manager Variables"
next prev parent reply other threads:[~2021-09-07 15:55 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-27 12:25 [PR PATCH] " 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 ` Dko1905 [this message]
2021-09-07 15:56 ` 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
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=20210907155559.LTRcSqxrfvN-W0wz614t7umm8r0C_2GqoLtqEBL9Xuo@z \
--to=dko1905@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).