Skip to content

Instantly share code, notes, and snippets.

@Cilyan
Created December 29, 2020 19:37
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 Cilyan/3dfd57a9fdb751b34c7d870a029973b3 to your computer and use it in GitHub Desktop.
Save Cilyan/3dfd57a9fdb751b34c7d870a029973b3 to your computer and use it in GitHub Desktop.
mkuki: Make Universal Kernel Image
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Target = usr/lib/modules/*/vmlinuz
Target = usr/lib/initcpio/*
Target = boot/*.img
Target = boot/vmlinuz-*
Target = usr/lib/systemd/boot/efi/linuxx64.efi.stub
Target = usr/share/systemd/bootctl/splash-arch.bmp
[Action]
Description = Updating Universal Kernel Image...
When = PostTransaction
Exec = /usr/bin/mkuki
NeedsTargets
#!/usr/bin/sh
cat /boot/intel-ucode.img /boot/initramfs-linux.img > /boot/initramfs-linux-merged.img
objcopy \
--add-section .osrel="/usr/lib/os-release" --change-section-vma .osrel=0x20000 \
--add-section .cmdline="/etc/cmdline.conf" --change-section-vma .cmdline=0x30000 \
--add-section .splash="/usr/share/systemd/bootctl/splash-arch.bmp" --change-section-vma .splash=0x40000 \
--add-section .linux="/boot/vmlinuz-linux" --change-section-vma .linux=0x2000000 \
--add-section .initrd="/boot/initramfs-linux-merged.img" --change-section-vma .initrd=0x3000000 \
"/usr/lib/systemd/boot/efi/linuxx64.efi.stub" "/efi/EFI/Linux/linux.efi"
cat /boot/intel-ucode.img /boot/initramfs-linux-fallback.img > /boot/initramfs-linux-fallback-merged.img
objcopy \
--add-section .osrel="/usr/lib/os-release" --change-section-vma .osrel=0x20000 \
--add-section .cmdline="/etc/cmdline.conf" --change-section-vma .cmdline=0x30000 \
--add-section .splash="/usr/share/systemd/bootctl/splash-arch.bmp" --change-section-vma .splash=0x40000 \
--add-section .linux="/boot/vmlinuz-linux" --change-section-vma .linux=0x2000000 \
--add-section .initrd="/boot/initramfs-linux-fallback-merged.img" --change-section-vma .initrd=0x3000000 \
"/usr/lib/systemd/boot/efi/linuxx64.efi.stub" "/efi/EFI/Linux/linux-fallback.efi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment