Skip to content

Instantly share code, notes, and snippets.

@tonyb486
Created May 1, 2019 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyb486/56fb72325f281d936b0cdfbe1af68051 to your computer and use it in GitHub Desktop.
Save tonyb486/56fb72325f281d936b0cdfbe1af68051 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
cat /boot/intel-ucode.img /boot/initramfs-linux.img > /boot/initrd.img
objcopy \
--add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
--add-section .cmdline="/boot/cmdline.txt" --change-section-vma .cmdline=0x30000 \
--add-section .linux="/boot/vmlinuz-linux" --change-section-vma .linux=0x40000 \
--add-section .initrd="/boot/initrd.img" --change-section-vma .initrd=0x3000000 \
/usr/lib/systemd/boot/efi/linuxx64.efi.stub /boot/EFI/linux-combined.efi
/usr/bin/sbsign --key /etc/efikeys/DB.key --cert /etc/efikeys/DB.crt \
--output /boot/EFI/linux-signed.efi /boot/EFI/linux-combined.efi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment