Add support for systemd-ukify
This commit is contained in:
parent
32849372ad
commit
f8e40e26a9
@ -8,6 +8,7 @@ The auto-update of this script should be disabled! Make sure to create `.disable
|
|||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
Make sure that:
|
Make sure that:
|
||||||
|
* if running Ubuntu 24.04+, Linux Mint 22+ or Debian 13+, `systemd-ukify` is installed
|
||||||
* `binutils`, `efibootmgr` and `systemd-boot-efi` packages are installed
|
* `binutils`, `efibootmgr` and `systemd-boot-efi` packages are installed
|
||||||
* you [install](https://wiki.archlinux.org/title/Unified_kernel_image#Directly_from_UEFI) the UKI to your EFI
|
* you [install](https://wiki.archlinux.org/title/Unified_kernel_image#Directly_from_UEFI) the UKI to your EFI
|
||||||
configuration
|
configuration
|
||||||
|
19
build-uki.sh
19
build-uki.sh
@ -11,12 +11,19 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Build UKI
|
# Build UKI
|
||||||
$sudo objcopy \
|
if [ -x /usr/bin/ukify ]; then
|
||||||
--add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
|
echo "Building UKI using systemd-ukify..."
|
||||||
--add-section .cmdline="/etc/kernel/cmdline" --change-section-vma .cmdline=0x30000 \
|
$sudo ukify build --linux $path_to_vmlinuz_link/vmlinuz --initrd $path_to_vmlinuz_link/initrd.img \
|
||||||
--add-section .linux="$path_to_vmlinuz_link/vmlinuz" --change-section-vma .linux=0x40000 \
|
--cmdline @/etc/kernel/cmdline --output $path_to_uki
|
||||||
--add-section .initrd="$path_to_vmlinuz_link/initrd.img" --change-section-vma .initrd=0x3000000 \
|
else
|
||||||
/usr/lib/systemd/boot/efi/linuxx64.efi.stub $path_to_uki
|
echo "Building UKI using objcopy..."
|
||||||
|
$sudo objcopy \
|
||||||
|
--add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
|
||||||
|
--add-section .cmdline="/etc/kernel/cmdline" --change-section-vma .cmdline=0x30000 \
|
||||||
|
--add-section .linux="$path_to_vmlinuz_link/vmlinuz" --change-section-vma .linux=0x40000 \
|
||||||
|
--add-section .initrd="$path_to_vmlinuz_link/initrd.img" --change-section-vma .initrd=0x3000000 \
|
||||||
|
/usr/lib/systemd/boot/efi/linuxx64.efi.stub $path_to_uki
|
||||||
|
fi
|
||||||
|
|
||||||
# Sign UKI
|
# Sign UKI
|
||||||
if [[ -v secureboot_enabled ]] && [[ $secureboot_enabled = "yes" ]]; then
|
if [[ -v secureboot_enabled ]] && [[ $secureboot_enabled = "yes" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user