Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions migrations/1791898365.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ if ! sudo grep -Eqi '^[[:space:]]*quiet:' "$limine_conf"; then
added_quiet=1
fi

# Secure Boot with config enrollment checks the menu against a checksum in
# the boot image, so the menu has to be rebuilt into it or the next boot
# panics. A run after a failed rebuild finds the menu already edited, so
# the rebuild does not wait for an edit in this run.
if omarchy-cmd-present limine-mkinitcpio; then
rebuild_log=$(mktemp)
trap 'rm -f "$rebuild_log"' EXIT
sudo limine-mkinitcpio 2>&1 | tee "$rebuild_log"

# limine-mkinitcpio reports a kernel it could not rebuild and still exits 0.
# The menu no longer matches that image, so the migration stays pending.
if grep -q 'mkinitcpio failed for kernel' "$rebuild_log"; then
echo "A boot image was not rebuilt. Fix the error above, then run omarchy-migrate again before rebooting." >&2
exit 1
fi
fi

if [[ -n $set_timeout && -n $added_quiet ]]; then
echo "The boot menu now waits 1 second and stays quiet until a key is pressed"
elif [[ -n $set_timeout ]]; then
Expand Down