Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 17 additions & 1 deletion migrations/1795834060.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ rebuild_marker=/var/lib/omarchy/migrations/1795834060
# Whether the HOOKS baseline draws the prompt with omarchy-splash.
hooks=$(bash -c 'source <(cat -- /etc/mkinitcpio.conf /etc/mkinitcpio.conf.d/*.conf 2>/dev/null) && echo " ${HOOKS[*]} "')

# Whether it will once an edited omarchy_hooks.conf, still setting Plymouth's
# busybox line, is replaced by the packaged one pacman left beside it.
pending=""
if [[ -e /etc/mkinitcpio.conf.d/omarchy_hooks.conf.pacnew && $hooks == *" udev "* && $hooks == *" plymouth "* && $hooks != *" systemd "* ]]; then
pending=$(bash -c '
files=(/etc/mkinitcpio.conf)
for file in /etc/mkinitcpio.conf.d/*.conf; do
if [[ $file == */omarchy_hooks.conf ]]; then
file+=.pacnew
fi
files+=("$file")
done
source <(cat -- "${files[@]}" 2>/dev/null) && echo " ${HOOKS[*]} "
')
fi

# Plymouth typed a KEYMAP-only layout through the console, and the splash types
# with vconsole.conf's XKB lines: give such a keymap the lines setup writes,
# before the image is built with them. Not where Plymouth keeps the prompt (a
Expand All @@ -50,7 +66,7 @@ hooks=$(bash -c 'source <(cat -- /etc/mkinitcpio.conf /etc/mkinitcpio.conf.d/*.c
# where they typed US before.
source "$OMARCHY_PATH/install/provisioning/setup-form.sh"
vconsole_keymap=$(unset KEYMAP XKBLAYOUT; . /etc/vconsole.conf 2>/dev/null || true; [[ -n ${XKBLAYOUT:-} ]] || printf %s "${KEYMAP:-}")
if [[ $hooks == *" omarchy-splash "* ]] && vconsole_xkb=$(omarchy_keymap_xkb_settings "$vconsole_keymap"); then
if [[ $hooks == *" omarchy-splash "* || $pending == *" omarchy-splash "* ]] && vconsole_xkb=$(omarchy_keymap_xkb_settings "$vconsole_keymap"); then
echo "Giving console keymap $vconsole_keymap the XKB layout the boot splash types the disk password with"
{ [[ -z $(tail -c 1 /etc/vconsole.conf) ]] || echo; printf '%s\n' "$vconsole_xkb"; } | sudo tee -a /etc/vconsole.conf >/dev/null
fi
Expand Down
43 changes: 43 additions & 0 deletions migrations/1796207640.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
echo "Give a console keymap the XKB layout the boot splash types the disk password with, where the splash's migration skipped it"

# 1795834060 skipped this on a machine whose edited omarchy_hooks.conf still set
# Plymouth's line, then marked itself done, so merging the .pacnew later left the
# splash a KEYMAP it cannot type with. Machine-wide, like that migration.
marker=/var/lib/omarchy/migrations/1796207640
[[ ! -e $marker ]] || exit 0

hooks=$(bash -c 'source <(cat -- /etc/mkinitcpio.conf /etc/mkinitcpio.conf.d/*.conf 2>/dev/null) && echo " ${HOOKS[*]} "')
pending=""
if [[ -e /etc/mkinitcpio.conf.d/omarchy_hooks.conf.pacnew && $hooks == *" udev "* && $hooks == *" plymouth "* && $hooks != *" systemd "* ]]; then
pending=$(bash -c '
files=(/etc/mkinitcpio.conf)
for file in /etc/mkinitcpio.conf.d/*.conf; do
if [[ $file == */omarchy_hooks.conf ]]; then
file+=.pacnew
fi
files+=("$file")
done
source <(cat -- "${files[@]}" 2>/dev/null) && echo " ${HOOKS[*]} "
')
fi

# Recorded before the lines go in, so a failed rebuild is retried once they are
# there and the keymap no longer needs them.
rebuild=$marker.rebuild

source "$OMARCHY_PATH/install/provisioning/setup-form.sh"
vconsole_keymap=$(unset KEYMAP XKBLAYOUT; . /etc/vconsole.conf 2>/dev/null || true; [[ -n ${XKBLAYOUT:-} ]] || printf %s "${KEYMAP:-}")
if [[ $hooks == *" omarchy-splash "* || $pending == *" omarchy-splash "* ]] && vconsole_xkb=$(omarchy_keymap_xkb_settings "$vconsole_keymap"); then
echo "Giving console keymap $vconsole_keymap the XKB layout the boot splash types the disk password with"
sudo install -Dm644 /dev/null "$rebuild"
{ [[ -z $(tail -c 1 /etc/vconsole.conf) ]] || echo; printf '%s\n' "$vconsole_xkb"; } | sudo tee -a /etc/vconsole.conf >/dev/null
fi

# Only an image the splash draws reads the new lines.
if [[ -e $rebuild && $hooks == *" omarchy-splash "* ]] && ! sudo omarchy-update-boot-splash; then
echo "A boot image was not rebuilt. Fix the error above, then run omarchy-migrate again before rebooting." >&2
exit 1
fi

sudo rm -f "$rebuild"
sudo install -Dm644 /dev/null "$marker"