2018-12-04 00:35:27 +00:00
|
|
|
# Reference: <https://postmarketos.org/vendorkernel>
|
|
|
|
# Kernel config based on: arch/arm/configs/msm8974_sec_defconfig
|
|
|
|
# arch/arm/configs/msm8974pro_sec_klte_eur_defconfig
|
|
|
|
# arch/arm/configs/selinux_defconfig
|
2018-02-02 19:59:14 +00:00
|
|
|
|
|
|
|
pkgname="linux-samsung-klte"
|
2018-12-04 00:35:27 +00:00
|
|
|
pkgver=3.4.113
|
|
|
|
pkgrel=0
|
2018-02-02 19:59:14 +00:00
|
|
|
pkgdesc="Samsung Galaxy S5 kernel fork"
|
|
|
|
arch="armhf"
|
|
|
|
_carch="arm"
|
|
|
|
_flavor="samsung-klte"
|
2018-12-04 00:35:27 +00:00
|
|
|
url="https://kernel.org"
|
|
|
|
license="GPL-2.0-only"
|
2018-02-02 19:59:14 +00:00
|
|
|
options="!strip !check !tracedeps"
|
2018-12-04 00:35:27 +00:00
|
|
|
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev xz dtbtool devicepkg-dev gcc6"
|
2018-10-01 06:44:18 +00:00
|
|
|
|
2018-12-04 00:35:27 +00:00
|
|
|
# Compiler: GCC 6 (doesn't boot when compiled with newer versions)
|
2018-10-01 06:44:18 +00:00
|
|
|
if [ "${CC:0:5}" != "gcc6-" ]; then
|
|
|
|
CC="gcc6-$CC"
|
2018-11-30 20:56:06 +00:00
|
|
|
HOSTCC="gcc6-gcc"
|
2018-10-01 06:44:18 +00:00
|
|
|
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
|
|
|
|
fi
|
2018-02-02 19:59:14 +00:00
|
|
|
|
|
|
|
# Source
|
2018-12-04 00:35:27 +00:00
|
|
|
_repository="android_kernel_samsung_msm8974"
|
|
|
|
_commit="7a3b6080ee8d411acc2bb4a08de479aa8cc9c77a"
|
2018-02-02 19:59:14 +00:00
|
|
|
_config="config-${_flavor}.${arch}"
|
|
|
|
source="
|
2018-12-04 00:35:27 +00:00
|
|
|
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/${_repository}/archive/${_commit}.tar.gz
|
2018-02-02 19:59:14 +00:00
|
|
|
$_config
|
|
|
|
00_fix_return_address.patch
|
2018-12-04 00:35:27 +00:00
|
|
|
01_gpu-msm-fix-gcc5-compile.patch
|
|
|
|
02-Reduce-battery-and-touchscreen-log-spam.patch
|
2018-02-02 19:59:14 +00:00
|
|
|
"
|
|
|
|
builddir="$srcdir/${_repository}-${_commit}"
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
default_prepare
|
2018-12-04 00:35:27 +00:00
|
|
|
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
|
2018-02-02 19:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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"
|
2018-12-04 00:35:27 +00:00
|
|
|
|
|
|
|
# External modules install
|
|
|
|
cd "$builddir"
|
|
|
|
make ARCH="$_carch" CC="${CC:-gcc}" \
|
|
|
|
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
|
|
|
|
INSTALL_MOD_PATH="$pkgdir" modules_install
|
2018-02-02 19:59:14 +00:00
|
|
|
}
|
|
|
|
|
2018-12-04 00:35:27 +00:00
|
|
|
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"
|