From b59286f06511eac5eae81371251c98db14abc474 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Tue, 21 Jan 2020 16:56:01 +0100 Subject: linux-libre-aarch64: use Image to fix "Bad Linux ARM64 Image magic!" Without that patch, /boot/vmlinuz-linux-libre-aarch64 ends up being an Image.gz, however some u-boot configuration and/or versions seem to not like that and fail with the following message: Bad Linux ARM64 Image magic! Making sure that vmlinuz-linux-libre-aarch64 is an Image results in the board booting. However it then fails with: Failed to execute /init (error -8) This might be because the board I used for testing doesn't support runing 32bit binaries and/or because we need to enable more configuration in the kernel to enable that. Signed-off-by: Denis 'GNUtoo' Carikli --- kernels/linux-libre-aarch64/PKGBUILD | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'kernels/linux-libre-aarch64/PKGBUILD') diff --git a/kernels/linux-libre-aarch64/PKGBUILD b/kernels/linux-libre-aarch64/PKGBUILD index 8d3093bc6..996ab2fb4 100644 --- a/kernels/linux-libre-aarch64/PKGBUILD +++ b/kernels/linux-libre-aarch64/PKGBUILD @@ -9,7 +9,7 @@ _replacesoldmodules=() # '%' gets replaced with kernel suffix pkgbase=linux-libre-aarch64 pkgver=5.4.8 -pkgrel=1 +pkgrel=2 pkgdesc='Linux-libre-aarch64' rcnver=5.4.5 rcnrel=armv7-x13 @@ -186,7 +186,7 @@ prepare() { build() { cd $_srcname if [ "$CARCH" = "armv7h" ]; then - make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image Image.gz modules htmldocs dtbs + make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules htmldocs dtbs else make bzImage modules htmldocs fi @@ -211,7 +211,14 @@ _package() { fi # systemd expects to find the kernel here to allow hibernation # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344 - install -Dm644 "$(make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -s image_name)" "$modulesdir/vmlinuz" + + # The default image target is Image.gz on arm64 but some u-boot + # configurations and/or versions don't support that, so we use Image instead. + if [ "$KARCH" = "arm64" ]; then + install -Dm644 arch/arm64/boot/Image "$modulesdir/vmlinuz" + else + install -Dm644 "$(make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -s image_name)" "$modulesdir/vmlinuz" + fi # Used by mkinitcpio to name the kernel echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" -- cgit v1.2.3