Files
omarchy/migrations/1758487662_move_to_custom_uki.sh
Ryan Hughes b97cba39af Login and UKI updates (#2242)
* Change DM to SDDM

* Move to custom named UKI

* Skip creation on Mac

* Add entry to make sure VSCode uses gnome keyring

* Fix order for UKI generation

* Limine only

* BTRFS only

* Add checks for possible issues

* Remove

* Add verification to omarchy-pkg-add and speed up installs

* Use omarchy-pkg-add

* Update files to include dirs

* Fix relaunch
2025-10-08 10:47:26 +02:00

39 lines
1.4 KiB
Bash

echo "Update UKI to custom named entry"
if command -v limine &>/dev/null && [[ -f /etc/default/limine ]]; then
if grep -q "^ENABLE_UKI=yes" /etc/default/limine; then
if ! grep -q "^CUSTOM_UKI_NAME=" /etc/default/limine; then
sudo sed -i '/^ENABLE_UKI=yes/a CUSTOM_UKI_NAME="omarchy"' /etc/default/limine
fi
# Remove the archinstall-created Limine entry
while IFS= read -r bootnum; do
sudo efibootmgr -b "$bootnum" -B >/dev/null 2>&1
done < <(efibootmgr | grep -E "^Boot[0-9]{4}\*? Arch Linux Limine" | sed 's/^Boot\([0-9]\{4\}\).*/\1/')
sudo limine-update
uki_file=$(find /boot/EFI/Linux/ -name "omarchy*.efi" -printf "%f\n" 2>/dev/null | head -1)
if [[ -n "$uki_file" ]]; then
while IFS= read -r bootnum; do
sudo efibootmgr -b "$bootnum" -B >/dev/null 2>&1
done < <(efibootmgr | grep -E "^Boot[0-9]{4}\*? Omarchy" | sed 's/^Boot\([0-9]\{4\}\).*/\1/')
# Skip EFI entry creation on Apple hardware
if ! cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "Apple"; then
sudo efibootmgr --create \
--disk "$(findmnt -n -o SOURCE /boot | sed 's/p\?[0-9]*$//')" \
--part "$(findmnt -n -o SOURCE /boot | grep -o 'p\?[0-9]*$' | sed 's/^p//')" \
--label "Omarchy" \
--loader "\\EFI\\Linux\\$uki_file"
fi
fi
else
echo "Not using UKI. Not making any changes."
fi
else
echo "Boot config is non-standard. Not making any changes."
fi