pmaports/device/linux-fairphone-fp1/APKBUILD
2018-11-27 07:47:11 +01:00

58 lines
1.9 KiB
Text

# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: kernel/arch/arm/configs/fp1_defconfig
pkgname="linux-fairphone-fp1"
pkgver=3.4.5
pkgrel=0
pkgdesc="Fairphone 1 kernel fork"
arch="armhf"
_carch="arm"
_flavor="fairphone-fp1"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev grep coreutils mtk-mkimage gcc6"
# Compiler: GCC 6 (doesn't boot when compiled with newer versions)
if [ "${CC:0:5}" != "gcc6-" ]; then
CC="gcc6-$CC"
HOSTCC="gcc6-gcc"
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
fi
# Source
_repository="android_kernel_fairphone_FP1"
_commit="f1a2a1f0b862cb96c669881cd31ba7729e31d90f"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/z3ntu/${_repository}/archive/${_commit}.tar.gz
$_config
"
builddir="$srcdir/${_repository}-${_commit}/kernel"
prepare() {
default_prepare
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
}
build() {
unset LDFLAGS
TARGET_BUILD_VARIANT=user TARGET_PRODUCT=ahong89_wet_jb2 \
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
cd "$builddir/arch/$_carch/boot"
# Add mediatek header to zImage
mtk-mkimage KERNEL zImage zImage-mtk
# Install modified zImage
install -Dm644 zImage-mtk "$pkgdir/boot/vmlinuz-$_flavor"
}
sha512sums="00f02c71ed097ba40530c000df24539234fab110d08477578ed31bd6f6c92cff2d48611e01dccba6cb54aaf83b0739df27c9684112eb7d89e21a47e538b56b8b linux-fairphone-fp1-f1a2a1f0b862cb96c669881cd31ba7729e31d90f.tar.gz
425d550de5aca702e269b30f2e4e9104757ade36bc9a307c023089dcb14e294a37a720070b39eb42b4ffbab4154624d40f2c883f624abc99cf08ac9670027222 config-fairphone-fp1.armhf"