feat: UKI
This commit is contained in:
parent
bfbd034ce3
commit
dd265819a0
26 changed files with 55 additions and 56 deletions
22
modules/10-chroot/10-bootloader.sh
Normal file
22
modules/10-chroot/10-bootloader.sh
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue