# Kernel config based on: arch/arm/configs/lineageos_wt88047_defconfig pkgname="linux-wingtech-wt88047" pkgver=3.10.108 pkgrel=2 pkgdesc="Xiaomi Redmi 2 kernel fork" arch="armhf" _carch="arm" _flavor="wingtech-wt88047" 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 dtbtool gcc6" # Compiler: this kernel was only tested with GCC6. Feel free to make a merge # request if you find out that it is booting working with newer GCCs as # well. See for instructions. if [ "${CC:0:5}" != "gcc6-" ]; then CC="gcc6-$CC" HOSTCC="gcc6-gcc" CROSS_COMPILE="gcc6-$CROSS_COMPILE" fi # Source _repository="android_kernel_wingtech_msm8916" _commit="89b99d90085acb348bb14739a13119c29be87870" _config="config-${_flavor}.${arch}" source=" $pkgname-$_commit.tar.gz::https://github.com/LineageOS/${_repository}/archive/${_commit}.tar.gz $_config compiler-gcc6.h " builddir="$srcdir/${_repository}-${_commit}" prepare() { default_prepare # gcc6 support cp -v "$srcdir/compiler-gcc6.h" "$builddir/include/linux/" # Remove -Werror from all makefiles local i local makefiles="$(find . -type f -name Makefile) $(find . -type f -name Kbuild)" for i in $makefiles; do sed -i 's/-Werror-/-W/g' "$i" sed -i 's/-Werror//g' "$i" done # Prepare kernel config ('yes ""' for kernels lacking olddefconfig) cp "$srcdir"/$_config "$builddir"/.config yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig } build() { unset LDFLAGS make ARCH="$_carch" CC="${CC:-gcc}" \ KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" # Generate master DTB (deviceinfo_bootimg_qcdt) dtbTool -s 2048 -p "scripts/dtc/" -o "arch/arm/boot/dt.img" "arch/arm/boot/" } 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 # Master DTB (deviceinfo_bootimg_qcdt) install -Dm644 "$builddir/arch/arm/boot/dt.img" \ "$pkgdir/boot/dt.img" } sha512sums="0b935ab17c78b3090dd270c54d706062bbb06f7402e298f02e77b6ef3cbd812e8b979aff827d4c9d6cebf22c567ce357c0361023d0778ae9e7ece84907fa3877 linux-wingtech-wt88047-89b99d90085acb348bb14739a13119c29be87870.tar.gz 7b6902a6fce8f0328338fe8f0f9ffcf152dc5270924c945b0f01346a783f1b2120cfcc32d6ece1b68d911bccafa01fee8f8a6f8682829e20cf6dfe05e27e6732 config-wingtech-wt88047.armhf d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h"