From 5fa718644ee75c438efcf3792fc4c5a6ded3c733 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Sat, 14 Oct 2023 21:36:05 +0100 Subject: [PATCH] linux-postmarketos-qcom-sdm845: use ZBOOT (MR 4542) EFI booting with systemd-boot requires building the kernel with ZBOOT - the EFI decompressor stub. However, this breaks the old Android booting. Detect when ZBOOT is enabled and install both vmlinuz.efi as well as the old gzipped kernel image. To help make this upgrade more seamless, continue to support building the kernel with ZBOOT disabled and just print a warning. Disable module stripping - we compress them anyway and a recent kernel change seems to have caused some bug here. This is a packaging change that doesn't require rebuilding the kernel. [ci:skip-vercheck] --- .../linux-postmarketos-qcom-sdm845/APKBUILD | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/device/community/linux-postmarketos-qcom-sdm845/APKBUILD b/device/community/linux-postmarketos-qcom-sdm845/APKBUILD index ab474c7ab..6478a76e1 100644 --- a/device/community/linux-postmarketos-qcom-sdm845/APKBUILD +++ b/device/community/linux-postmarketos-qcom-sdm845/APKBUILD @@ -6,7 +6,7 @@ _flavor="postmarketos-qcom-sdm845" pkgname=linux-$_flavor pkgver=6.5.5 -pkgrel=0 +pkgrel=1 pkgdesc="Mainline Kernel fork for SDM845 devices" arch="aarch64" _carch="arm64" @@ -39,8 +39,19 @@ build() { } package() { - install -Dm644 "$builddir/arch/$_carch/boot/Image.gz" \ - "$pkgdir/boot/vmlinuz" + if [ -e "$builddir/arch/$_carch/boot/vmlinuz.efi" ]; then + # ZBOOT EFI decompressor for EFI booting + install -Dm644 "$builddir/arch/$_carch/boot/vmlinuz.efi" \ + "$pkgdir/boot/linux.efi" + + # Old GZIP'd kernel image for boot.img compatibility + install -Dm644 "$builddir/arch/$_carch/boot/vmlinuz" \ + "$pkgdir/boot/vmlinuz" + else + echo "WARNING: CONFIG_ZBOOT not enabled!" + install -Dm644 "$builddir/arch/$_carch/boot/Image.gz" \ + "$pkgdir/boot/vmlinuz" + fi make modules_install dtbs_install \ ARCH="$_carch" \