2019-02-17 06:00:28 +00:00
|
|
|
# Kernel config based on: arch/arm64/configs/defconfig
|
|
|
|
# APKBUILD based on linux-postmarketos-mainline
|
|
|
|
# See: https://gitlab.com/postmarketOS/pmaports/issues/153
|
|
|
|
|
|
|
|
_flavor=google-crosshatch-mainline
|
2020-02-28 09:59:56 +00:00
|
|
|
_config="config-$_flavor.$CARCH"
|
2019-02-17 06:00:28 +00:00
|
|
|
|
2020-02-28 09:59:56 +00:00
|
|
|
pkgname=linux-$_flavor
|
2019-02-17 06:00:28 +00:00
|
|
|
|
2019-08-25 01:44:33 +00:00
|
|
|
pkgver=5.3_rc5
|
2019-02-17 06:00:28 +00:00
|
|
|
_pkgver=${pkgver/_/-}
|
|
|
|
_kernver=${pkgver%_rc*}
|
|
|
|
_mainver=${_kernver%.*}
|
|
|
|
_patchlevel=${_kernver/$_mainver./}
|
2020-02-28 09:59:56 +00:00
|
|
|
_basever=$_mainver.$((_patchlevel-1))
|
*/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 13:24:19 +00:00
|
|
|
pkgrel=1
|
2019-02-17 06:00:28 +00:00
|
|
|
|
|
|
|
arch="aarch64"
|
2020-07-11 09:16:39 +00:00
|
|
|
pkgdesc="Google Pixel 3 XL kernel fork, close to mainline"
|
2019-02-17 06:00:28 +00:00
|
|
|
url="https://kernel.org/"
|
|
|
|
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev openssl-dev file bison flex"
|
2020-04-21 01:24:27 +00:00
|
|
|
options="!strip !check !tracedeps pmb:cross-native"
|
2019-02-17 06:00:28 +00:00
|
|
|
|
|
|
|
_repository="linux"
|
2019-08-25 01:44:33 +00:00
|
|
|
_commit="9c9b87cec239101274451cc9c086da60108f9fda"
|
2019-02-17 06:00:28 +00:00
|
|
|
|
|
|
|
source="
|
2020-02-28 10:17:04 +00:00
|
|
|
$pkgname-$_commit.tar.gz::https://github.com/Pixel3Dev/$_repository/archive/$_commit.tar.gz
|
2020-02-28 09:59:56 +00:00
|
|
|
config-$_flavor.aarch64
|
2020-11-04 12:48:12 +00:00
|
|
|
linux4.17-gcc10-extern_YYLOC_global_declaration.patch
|
2019-02-17 06:00:28 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
subpackages="$pkgname-dev"
|
|
|
|
|
|
|
|
license="GPL2"
|
|
|
|
_abi_release=$_pkgver
|
2020-02-28 09:59:56 +00:00
|
|
|
_carch=$CARCH
|
2019-02-17 06:00:28 +00:00
|
|
|
case "$_carch" in
|
|
|
|
aarch64*) _carch="arm64" ;;
|
|
|
|
arm*) _carch="arm" ;;
|
|
|
|
ppc*) _carch="powerpc" ;;
|
|
|
|
s390*) _carch="s390" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
builddir="$srcdir/linux-$_commit"
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
local _patch_failed=
|
|
|
|
# first apply patches in specified order
|
|
|
|
for i in $source; do
|
|
|
|
case $i in
|
|
|
|
*.patch|*.patch::*)
|
|
|
|
_patch=${i%::*}
|
|
|
|
msg "Applying $_patch..."
|
|
|
|
if ! patch -s -p1 -N -i "$srcdir"/$_patch; then
|
|
|
|
echo $_patch >>failed
|
|
|
|
_patch_failed=1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if ! [ -z "$_patch_failed" ]; then
|
|
|
|
error "The following patches failed:"
|
|
|
|
cat failed
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$srcdir"/build
|
|
|
|
cp -v "$srcdir"/$_config "$srcdir"/build/.config
|
2020-02-28 09:22:58 +00:00
|
|
|
make -C "$builddir" O="$srcdir"/build ARCH="$_carch" \
|
2019-02-17 06:00:28 +00:00
|
|
|
olddefconfig
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "$srcdir"/build
|
|
|
|
unset LDFLAGS
|
|
|
|
make ARCH="$_carch" CC="${CC:-gcc}" \
|
2020-02-28 09:59:56 +00:00
|
|
|
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor" \
|
2019-02-17 06:00:28 +00:00
|
|
|
CFLAGS_MODULE=-fno-pic
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2020-02-28 09:59:56 +00:00
|
|
|
cd "$srcdir/build/arch/$_carch/boot"
|
2019-02-17 06:00:28 +00:00
|
|
|
|
|
|
|
if [ "$CARCH" == "aarch64" ]; then
|
2020-02-28 09:59:56 +00:00
|
|
|
install -Dm644 "$srcdir/build/arch/$_carch/boot/Image.gz" \
|
2019-02-17 06:00:28 +00:00
|
|
|
"$pkgdir/boot/vmlinuz-$_flavor"
|
|
|
|
else
|
2020-02-28 09:59:56 +00:00
|
|
|
install -Dm644 "$srcdir/build/arch/$_carch/boot/"*zImage \
|
2019-02-17 06:00:28 +00:00
|
|
|
"$pkgdir/boot/vmlinuz-$_flavor"
|
|
|
|
fi
|
|
|
|
|
|
|
|
install -D "$srcdir/build/include/config/kernel.release" \
|
|
|
|
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
|
|
|
|
|
|
|
|
cd "$srcdir"/build
|
|
|
|
|
|
|
|
local _install
|
|
|
|
case "$CARCH" in
|
|
|
|
aarch64*|arm*) _install="modules_install dtbs_install" ;;
|
|
|
|
*) _install="modules_install" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
make -j1 $_install \
|
|
|
|
ARCH="$_carch" \
|
|
|
|
INSTALL_MOD_PATH="$pkgdir" \
|
|
|
|
INSTALL_DTBS_PATH="$pkgdir/usr/share/dtb"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dev() {
|
|
|
|
# copy the only the parts that we really need for build 3rd party
|
|
|
|
# kernel modules and install those as /usr/src/linux-headers,
|
2019-06-25 07:12:10 +00:00
|
|
|
# similar to what ubuntu does
|
2019-02-17 06:00:28 +00:00
|
|
|
#
|
2019-06-25 07:12:10 +00:00
|
|
|
# this way you don't need to install the 300-400 kernel sources to
|
2019-02-17 06:00:28 +00:00
|
|
|
# build a tiny kernel module
|
|
|
|
#
|
|
|
|
pkgdesc="Headers and script for third party modules for postmarketos kernel"
|
|
|
|
depends="gmp-dev bash perl"
|
2020-02-28 09:59:56 +00:00
|
|
|
local dir="$subpkgdir"/usr/src/linux-headers-$_abi_release
|
2019-02-17 06:00:28 +00:00
|
|
|
|
|
|
|
# first we import config, run prepare to set up for building
|
|
|
|
# external modules, and create the scripts
|
|
|
|
mkdir -p "$dir"
|
|
|
|
cp "$srcdir"/$_config "$dir"/.config
|
2020-02-28 09:22:58 +00:00
|
|
|
make -j1 -C "$builddir" O="$dir" ARCH="$_carch" \
|
2019-02-17 06:00:28 +00:00
|
|
|
olddefconfig prepare modules_prepare scripts
|
|
|
|
|
|
|
|
# needed for 3rd party modules
|
|
|
|
# https://bugzilla.kernel.org/show_bug.cgi?id=11143
|
|
|
|
case "$CARCH" in
|
|
|
|
ppc*) (cd "$dir" && make arch/powerpc/lib/crtsavres.o);;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# remove the stuff that points to real sources. we want 3rd party
|
2019-06-25 07:12:10 +00:00
|
|
|
# modules to believe this is the sources
|
2019-02-17 06:00:28 +00:00
|
|
|
rm "$dir"/Makefile "$dir"/source
|
|
|
|
|
|
|
|
# copy the needed stuff from real sources
|
|
|
|
#
|
|
|
|
# this is taken from ubuntu kernel build script
|
|
|
|
# http://kernel.ubuntu.com/git/ubuntu/ubuntu-zesty.git/tree/debian/rules.d/3-binary-indep.mk
|
|
|
|
|
|
|
|
cd "$builddir"
|
|
|
|
find . -path './include/*' -prune \
|
|
|
|
-o -path './scripts/*' -prune -o -type f \
|
|
|
|
\( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
|
|
|
|
-name '*.sh' -o -name '*.pl' -o -name '*.lds' \) \
|
|
|
|
-print | cpio -pdm "$dir"
|
|
|
|
cp -a scripts include "$dir"
|
|
|
|
find $(find arch -name include -type d -print) -type f \
|
|
|
|
| cpio -pdm "$dir"
|
|
|
|
|
|
|
|
install -Dm644 "$srcdir"/build/Module.symvers \
|
|
|
|
"$dir"/Module.symvers
|
|
|
|
|
2020-02-28 09:59:56 +00:00
|
|
|
mkdir -p "$subpkgdir"/lib/modules/$_abi_release
|
|
|
|
ln -sf /usr/src/linux-headers-$_abi_release \
|
|
|
|
"$subpkgdir"/lib/modules/$_abi_release/build
|
2019-02-17 06:00:28 +00:00
|
|
|
}
|
2019-08-25 01:44:33 +00:00
|
|
|
sha512sums="1ce235689d7ce0b40be203cb16c1bdfe9bc7b2c5e793a942afc5ea4f3268a0a15b684d9c4017a87916d989d8592a96a4223976c95bf7fcca603e71d2f20fee86 linux-google-crosshatch-mainline-9c9b87cec239101274451cc9c086da60108f9fda.tar.gz
|
2020-11-04 12:48:12 +00:00
|
|
|
e33913137709c3192458fc95f23580e1659b4714bb4031bc2c354c4db790e455df84c104cdb85078d3dc7c3a456f8891f285f4ae480e7751ebfce283346b2924 config-google-crosshatch-mainline.aarch64
|
|
|
|
27827877040007fc1c4c719f7e2e19e5c272d44972415cfc53feba0313d87e4074f8204bdb13cbc5fe21ea61bf595314b68f10c081e7b7bac3c888b60f008acf linux4.17-gcc10-extern_YYLOC_global_declaration.patch"
|