summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-01-21 16:56:01 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-01-24 03:57:03 +0100
commitb59286f06511eac5eae81371251c98db14abc474 (patch)
tree92059aa98756380497a538dc48425028cc4d54c9
parent320542f52d5672f456a61e6032eb613b62927f81 (diff)
downloadabslibre-b59286f06511eac5eae81371251c98db14abc474.tar.gz
abslibre-b59286f06511eac5eae81371251c98db14abc474.tar.bz2
abslibre-b59286f06511eac5eae81371251c98db14abc474.zip
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 <GNUtoo@cyberdimension.org>
-rw-r--r--kernels/linux-libre-aarch64/PKGBUILD13
1 files changed, 10 insertions, 3 deletions
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"