main/linux-postmarketos-qcom-msm8916: build for armv7 (!828)

Unfortunately, early firmware versions on MSM8916 (used together with
Android 4.4) are not capable of booting aarch64 kernels. MSM8916 was
Qualcomm's first 64-bit capable CPU, and back when it was introduced
Android did not even support aarch64 yet. So the aarch64 capable
hardware was usually used together with armv7 binaries.

To make things worse, this firmware is also signed (usually per-device),
making it (currently) impossible to update it without help from the manufacturer.
This means that we are currently unable to run mainline on devices
that never received an update to Android 5.0
(e.g. the Samsung Galaxy S4 Mini Value Edition).

One way to circumvent this limitation is to build mainline for armv7.
This works surprisingly well with some additional fixes.
Devices with this firmware limitation are still unable to use aarch64
binaries, but at least we can run mainline on them!
This commit is contained in:
Minecrell 2019-12-07 15:00:13 +01:00 committed by Alexey Min
parent 62bc6bb2ec
commit 8ac2eaa2cf
No known key found for this signature in database
GPG key ID: 0B19D2A65870B448
2 changed files with 5205 additions and 7 deletions

View file

@ -6,14 +6,19 @@ pkgname="linux-${_flavor}"
pkgver=5.5_rc3
pkgrel=0
pkgdesc="Mainline kernel fork for Qualcomm MSM8916 devices"
arch="aarch64"
_carch="arm64"
arch="aarch64 armv7"
url="https://github.com/msm8916-mainline/linux"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
depends_dev="perl gmp-dev elfutils-dev bash flex bison"
makedepends="$depends_dev sed installkernel bc linux-headers openssl-dev dtbtool"
# Architecture
case "$CARCH" in
aarch64) _carch="arm64" ;;
arm*) _carch="arm" ;;
esac
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
@ -22,13 +27,14 @@ HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
_tag=v${pkgver//_/-}-msm8916
source="
$pkgname-$_tag.tar.gz::$url/archive/$_tag.tar.gz
config-$_flavor.$arch
config-$_flavor.aarch64
config-$_flavor.armv7
"
builddir="$srcdir/linux-${_tag#v}"
prepare() {
default_prepare
cp "$srcdir/config-$_flavor.$arch" .config
cp "$srcdir/config-$_flavor.$CARCH" .config
}
build() {
@ -50,9 +56,10 @@ package() {
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
# Master DTB (deviceinfo_bootimg_qcdt)
dtbTool -p scripts/dtc/ -o arch/arm64/boot/dt.img arch/arm64/boot/
install -Dm644 arch/arm64/boot/dt.img "$pkgdir"/boot/dt.img
dtbTool -p scripts/dtc/ -o "arch/$_carch/boot"/dt.img "arch/$_carch/boot/"
install -Dm644 "arch/$_carch/boot"/dt.img "$pkgdir"/boot/dt.img
}
sha512sums="f812b03b83d77b51ee4d99ed22b955bd8a6ae714e4dd171d7798975cf0e5ce30067748655ff5ae052aeb8941d9f4d6a9c10b8bccd997a8f5cff9b16553fd3ea7 linux-postmarketos-qcom-msm8916-v5.5-rc3-msm8916.tar.gz
ef2a21d00e781a69cc6f800b6097a36b8a4bd656bd3d72ccb999a4fb6f7123adaf5c24511089b98545d3e46746353b30025cd174dc7eff98f793362e4331aa7c config-postmarketos-qcom-msm8916.aarch64"
ef2a21d00e781a69cc6f800b6097a36b8a4bd656bd3d72ccb999a4fb6f7123adaf5c24511089b98545d3e46746353b30025cd174dc7eff98f793362e4331aa7c config-postmarketos-qcom-msm8916.aarch64
8dc4f6242a3f2022f38741113bfc9b4737c6e94b4544914c8f441c4c83ca91c56e31258077bdb4fdb1e5fa80a79b62bb28e1cbbb43042df4e75ec6fe5bc1caef config-postmarketos-qcom-msm8916.armv7"

File diff suppressed because it is too large Load diff