pmaports/device/testing/linux-fairphone-fp1/APKBUILD
Oliver Smith 0cfcc52e0d
*/linux-*: enable CONFIG_CRYPTO_XTS (MR 1405)
Enable CONFIG_CRYPTO_XTS for each kernel, so we can switch to using
aes-xts-plain64 as default cipher for cryptsetup (override with
"pmbootstrap --cipher"), instead of aes-cbc-plain64 (pmbootstrap#1940).

I have executed "pmbootstrap kconfig edit" on each kernel, and manually
toggled the option. The diff is not always clean, because for some
kernels it is apparently the first time, that menuconfig was executed on
the configs like that. In a few instances, it turned out that
CONFIG_ANDROID_PARANOID_NETWORK needed to be disabled too (this is
already a requirement, but as the config was incomplete, it was not
visible that this option was enabled). Very few times, I had to enable
CONFIG_EXPERIMENTAL in order to see and enable CONFIG_CRYPTO_XTS.

It would be great if we could automate such mass kconfig edits in the
future, see pmbootstrap#1942.

[skip ci]: I have verified, that every single one of these kernels builds.
           CI will likely run out of time while downloading source tarballs.
2020-07-11 15:26:35 +02:00

63 lines
2 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=4
pkgdesc="Fairphone 1 kernel fork"
arch="armv7"
_carch="arm"
_flavor="fairphone-fp1"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
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="328160cf6ddec4ad417cdf648b61d26cc09f9e73"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/z3ntu/$_repository/archive/$_commit.tar.gz
$_config
"
builddir="$srcdir/$_repository-$_commit"
prepare() {
default_prepare
_builddir="$builddir"
builddir="$builddir"/kernel
. downstreamkernel_prepare
builddir="$_builddir"
unset _builddir
}
build() {
cd "$builddir"/kernel
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/kernel/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
cd "$builddir/kernel/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="9ab967c0635dc5b3dca457725d25b44cfc391cb8fb5b9417fe5d6636131aecdf36575375f6151496d5269aaaf14cf15a4580aaee6a4699f0644822af66efba06 linux-fairphone-fp1-328160cf6ddec4ad417cdf648b61d26cc09f9e73.tar.gz
de83192bfffe1b00a78048e61b919011b2dcfd484af5a650c29ba790ff93325aa779f000b12ff6af5809edd764050b95b71184ba69fdff9baa21f6001d29f84c config-fairphone-fp1.armv7"