# Reference: # Kernel config based on: arch/arm/configs/msm8974_sec_defconfig # arch/arm/configs/msm8974pro_sec_klte_eur_defconfig # arch/arm/configs/selinux_defconfig pkgname="linux-samsung-klte" pkgver=3.4.113 pkgrel=0 pkgdesc="Samsung Galaxy S5 kernel fork" arch="armhf" _carch="arm" _flavor="samsung-klte" 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 xz dtbtool 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_samsung_msm8974" _commit="7a3b6080ee8d411acc2bb4a08de479aa8cc9c77a" _config="config-${_flavor}.${arch}" source=" $pkgname-$_commit.tar.gz::https://github.com/LineageOS/${_repository}/archive/${_commit}.tar.gz $_config 00_fix_return_address.patch 01_gpu-msm-fix-gcc5-compile.patch 02-Reduce-battery-and-touchscreen-log-spam.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" # Generate master DTB 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 install -Dm644 "$builddir/arch/arm/boot/dt.img" \ "$pkgdir/boot/dt.img" # External modules install cd "$builddir" make ARCH="$_carch" CC="${CC:-gcc}" \ KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \ INSTALL_MOD_PATH="$pkgdir" modules_install } sha512sums="a0ed01d4beb4fd1b304ea1409e4e3d7ff60662de34999dcdb2901cb10eef217a6679d5cc42dfcc9c3e2b9fb96bc38a8adc431444092310e22af29c7d581f60af linux-samsung-klte-7a3b6080ee8d411acc2bb4a08de479aa8cc9c77a.tar.gz 3045e613475bcdb454315450c86ca3198787ff0f4573a61118a6a600048d1d9b45d6c83c1804d4945bcf24af8759a038d9f2b5bf57aa7ab8b3585be65ffd4f7a config-samsung-klte.armhf 3b4913415bcfe0ff222969f993890c656c7e12b6ee06532bded485d5201c9855b2c87996c5b63423702b89b6b0ca214b5aceeb402571d9c5af084093c157ccb4 00_fix_return_address.patch 0fc4b1782dfd3bd94fa9ae8ab74b19713f25e9f4a48dcf830072634f247aa3dd8847f001a3e87e9728e057657efd4ae751510e7c408d9b960c907665ca64e61f 01_gpu-msm-fix-gcc5-compile.patch b55fc9ab3e21bc85d66ee08d7e1cd7fdc3b236249212fbcd0055e60ed3e6cef3e4d2b8058a4b7d70c78b2bbc7a11111b55d4d82490b4e3579b8e61657806ac09 02-Reduce-battery-and-touchscreen-log-spam.patch"