pmaports/device/community/linux-postmarketos-qcom-msm8916/APKBUILD
Stefan Hansson 90e1f42ffb
linux-postmarketos-qcom-msm8916: enable zstd firmware compression support (MR 5423)
This is already enabled in the pmos.config configuration file upstream,
but hasn't made its way to pmaports yet as there hasn't been an update
since that happened.

See https://gitlab.com/postmarketOS/pmaports/-/merge_requests/5380
[ci:skip-build]: already built successfully in CI
2024-07-31 17:57:17 +02:00

97 lines
2.9 KiB
Text

# Maintainer: Minecrell <minecrell@minecrell.net>
# Co-Maintainer: Nikita Travkin <nikita@trvn.ru>
# Kernel config based on: arch/arm64/configs/msm8916_defconfig
_flavor="postmarketos-qcom-msm8916"
pkgname=linux-$_flavor
pkgver=6.6
# When making kernel config changes please also submit a PR to
# https://github.com/msm8916-mainline/linux/blob/master/kernel/configs/pmos.config
# since the kernel config is regenerated on upgrades and all changes will be lost!
pkgrel=7
pkgdesc="Mainline kernel fork for Qualcomm MSM8909/MSM8916/MSM8939 devices"
arch="aarch64 armv7"
url="https://github.com/msm8916-mainline/linux"
license="GPL-2.0-only"
options="!strip !check !tracedeps
pmb:cross-native
pmb:kconfigcheck-community
pmb:kconfigcheck-uefi
"
makedepends="
bison
findutils
flex
gmp-dev
mpc1-dev
mpfr-dev
openssl-dev
perl
postmarketos-installkernel
"
replaces="linux-postmarketos-qcom-msm8909 linux-postmarketos-qcom-msm8939"
# Architecture
case "$CARCH" in
aarch64) _carch="arm64" ;;
arm*) _carch="arm" ;;
esac
# Source
_tag=v${pkgver//_/-}-msm8916
source="
$pkgname-$_tag.tar.gz::$url/archive/$_tag.tar.gz
config-$_flavor.aarch64
config-$_flavor.armv7
"
builddir="$srcdir/linux-${_tag#v}"
prepare() {
default_prepare
cp "$srcdir/config-$_flavor.$CARCH" .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION=$((pkgrel + 1 ))
}
package() {
mkdir -p "$pkgdir"/boot
_install_targets="modules_install dtbs_install"
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"
elif [ "$_carch" = "arm64" ]; then
echo "WARNING: CONFIG_ZBOOT not enabled!"
install -Dm644 "$builddir/arch/$_carch/boot/Image.gz" \
"$pkgdir/boot/vmlinuz"
else
_install_targets="zinstall modules_install dtbs_install"
fi
make $_install_targets \
ARCH="$_carch" \
INSTALL_PATH="$pkgdir"/boot \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_MOD_STRIP=1 \
INSTALL_DTBS_PATH="$pkgdir"/boot/dtbs
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
}
sha512sums="
5fbbdf333412667e0a0e38dcc7e83f640bd5a1e0b07e1c7786ff3e18f17b9cdec088936263d68986b3869ee305cfcecdf22970134ca8fb8d2a2769874a5a4676 linux-postmarketos-qcom-msm8916-v6.6-msm8916.tar.gz
1f671413ffa08a2452c6bde326235b8731b0fae88a5727dd5a547d0d62b8abe7d184ae26794cb5592ab276c3788962a5916592c417c013afcd99f20131008f85 config-postmarketos-qcom-msm8916.aarch64
c6fe29dd7233ff10bd764ba516ecf61aa4b9036495af4499843192433020aeaa233dfed9bb06aa871177712bf4a1c43daecab64b97c4377d097f751adc815209 config-postmarketos-qcom-msm8916.armv7
"