
* Persist urgent notifications * Create omarchy-snapshot * Create snapshot before pulling * Extract alternative bootloader configs * Add limine-snapper config * Fix check * Update login scripts * Make chroot friendly * Extract cmdline instead of using blkid due to error * Add restore command * Export $TERMINAL so we get clickable restore notifications * Remove sync -- causes errors...we have nothing to sync yet * Executable * Minor cleanup and compatibility for non-ISO * Give login its own section * Give no-arg guard and inline commands --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
81 lines
2.7 KiB
Bash
81 lines
2.7 KiB
Bash
if command -v limine &>/dev/null && [ ! -f /etc/default/limine ]; then
|
|
yay -S --noconfirm --needed limine-mkinitcpio-hook limine-snapper-sync
|
|
|
|
sudo tee /etc/mkinitcpio.conf.d/omarchy_hooks.conf <<EOF >/dev/null
|
|
HOOKS=(base udev plymouth keyboard autodetect microcode modconf kms keymap consolefont block encrypt filesystems fsck btrfs-overlayfs)
|
|
EOF
|
|
|
|
CMDLINE=$(grep "^[[:space:]]*cmdline:" /boot/EFI/limine/limine.conf | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//')
|
|
|
|
sudo tee /etc/default/limine <<EOF >/dev/null
|
|
TARGET_OS_NAME="Omarchy"
|
|
|
|
KERNEL_CMDLINE[default]="$CMDLINE"
|
|
KERNEL_CMDLINE[default]+="quiet splash"
|
|
|
|
ENABLE_UKI=yes
|
|
|
|
ENABLE_LIMINE_FALLBACK=yes
|
|
|
|
# Find and add other bootloaders
|
|
FIND_BOOTLOADERS=yes
|
|
|
|
BOOT_ORDER="*, *fallback, Snapshots"
|
|
|
|
MAX_SNAPSHOT_ENTRIES=5
|
|
|
|
SNAPSHOT_FORMAT_CHOICE=5
|
|
EOF
|
|
|
|
# We overwrite the whole thing knowing the limine-update will add the entries for us
|
|
sudo tee /boot/limine.conf <<EOF >/dev/null
|
|
### Read more at config document: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md
|
|
#timeout: 3
|
|
default_entry: 2
|
|
interface_branding: Omarchy Bootloader
|
|
interface_branding_color: 2
|
|
hash_mismatch_panic: no
|
|
|
|
term_background: 1a1b26
|
|
backdrop: 1a1b26
|
|
|
|
# Terminal colors (Tokyo Night palette)
|
|
term_palette: 15161e;f7768e;9ece6a;e0af68;7aa2f7;bb9af7;7dcfff;a9b1d6
|
|
term_palette_bright: 414868;f7768e;9ece6a;e0af68;7aa2f7;bb9af7;7dcfff;c0caf5
|
|
|
|
# Text colors
|
|
term_foreground: c0caf5
|
|
term_foreground_bright: c0caf5
|
|
term_background_bright: 24283b
|
|
|
|
EOF
|
|
|
|
# Match Snapper configs if not installing from the ISO
|
|
if [ -z "${OMARCHY_CHROOT_INSTALL:-}" ]; then
|
|
if ! sudo snapper list-configs 2>/dev/null | grep -q "root"; then
|
|
sudo snapper -c root create-config /
|
|
fi
|
|
if ! sudo snapper list-configs 2>/dev/null | grep -q "home"; then
|
|
sudo snapper -c home create-config /home
|
|
fi
|
|
end
|
|
|
|
# Tweak default Snapper configs
|
|
sudo sed -i 's/^TIMELINE_CREATE="yes"/TIMELINE_CREATE="no"/' /etc/snapper/configs/{root,home}
|
|
sudo sed -i 's/^NUMBER_LIMIT="50"/NUMBER_LIMIT="5"/' /etc/snapper/configs/{root,home}
|
|
sudo sed -i 's/^NUMBER_LIMIT_IMPORTANT="10"/NUMBER_LIMIT_IMPORTANT="5"/' /etc/snapper/configs/{root,home}
|
|
|
|
sudo limine-update
|
|
chrootable_systemctl_enable limine-snapper-sync.service
|
|
fi
|
|
|
|
# Add UKI entry to UEFI machines to skip bootloader showing on normal boot
|
|
# Only doing this for ISO installs
|
|
if [ -n "${OMARCHY_CHROOT_INSTALL:-}" ] && efibootmgr &>/dev/null && ! efibootmgr | grep -q Omarchy; then
|
|
sudo efibootmgr --create \
|
|
--disk "$(findmnt -n -o SOURCE /boot | sed 's/[0-9]*$//')" \
|
|
--part "$(findmnt -n -o SOURCE /boot | grep -o '[0-9]*$')" \
|
|
--label "Omarchy" \
|
|
--loader "\\EFI\\Linux\\$(cat /etc/machine-id)_linux.efi"
|
|
fi
|