2018-01-06 14:51:47 +00:00
|
|
|
# Kernel config based on: arch/arm/configs/shamu_defconfig
|
|
|
|
|
|
|
|
pkgname="linux-motorola-shamu"
|
|
|
|
pkgver=3.10.40
|
2018-11-28 22:54:09 +00:00
|
|
|
pkgrel=2
|
2018-01-06 14:51:47 +00:00
|
|
|
pkgdesc="Motorola Google Nexus 6 kernel fork"
|
|
|
|
arch="armhf"
|
|
|
|
_carch="arm"
|
|
|
|
_flavor="motorola-shamu"
|
|
|
|
url="https://kernel.org"
|
|
|
|
license="GPL2"
|
|
|
|
options="!strip !check !tracedeps"
|
2018-10-01 06:44:18 +00:00
|
|
|
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev 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 <https://postmarketos.org/vendorkernel> for instructions.
|
|
|
|
if [ "${CC:0:5}" != "gcc6-" ]; then
|
|
|
|
CC="gcc6-$CC"
|
2018-11-28 22:54:09 +00:00
|
|
|
HOSTCC="gcc-6"
|
2018-10-01 06:44:18 +00:00
|
|
|
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
|
|
|
|
fi
|
2018-01-06 14:51:47 +00:00
|
|
|
|
|
|
|
# Source
|
|
|
|
_repository="android_kernel_moto_shamu"
|
|
|
|
_commit="0f791f84d1951e144f1e466ba97dd692d33d93c7"
|
|
|
|
_config="config-${_flavor}.${arch}"
|
|
|
|
source="
|
|
|
|
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/${_repository}/archive/${_commit}.tar.gz
|
|
|
|
$_config
|
|
|
|
compiler-gcc6.h
|
|
|
|
00_fix_return_address.patch
|
|
|
|
"
|
|
|
|
builddir="$srcdir/${_repository}-${_commit}"
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
default_prepare
|
|
|
|
|
|
|
|
# gcc6 support
|
|
|
|
cp -v "$srcdir/compiler-gcc6.h" "$builddir/include/linux/"
|
|
|
|
|
|
|
|
# Remove -Werror from all makefiles
|
|
|
|
find . -type f -name Makefile -print0 | \
|
|
|
|
xargs -0 sed -i 's/-Werror-/-W/g'
|
|
|
|
find . -type f -name Makefile -print0 | \
|
|
|
|
xargs -0 sed -i 's/-Werror//g'
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
}
|
|
|
|
|
|
|
|
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="2349f1ea66d3bf05675d91a8cf959bf683818c4aafc04b3ec60f8d0ee07dae1d38ade24b14a2457df733ed2db8249dba680a70992d5748806375b76b9cc47dc5 linux-motorola-shamu-0f791f84d1951e144f1e466ba97dd692d33d93c7.tar.gz
|
2018-01-12 22:01:55 +00:00
|
|
|
ffba29331b793b05831bd7cf4d5ddae0cb9ca6c8aae6ecf6c8826f8aa1aa62ced03a0559afe3efa6c838ecc0f0cb9ea05a3583bcef3e9e32ce2bcc42497171e6 config-motorola-shamu.armhf
|
2018-01-06 14:51:47 +00:00
|
|
|
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
|
|
|
|
ea1d3b5a234fa565e3c1a792de48f4fc4e6023d281d303c8e319c7ef28edc5739ab0e4dea0139a41f0a5c7d03e27921ccaa214fd0ac5c72245a094ce60128864 00_fix_return_address.patch"
|