feat: UKI

This commit is contained in:
ange 2024-10-02 12:40:34 +07:00
parent bfbd034ce3
commit dd265819a0
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
26 changed files with 55 additions and 56 deletions

View file

@ -0,0 +1,22 @@
#!/bin/bash
#shellcheck disable=SC2154
root="$(findmnt -n -osource /)"
boot="$(lsblk -ls -oname /dev/disk/by-partlabel/boot | tail -n1)"
cryptdev="$(cryptsetup status "$root" | awk '/device/ {print $2}')"
[ -n "$cryptdev" ] && {
uuid="$(blkid | grep "$cryptdev" | awk '{print $2}')"
options="cryptdevice=$uuid:${root##*/} "
}
options="${options}root=$root rw"
sbctl create-keys
sbctl enroll-keys
for l in arch{,-lts-fallback}; do
efibootmgr --create --unicode --label "$l" \
--disk "$boot" --part 1 --loader "\EFI\Linux\arch-linux$l.efi"
done
echo "$options" > /etc/cmdline.d/root.conf