Github messages for voidlinux
 help / color / mirror / Atom feed
From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR REVIEW] efibootmgr: Add strict EFI support & remove broken restore logic
Date: Wed, 08 Sep 2021 00:46:26 +0200	[thread overview]
Message-ID: <20210907224626.onX1neYvHGBmt4ahFmY2LrDhCxBSF5mWXj9qsqGWdNU@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: 1603 bytes --]

New review comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/29780#discussion_r703902693

Comment:
If not fixing the issue I described above, I would say at least leave the `efibootmgr -qo $bootorder` in place. Without it, the last kernel installed will take priority which is not very convenient (e.g. I have 4.19, 5.4, 5.10 and 5.13 installed, and I'm currently booting 5.4; I would hate that this changes every time one of the others is updated).

A possible fix might be to do something like this:
```
[...]
# get major version, e.g. "4.8" for "linux4.8"
major_version=$(echo $PKGNAME | cut -c 6-)

label="Void Linux with kernel ${major_version}"

# look for previous entry for this major kernel version
bootnum=$(efibootmgr | grep " $label$" | cut -c "5-8")

# 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 and reuse the same number
if [ -n "$bootnum" ]; then
	args="$args -B -b $bootnum"
fi

# if there is a boot order, keep it as is
if [ -n "$bootorder" ]; then
	args="$args -o $bootorder"
fi

# create the new entry
efibootmgr -qc $args -L "$label" -l /vmlinuz-${VERSION} -u "${OPTIONS}"
```

Instead of calling the `post-remove/50-efibootmgr` hook, just tell efibootmgr to replace the entry. This also keeps the order in the same call to efibootmgr so you don't have to do that in a separate step anymore.


  parent reply	other threads:[~2021-09-07 22:46 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 ` [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 [this message]
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=20210907224626.onX1neYvHGBmt4ahFmY2LrDhCxBSF5mWXj9qsqGWdNU@z \
    --to=tornaria@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).