Mark the boot image migration done only when a boot entry has the parameter
limine-mkinitcpio carries on past a kernel it could not build, with a full boot partition for one, and still exits 0. The migration then wrote its marker over an unchanged boot image, and no later update would try again. After the rebuild it now looks at the boot menu: if the menu has command lines and none carries the parameter, the migration fails and stays pending. A menu with no command lines in it, where they are inside the boot images, cannot be checked this way and is accepted as before.
This commit is contained in:
1 parent
295a926ffd
commit
3824577c12
2 files changed
+32
-2
No files matched your search
@@ -12,6 +12,8 @@ defaults_conf="${OMARCHY_LIMINE_DEFAULTS_CONF:-/etc/limine-entry-tool.d/omarchy-
|
||||
running_cmdline="${OMARCHY_RUNNING_CMDLINE:-/proc/cmdline}"
|
||||
rebuild_marker="${OMARCHY_LIMINE_REBUILD_MARKER:-/var/lib/omarchy/migrations/1791581004}"
|
||||
param="systemd.tty.term.console=dumb"
|
||||
esp=$(sed -n 's/^ESP_PATH=["'\'']\?\([^"'\'']*\).*/\1/p' /etc/default/limine 2>/dev/null | tail -n 1)
|
||||
limine_conf="${OMARCHY_LIMINE_CONF:-${esp:-/boot}/limine.conf}"
|
||||
|
||||
omarchy-cmd-present limine-mkinitcpio || exit 0
|
||||
[[ -f $defaults_conf && -r $running_cmdline ]] || exit 0
|
||||
@@ -28,4 +30,16 @@ grep -Eq "^KERNEL_CMDLINE\[default\]\+=\".*${param//./\\.}.*\"" "$defaults_conf"
|
||||
|
||||
echo "The booted kernel is missing $param; rebuilding the boot image"
|
||||
sudo limine-mkinitcpio
|
||||
|
||||
# limine-mkinitcpio carries on past a kernel it could not build, a full boot
|
||||
# partition for one, and still exits 0. Done means a boot entry has the
|
||||
# parameter: without that the migration stays pending and the next update
|
||||
# tries again. A menu with no command lines in it (they are inside the boot
|
||||
# images then) has nothing to look at, and is taken at its word.
|
||||
if sudo grep -Eq '^[[:space:]]*cmdline:' "$limine_conf" 2>/dev/null &&
|
||||
! sudo grep -Eq "^[[:space:]]*cmdline:.*[[:space:]]${param//./\\.}([[:space:]]|\$)" "$limine_conf"; then
|
||||
echo "The boot menu still has no entry with $param after the rebuild" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo install -Dm644 /dev/null "$rebuild_marker"
|
||||
Reference in new issue
Block a user