pmaports/device/community/linux-postmarketos-qcom-sdm845/APKBUILD

72 lines
2.2 KiB
Text
Raw Normal View History

# Maintainer: Caleb Connolly <caleb@connolly.tech>
# Co-Maintainer: Joel Selvaraj <joelselvaraj.oss@gmail.com>
# Stable Linux kernel with patches for SDM845 devices
# Kernel config based on: arch/arm64/configs/defconfig and sdm845.config
_flavor="postmarketos-qcom-sdm845"
pkgname=linux-$_flavor
pkgver=6.6.3
pkgrel=0
pkgdesc="Mainline Kernel fork for SDM845 devices"
arch="aarch64"
_carch="arm64"
url="https://gitlab.com/sdm845-mainline/linux"
license="GPL-2.0-only"
options="!check !tracedeps
pmb:cross-native
pmb:kconfigcheck-community"
makedepends="bash bison findutils flex installkernel openssl-dev perl zstd"
_config="config-$_flavor.$arch"
_tag="sdm845-6.6.3-r2"
# Source
source="
linux-$_tag.tar.gz::https://gitlab.com/sdm845-mainline/linux/-/archive/$_tag/linux-$_tag.tar.gz
$_config
"
builddir="$srcdir/linux-$_tag"
prepare() {
default_prepare
cp "$srcdir/config-$_flavor.$arch" .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor"
}
package() {
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" \
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="
b83b807d57a4cbf1a1f1d0366fdcd6fded58d0567874ca2c535d925c151704bbedd62ac4dacba9c3ff398334e07f7a71dd9b2ad1d235d687f1ac4c697e05228c linux-sdm845-6.6.3-r2.tar.gz
40fb1a8c65c8449e42347330fe6a54ced5fe3d10ad0c64f5949519e141180dadec16f85afcff909e3f29b952dc2b7d490710b9abdc99b2a88edc46f89315146b config-postmarketos-qcom-sdm845.aarch64
"