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))
|
2021-08-25 19:35:59 +00:00
|
|
|
pkgrel=3
|
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" \
|
2021-08-25 19:35:59 +00:00
|
|
|
"$pkgdir/boot/vmlinuz"
|
2019-02-17 06:00:28 +00:00
|
|
|
else
|
2020-02-28 09:59:56 +00:00
|
|
|
install -Dm644 "$srcdir/build/arch/$_carch/boot/"*zImage \
|
2021-08-25 19:35:59 +00:00
|
|
|
"$pkgdir/boot/vmlinuz"
|
2019-02-17 06:00:28 +00:00
|
|
|
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
|
2021-02-08 18:03:07 +00:00
|
|
|
63f7e39aaba78f144ad65b8257e559049cbb827d015c1a9002e5f12a24ae4126fc8dee6256ba56ba557d6f51d8522cf19460c2fcb7879c39a399ebe94c3ca551 config-google-crosshatch-mainline.aarch64
|
2020-11-04 12:48:12 +00:00
|
|
|
27827877040007fc1c4c719f7e2e19e5c272d44972415cfc53feba0313d87e4074f8204bdb13cbc5fe21ea61bf595314b68f10c081e7b7bac3c888b60f008acf linux4.17-gcc10-extern_YYLOC_global_declaration.patch"
|