pmaports/device/linux-motorola-cedric/APKBUILD
Hacker1245 dca30e4e60
motorola-cedric: Enable OTG (!163)
OTG was tested with a keyboard and a pendrive.

[skip ci]: this was built successfully in CI earlier, only rebased and
           squashed the commits here.
2019-01-23 09:49:15 +01:00

77 lines
2.9 KiB
Text

# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/cedric_defconfig
pkgname="linux-motorola-cedric"
pkgver=3.18.49
pkgrel=1
pkgdesc="Motorola Moto G5 kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="motorola-cedric"
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"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="android_kernel_motorola_msm8937"
_commit="2d29701ed2d080029f0bd3ceba07df66ae4e9c2d"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/Sohamlad7/${_repository}/archive/${_commit}.tar.gz
$_config
gcc8-fix-put-user.patch
03_fix_rndis_ipa_trace_header_not_found.patch
05_fix_u_f_header.patch
06_fix_usb_gadget_function.patch
"
builddir="$srcdir/${_repository}-${_commit}"
prepare() {
default_prepare
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
}
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/arm64/boot/dt.img" "arch/arm64/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/arm64/boot/dt.img" \
"$pkgdir/boot/dt.img"
}
sha512sums="706b37cf09d23abab80ba6e8dfbd8c806e4ecb4c3a31f0b0b5ba7ac29c7922716c46e89e4a99eb0febc2d7abe4b433e1b25a7e4f4c05ec43646c6c685e44b4c4 linux-motorola-cedric-2d29701ed2d080029f0bd3ceba07df66ae4e9c2d.tar.gz
502a26d95a99df2fa0135a8a3a57353ad36f16f927d617d3e5f0962eda7460c7abb1e9f029cbd17960000e84a5203fb78eed77b5eea9308db3a70acd311e5e21 config-motorola-cedric.aarch64
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
9c549714f03c7a7666e8aa7508a48cfdccab7cf3e97fb59c4df8fa97f75492365926f82c4a677c50780d68d4905504dcccbdd6de6344bd8d4b88b2331933ed46 03_fix_rndis_ipa_trace_header_not_found.patch
b408f157cc025d410b38f5aee9be977e670e1ac3f195f6c3a6681446fa0c3887067d62a4f729cfcd058fab42fca355b0265764dc2d21515f6e023ed025f55d41 05_fix_u_f_header.patch
1f23466d1a864f2d2c67ae4250b0c166ecb7755779bbdad6732808a001cc2826cc1d013c2281d2ca1d5abd7d60d13783f0b9f11bb8359971f2b30b911e627220 06_fix_usb_gadget_function.patch"