From 452835da8b5e9d7de621191c78f1d9b045c30eae Mon Sep 17 00:00:00 2001 From: Emir Beganovic Date: Sat, 10 Oct 2026 00:06:46 +0200 Subject: [PATCH] Read the boot loader's config only where the migration needs it The migration read ESP_PATH from /etc/default/limine at its top. On a machine without that file sed fails, and under bash -euo pipefail the migration stopped there with an error, before the check that lets a machine without Limine skip it. The read moves to after the rebuild, the one place the path is used; a path given for the tests is taken first, and a missing file means /boot. --- migrations/1791581004.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/migrations/1791581004.sh b/migrations/1791581004.sh index 2fda0f4f..233f3aeb 100644 --- a/migrations/1791581004.sh +++ b/migrations/1791581004.sh @@ -12,8 +12,6 @@ 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 @@ -31,6 +29,17 @@ grep -Eq "^KERNEL_CMDLINE\[default\]\+=\".*${param//./\\.}.*\"" "$defaults_conf" echo "The booted kernel is missing $param; rebuilding the boot image" sudo limine-mkinitcpio +# The boot menu is on the ESP, which /etc/default/limine names; /boot when it +# does not, or is not there. +limine_conf="${OMARCHY_LIMINE_CONF:-}" +if [[ -z $limine_conf ]]; then + esp="" + if [[ -r /etc/default/limine ]]; then + esp=$(sed -n 's/^ESP_PATH=["'\'']\?\([^"'\'']*\).*/\1/p' /etc/default/limine | tail -n 1) + fi + limine_conf="${esp:-/boot}/limine.conf" +fi + # 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