The engine enabled omarchy-mac-migrate-verify.service with systemctl; with the unit gone the link would dangle. Also correct which omarchy-mac pull requests every omarchy-mac-pkgs pin includes (#544 has not merged).
53 lines
1.7 KiB
Plaintext
53 lines
1.7 KiB
Plaintext
_omarchy_mac_boot_asahi_pacsave_notice() {
|
|
local pacsave=/etc/mkinitcpio.conf.d/90-omarchy-asahi.conf.pacsave
|
|
local shipped=/etc/mkinitcpio.conf.d/90-omarchy-mac.conf
|
|
|
|
[[ -f $pacsave && -f $shipped ]] || return 0
|
|
cmp -s "$pacsave" "$shipped" && return 0
|
|
|
|
cat <<EOF
|
|
==> omarchy-mac-boot: a customized 90-omarchy-asahi.conf was preserved as:
|
|
$pacsave
|
|
The active mkinitcpio drop-in is now:
|
|
$shipped
|
|
Merge any remaining local changes into the new file.
|
|
EOF
|
|
}
|
|
|
|
_omarchy_mac_boot_migrate_legacy_first_boot() {
|
|
local legacy=/var/lib/omarchy/first-boot/pending
|
|
local successor=/var/lib/omarchy/mac-first-boot/pending
|
|
|
|
[[ -e $legacy ]] || return 0
|
|
install -Dm644 /dev/null "$successor"
|
|
rm -f "$legacy"
|
|
systemctl --no-reload enable omarchy-mac-first-boot.service 2>/dev/null || {
|
|
install -d /etc/systemd/system/multi-user.target.wants
|
|
ln -sfr /usr/lib/systemd/system/omarchy-mac-first-boot.service \
|
|
/etc/systemd/system/multi-user.target.wants/omarchy-mac-first-boot.service
|
|
}
|
|
}
|
|
|
|
post_install() {
|
|
_omarchy_mac_boot_asahi_pacsave_notice
|
|
_omarchy_mac_boot_migrate_legacy_first_boot
|
|
_omarchy_mac_boot_drop_legacy_wants
|
|
}
|
|
|
|
_omarchy_mac_boot_drop_legacy_wants() {
|
|
# The replaced omarchy-first-boot left its preset-enabled link behind, and
|
|
# the migration engine this package no longer ships enabled its verifier.
|
|
local unit link
|
|
for unit in omarchy-first-boot.service omarchy-mac-migrate-verify.service; do
|
|
link=/etc/systemd/system/multi-user.target.wants/$unit
|
|
[[ -L $link && ! -e $link ]] && rm -f "$link"
|
|
done
|
|
return 0
|
|
}
|
|
|
|
post_upgrade() {
|
|
_omarchy_mac_boot_asahi_pacsave_notice
|
|
_omarchy_mac_boot_migrate_legacy_first_boot
|
|
_omarchy_mac_boot_drop_legacy_wants
|
|
}
|