feat: add microcode if available

This commit is contained in:
Adrian Wannenmacher 2021-06-19 15:48:39 +02:00
parent 16c3dc6b66
commit 5f890bb2a4
Signed by: tfld
GPG Key ID: 19D986ECB1E492D5

View File

@ -64,12 +64,26 @@ function create_uki -d "creates a new uki" -a variant id
error "unknown uki variant: $variant"
end
# create initrd
set amd "$prefix/boot/amd-ucode.img"
set intel "$prefix/boot/intel-ucode.img"
set initrd "$bd/initramfs-linux$fallback.img"
if test -f $amd
cat $amd >> $initrd
end
if test -f $intel
cat $intel >> $initrd
end
cat "$prefix/boot/initramfs-linux$fallback.img" >> $initrd
# create uki
objcopy \
--add-section .osrel="$bd/os-release$fallback" --change-section-vma .osrel=0x20000 \
--add-section .cmdline="$bd/kernel-cmd$fallback" --change-section-vma .cmdline=0x30000 \
--add-section .splash="$prefix/usr/share/systemd/bootctl/splash-arch.bmp" --change-section-vma .splash=0x40000 \
--add-section .linux="$prefix/boot/vmlinuz-linux" --change-section-vma .linux=0x2000000 \
--add-section .initrd="$prefix/boot/initramfs-linux$fallback.img" --change-section-vma .initrd=0x3000000 \
--add-section .initrd="$initrd" --change-section-vma .initrd=0x3000000 \
"$prefix/usr/lib/systemd/boot/efi/linuxx64.efi.stub" "$bd/arch-linux$fallback$snid.efi.unsigned"
# sign