Skip to content

Commit

Permalink
feat: use ukify instead of objcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
nkraetzschmar committed Sep 25, 2023
1 parent bf05417 commit ca8700f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
16 changes: 6 additions & 10 deletions builder/image.d/makesecureboot
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,20 @@ case "$BUILDER_ARCH" in
amd64)
uefi_arch=X64
gnu_arch=x86_64
initrd_vma=0x3000000
;;
arm64)
uefi_arch=AA64
gnu_arch=aarch64
initrd_vma=0x4000000
;;
esac

# create unified image
cmdline_file=$(mktemp)
echo "$cmdline" > "$cmdline_file"
"${gnu_arch}-linux-gnu-objcopy" \
--add-section .cmdline="$cmdline_file" --change-section-vma .cmdline=0x1000000 \
--add-section .linux="$kernel_file" --change-section-vma .linux=0x2000000 \
--add-section .initrd="$initrd" --change-section-vma .initrd="$initrd_vma" \
"$rootfs/usr/lib/systemd/boot/efi/linux$(tr '[:upper:]' '[:lower:]' <<< "$uefi_arch").efi.stub" "$unified_image"
rm "$cmdline_file"
/usr/lib/systemd/ukify build \
--stub "$rootfs/usr/lib/systemd/boot/efi/linux$(tr '[:upper:]' '[:lower:]' <<< "$uefi_arch").efi.stub" \
--linux "$kernel_file" \
--initrd "$initrd" \
--cmdline "$cmdline" \
--output "$unified_image"

efi_dir="$(mktemp -d)"
mkdir -p "$efi_dir/EFI/BOOT/"
Expand Down
1 change: 1 addition & 0 deletions pkg.list
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ostree-boot
python3
python3-mako
python3-networkx
python3-pefile
python3-yaml
qemu-utils
sbsigntool
Expand Down

0 comments on commit ca8700f

Please sign in to comment.