2019-03-21 10:07:55 +00:00
|
|
|
# Reference: <https://postmarketos.org/vendorkernel>
|
2019-08-27 14:05:41 +00:00
|
|
|
# Kernel config based on: arch/arm64/configs/montana_defconfig
|
2019-03-21 10:07:55 +00:00
|
|
|
|
|
|
|
pkgname="linux-motorola-montana"
|
2019-08-27 14:05:41 +00:00
|
|
|
pkgver=3.18.140
|
2019-03-21 10:07:55 +00:00
|
|
|
pkgrel=0
|
|
|
|
pkgdesc="Motorola Moto G5s kernel fork"
|
2019-08-27 14:05:41 +00:00
|
|
|
arch="aarch64"
|
|
|
|
_carch="arm64"
|
2019-03-21 10:07:55 +00:00
|
|
|
_flavor="motorola-montana"
|
|
|
|
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 dtbtool xz"
|
|
|
|
|
|
|
|
# Source
|
2019-08-27 14:05:41 +00:00
|
|
|
_repository="android_kernel_motorola_msm8937"
|
|
|
|
_commit="1e8993177823e4ddf3b5d91da6335d75ad513dec"
|
2019-03-21 10:07:55 +00:00
|
|
|
_config="config-${_flavor}.${arch}"
|
|
|
|
source="
|
2019-08-27 14:05:41 +00:00
|
|
|
$pkgname-$_commit.tar.gz::https://github.com/MontanaDevelopment/${_repository}/archive/${_commit}.tar.gz
|
2019-03-21 10:07:55 +00:00
|
|
|
$_config
|
|
|
|
"
|
|
|
|
builddir="$srcdir/${_repository}-${_commit}"
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
default_prepare
|
2019-08-27 14:05:41 +00:00
|
|
|
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
|
2019-03-21 10:07:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
unset LDFLAGS
|
|
|
|
make ARCH="$_carch" CC="${CC:-gcc}" \
|
|
|
|
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
|
|
|
|
|
|
|
|
# Generate master DTB (deviceinfo_bootimg_qcdt)
|
|
|
|
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"
|
2019-08-27 14:05:41 +00:00
|
|
|
for _zimg in zImage-dtb Image.gz-dtb *zImage Image.gz Image; do
|
2019-03-21 10:07:55 +00:00
|
|
|
[ -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 (deviceinfo_bootimg_qcdt)
|
|
|
|
install -Dm644 "$builddir/arch/arm/boot/dt.img" \
|
|
|
|
"$pkgdir/boot/dt.img"
|
|
|
|
}
|
|
|
|
|
2019-08-27 14:05:41 +00:00
|
|
|
sha512sums="369dfffb8088958226b1a259705f4af1e5e9b02d32fde4cd9f9c50f2165658a187f5aa74badff77761a02c2c088484789267db6afbcc3e802dd62b1e819553c0 linux-motorola-montana-1e8993177823e4ddf3b5d91da6335d75ad513dec.tar.gz
|
|
|
|
3d05f43f3c3ca5afc5bc46aeb7b08ffda78ca6b146bf9d8969c14da3b62ae9fa83dab85cac291aadf9ee4d182e98d6d56f8da9324681a6b697e22456c9fbbee5 config-motorola-montana.aarch64"
|