]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
feat: add aarch64 uefi support
authornkraetzschmar <nkraetzschmar@users.noreply.github.com>
Tue, 22 Mar 2022 19:52:46 +0000 (20:52 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Sun, 27 Mar 2022 18:36:55 +0000 (18:36 +0000)
dracut.sh

index 634ef87bf3abf20db62a50bc56ccc818aeffdb24..70009318765b148d9591c2055a8bc7a44bb9b07e 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1352,6 +1352,7 @@ if [[ ! $print_cmdline ]]; then
             exit 1
         fi
         unset EFI_MACHINE_TYPE_NAME
+        EFI_SECTION_VMA_INITRD=0x3000000
         case $(uname -m) in
             x86_64)
                 EFI_MACHINE_TYPE_NAME=x64
@@ -1359,6 +1360,11 @@ if [[ ! $print_cmdline ]]; then
             i?86)
                 EFI_MACHINE_TYPE_NAME=ia32
                 ;;
+            aarch64)
+                EFI_MACHINE_TYPE_NAME=aa64
+                 # aarch64 kernels are uncompressed and thus larger, so we need a bigger gap between vma sections
+                EFI_SECTION_VMA_INITRD=0x4000000
+                ;;
             *)
                 dfatal "Architecture '$(uname -m)' not supported to create a UEFI executable"
                 exit 1
@@ -2540,7 +2546,7 @@ if [[ $uefi == yes ]]; then
         ${uefi_cmdline:+--add-section .cmdline="$uefi_cmdline" --change-section-vma .cmdline=0x30000} \
         ${uefi_splash_image:+--add-section .splash="$uefi_splash_image" --change-section-vma .splash=0x40000} \
         --add-section .linux="$kernel_image" --change-section-vma .linux=0x2000000 \
-        --add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd=0x3000000 \
+        --add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd="${EFI_SECTION_VMA_INITRD}" \
         "$uefi_stub" "${uefi_outdir}/linux.efi"; then
         if [[ -n ${uefi_secureboot_key} && -n ${uefi_secureboot_cert} ]]; then
             if sbsign \