2018-10-21 09:40:53 +00:00
|
|
|
# Reference: <https://postmarketos.org/vendorkernel>
|
|
|
|
# Kernel config based on: kernel/arch/arm/configs/fp1_defconfig
|
|
|
|
|
|
|
|
pkgname="linux-fairphone-fp1"
|
|
|
|
pkgver=3.4.5
|
2019-05-04 13:58:26 +00:00
|
|
|
pkgrel=3
|
2018-10-21 09:40:53 +00:00
|
|
|
pkgdesc="Fairphone 1 kernel fork"
|
2019-05-04 13:58:26 +00:00
|
|
|
arch="armv7"
|
2018-10-21 09:40:53 +00:00
|
|
|
_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"
|
2018-11-30 20:56:06 +00:00
|
|
|
HOSTCC="gcc6-gcc"
|
2018-10-21 09:40:53 +00:00
|
|
|
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Source
|
|
|
|
_repository="android_kernel_fairphone_FP1"
|
2019-05-04 13:58:26 +00:00
|
|
|
_commit="328160cf6ddec4ad417cdf648b61d26cc09f9e73"
|
2018-10-21 09:40:53 +00:00
|
|
|
_config="config-${_flavor}.${arch}"
|
|
|
|
source="
|
|
|
|
$pkgname-$_commit.tar.gz::https://github.com/z3ntu/${_repository}/archive/${_commit}.tar.gz
|
|
|
|
$_config
|
|
|
|
"
|
2019-05-04 13:58:26 +00:00
|
|
|
builddir="$srcdir/${_repository}-${_commit}"
|
2018-10-21 09:40:53 +00:00
|
|
|
|
|
|
|
prepare() {
|
|
|
|
default_prepare
|
2019-05-04 13:58:26 +00:00
|
|
|
downstreamkernel_prepare "$srcdir" "$builddir"/kernel "$_config" "$_carch" "$HOSTCC"
|
2018-10-21 09:40:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2019-05-04 13:58:26 +00:00
|
|
|
cd "$builddir"/kernel
|
2018-10-21 09:40:53 +00:00
|
|
|
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
|
2019-05-04 13:58:26 +00:00
|
|
|
install -D "$builddir/kernel/include/config/kernel.release" \
|
2018-10-21 09:40:53 +00:00
|
|
|
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
|
|
|
|
|
2019-05-04 13:58:26 +00:00
|
|
|
cd "$builddir/kernel/arch/$_carch/boot"
|
2018-10-21 09:40:53 +00:00
|
|
|
# Add mediatek header to zImage
|
|
|
|
mtk-mkimage KERNEL zImage zImage-mtk
|
|
|
|
# Install modified zImage
|
|
|
|
install -Dm644 zImage-mtk "$pkgdir/boot/vmlinuz-$_flavor"
|
|
|
|
}
|
|
|
|
|
2019-05-04 13:58:26 +00:00
|
|
|
sha512sums="9ab967c0635dc5b3dca457725d25b44cfc391cb8fb5b9417fe5d6636131aecdf36575375f6151496d5269aaaf14cf15a4580aaee6a4699f0644822af66efba06 linux-fairphone-fp1-328160cf6ddec4ad417cdf648b61d26cc09f9e73.tar.gz
|
|
|
|
425d550de5aca702e269b30f2e4e9104757ade36bc9a307c023089dcb14e294a37a720070b39eb42b4ffbab4154624d40f2c883f624abc99cf08ac9670027222 config-fairphone-fp1.armv7"
|