76 lines
2.3 KiB
Text
76 lines
2.3 KiB
Text
|
# Reference: <https://postmarketos.org/vendorkernel>
|
||
|
# Kernel config based on: arch/arm/configs/tegra_defconfig
|
||
|
|
||
|
pkgname="linux-samsung-i927"
|
||
|
pkgver=4.20.4
|
||
|
pkgrel=0
|
||
|
pkgdesc="Samsung Captivate Glide kernel fork"
|
||
|
arch="armhf"
|
||
|
_carch="arm"
|
||
|
_flavor="samsung-i927"
|
||
|
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 flex bison openssl-dev"
|
||
|
|
||
|
# Compiler: latest GCC from Alpine
|
||
|
HOSTCC="${CC:-gcc}"
|
||
|
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
|
||
|
|
||
|
# Source
|
||
|
_repository="linux"
|
||
|
_config="config-${_flavor}.${arch}"
|
||
|
source="
|
||
|
$pkgname-$pkgver.tar.gz::https://kernel.org/pub/linux/kernel/v4.x/linux-$pkgver.tar.gz
|
||
|
$_config
|
||
|
kernel.patch
|
||
|
"
|
||
|
builddir="$srcdir/${_repository}-${pkgver}"
|
||
|
|
||
|
prepare() {
|
||
|
default_prepare
|
||
|
|
||
|
# Prepare kernel config ('yes ""' for kernels lacking olddefconfig)
|
||
|
cp "$srcdir/$_config" "$builddir"/.config
|
||
|
yes "" | make -C "$builddir" ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
|
||
|
}
|
||
|
|
||
|
build() {
|
||
|
unset LDFLAGS
|
||
|
make ARCH="$_carch" CC="${CC:-gcc}" \
|
||
|
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
|
||
|
}
|
||
|
|
||
|
package() {
|
||
|
cat "$builddir/arch/arm/boot/zImage" \
|
||
|
"$builddir/arch/arm/boot/dts/tegra20-glide.dtb" \
|
||
|
> "$builddir/arch/arm/boot/zImage-dtb"
|
||
|
|
||
|
# 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
|
||
|
|
||
|
cd "$builddir"
|
||
|
make modules_install \
|
||
|
ARCH="$_carch" \
|
||
|
INSTALL_MOD_PATH="$pkgdir"
|
||
|
}
|
||
|
|
||
|
sha512sums="5f9eb065932e404091dd9e4afd5a92b6382ddbc81488684c42981cdfe227da9a423356c19ec236ca1a9a7f4bf042cf351aa8b3cd4f7488b0d8b1245d69221a5c linux-samsung-i927-4.20.4.tar.gz
|
||
|
fb556670c376c85f6c0ad0105179298e8d7b1564e32c7a50152924112407dcc294b5e322eb207e801f61e81f9511e28c52dcd663152c2e5a1ea1a9e0100d09ba config-samsung-i927.armhf
|
||
|
c65a89a07b20b3720d6187c6049f215823b07fd4ba647984691bf37d2488a71f4e00ce8bc9521c499b7e15f13fb1473289a8eeea42899d5a6c0c3247b0a94549 kernel.patch"
|