pmaports/device/testing/linux-postmarketos-exynos7870/APKBUILD

87 lines
2.6 KiB
Text
Raw Normal View History

# Kernel config based on defconfig
pkgname=linux-postmarketos-exynos7870
pkgver=6.6.8
pkgrel=0
pkgdesc="Close-to-mainline kernel for Samsung Galaxy A6 2018"
arch="aarch64"
_carch="arm64"
_flavor="exynos7870"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
bash
bc
bison
dtbtool-exynos
flex
openssl-dev
perl
"
_patches_owner="exynos7870-mainline"
_patches_repo="mainline-patches"
_patches_commit="79fdca89077a3798ffde3eabd85c0336dd76194d"
_config="config-$_flavor.aarch64"
_dts_list="exynos7870-a6lte"
# Source
source="
linux-$pkgver.tar.gz::https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-$pkgver.tar.gz
$_config
patches-$_patches_commit.tar.gz::https://gitlab.com/$_patches_owner/$_patches_repo/-/archive/$_patches_commit/$_patches_repo-$_patches_commit.tar.gz
"
builddir="$srcdir/linux-$pkgver"
_outdir="."
prepare() {
default_prepare
for i in "$srcdir"/$_patches_repo-*/patches/*; do
patch -p1 < "$i"
done
cp "$srcdir"/$_config .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
# Build out-of-tree devicetrees
rm -f "$srcdir/"$_patches_repo-*/*-minimal-dts.dts
for i in $_dts_list; do
scripts/dtc/dtc "$srcdir/"$_patches_repo-*/$i.dts -o "$_outdir/arch/$_carch/boot/dts/$i.dtb"
done
# Master DTB (deviceinfo_bootimg_qcdt)
dtbTool-exynos -o "$_outdir/arch/$_carch/boot"/dt.img \
$(find "$_outdir/arch/$_carch/boot/dts/" -name 'exynos7870-*.dtb')
}
package() {
mkdir -p "$pkgdir/boot" "$pkgdir/lib/modules"
# The bootloader does not support zipped kernels
make install modules_install \
ARCH="$_carch" \
INSTALL_PATH="$pkgdir"/boot \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_MOD_STRIP=1
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
install -D include/config/kernel.release \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# Install dt.img
install -Dm066 "$_outdir/arch/$_carch/boot/"dt.img "$pkgdir/boot/dt.img"
# Rename /boot/vmlinux-... to make postmarketos-mkinitfs happy
mv "$pkgdir/boot/vmlinux-$pkgver" "$pkgdir/boot/vmlinuz-$pkgver"
}
sha512sums="
ce7ff29dd73f5302a9717c139c308b2c2bfc6d572cad52ff69e041f30d21eec039c59ff6c851bcb37e457daba95505e5a8be983ceb33000349f7ce2283d24bc7 linux-6.6.8.tar.gz
e108b3516dd9212db0e50821e98f84d7c9dc26f9a012a15afeaa8f3c94e75632a2ef3d1db810756009cd5acfbdb53b24a014962773c82a7165b33c34271b5496 config-exynos7870.aarch64
04f3a6d5777847915af792d42251a99260d14ae891afeebf45d5427f2f88231875e964814d6def165164fc2e04ad3ca18207820260d135324a4e4b2de1c12afd patches-79fdca89077a3798ffde3eabd85c0336dd76194d.tar.gz
"