ee659a5bb4
Adjust HOSTCC to work with Alpine's version.
80 lines
2.6 KiB
Text
80 lines
2.6 KiB
Text
# Kernel config based on: arch/arm/configs/aosp_rhine_honami_defconfig
|
|
|
|
pkgname="linux-sony-honami"
|
|
pkgver=3.10.84
|
|
pkgrel=1
|
|
pkgdesc="Sony Xperia Z1 kernel fork"
|
|
arch="armhf"
|
|
_carch="arm"
|
|
_flavor="sony-honami"
|
|
url="https://github.com/sonyxperiadev/kernel"
|
|
license="GPL2"
|
|
options="!strip !check !tracedeps"
|
|
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"
|
|
HOSTCC="gcc-6"
|
|
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
|
|
fi
|
|
|
|
# Source
|
|
_repository="kernel"
|
|
_commit="d78970c1afd9fad52cb4402c7bcb9701e8a06d41"
|
|
_config="config-${_flavor}.${arch}"
|
|
source="
|
|
$pkgname-$_commit.tar.gz::https://github.com/sonyxperiadev/${_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
|
|
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="b76641c07489712d393f1d318b0d4138e5c7126d4b78cfc23bcde07911cba185d3872e886f69197bd3912e8b4c646b74fb6992dee0ce3829d2995531ac4f257e linux-sony-honami-d78970c1afd9fad52cb4402c7bcb9701e8a06d41.tar.gz
|
|
7b7a6c62e4de1de680d8792c80369618ef6c4a5ae9459dd224b1c1f5b403dd3d4eccec41ef6c69f34d870788b63be2cbcd6d935c8f5f3f9e51fcad0147697396 config-sony-honami.armhf
|
|
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h"
|