# Reference: # Kernel config based on: /proc/config.gz pulled from vendor's Android 4.1 # Contributor: red-black-bonsai pkgname="linux-medion-kai" pkgver=3.1.10 pkgrel=0 pkgdesc="Lenovo Medion Lifetab S9714 kernel fork" arch="armv7" _carch="arm" _flavor="medion-kai" 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 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_medion_lifetab_s9714" _commit="d10779497812934afcadc0da2940caf91f03ed0e" _config="config-$_flavor.$arch" source=" $pkgname-$_commit.tar.gz::https://github.com/red-black-bonsai/$_repository/archive/$_commit.tar.gz $_config gcc7-give-up-on-ilog2-const-optimizations.patch gcc8-fix-put-user.patch kernel-use-the-gnu89-standard-explicitly.patch 01_timeconst_fix.patch " builddir="$srcdir/$_repository-$_commit" prepare() { default_prepare downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC" } build() { unset LDFLAGS 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" # zImage (find the right one) cd "$builddir/arch/$_carch/boot" _target="$pkgdir/boot/vmlinuz-$_flavor" for _zimg in zImage-dtb Image.gz-dtb *zImage Image; do [ -e "$_zimg" ] || continue msg "zImage found: $_zimg" install -Dm644 "$_zimg" "$_target" break done if ! [ -e "$_target" ]; then error "Could not find zImage in $PWD!" return 1 fi } sha512sums="c14af0ed4ada9d91b9fd42ca9150f6e57f8504d6236ea582732cdebedc530f031add7afbb57b4df16dbf6af4287ca60ad56b28e4d3c0c3c58ab6a3aba0b95dcc linux-medion-kai-d10779497812934afcadc0da2940caf91f03ed0e.tar.gz ef5f1ce6566621c0e4b75f231a0fa9eec0cf39a5a4c665c90df1c1c92990e4b84a9e5c5bb2369c3e675a2cd39def0de19f168643d2b2c80a3bb2cb69f0f545e0 config-medion-kai.armv7 77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch 197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch d126b4ba0da557a0f29d6cc9c7d69b578c676265662a5a49906051dc27093c4212465d92076f4d90d5b5a06c996c78cbf921faffe7b07e33f74cfb00a7e520d4 01_timeconst_fix.patch"