pmaports/main/lk2nd/APKBUILD
Alexey Min 4fe645dead
main/lk2nd: upgrade to 0.13.0 (MR 3554)
- Support for the huawei-g7 display panel in lk1st
- FS based boot is skipped when going to the recovery
- Generate image without appended dtb for lk2nd-msm8226
- Some bug fixes and device improvements

New devices:
 - Samsung Galaxy Ace 4 (SM-G357FZ)
 - Samsung Galaxy Grand 2 (SM-G7102)
 - Samsung Galaxy Grand Max (SM-G720AX)
 - Samsung Galaxy Tab 4 10.1 (2014) (SM-T530)
 - Huawei Ascend G6 L11 LTE
 - Some new variants for the existing Samsung devices

Changelog: https://github.com/msm8916-mainline/lk2nd/releases/tag/0.13.0
2022-10-18 02:03:55 +03:00

80 lines
2.5 KiB
Text

# Maintainer: Alexey Minnekhanov <alexeymin@postmarketos.org>
pkgname=lk2nd
pkgver=0.13.0
pkgrel=0
pkgdesc="Secondary little kernel (lk) bootloader for several Qualcomm devices"
arch="armv7 aarch64"
url="https://github.com/msm8916-mainline/lk2nd"
license="MIT AND BSD-3-Clause AND GPL-2.0-only"
makedepends="dtc dtc-dev gcc-arm-none-eabi python3 py3-libfdt"
source="$pkgname-$pkgver.tar.gz::https://github.com/msm8916-mainline/lk2nd/archive/refs/tags/$pkgver.tar.gz"
options="!check !archcheck !tracedeps !strip pmb:cross-native"
# This APKBUILD builds bare metal executable; options are very specific!
# * there are no tests (how do you even test the bootloader?);
# * binaries are "arch-independent"; aarch64 build also produces armv7 binary,
# because ARM CPUs boot in 32-bit mode;
# * there are no depends for bootloader, it's a kernel and OS in one binary;
# * stripping of unused sections is done in lk2nd's own ld script.
subpackages="
$pkgname-msm8226
$pkgname-msm8226-appended:msm8226_appended
$pkgname-msm8916
$pkgname-msm8916-appended:msm8916_appended
$pkgname-msm8974
"
build() {
# This builds baremetal executable; distro-specific compiler flags
# and optimizations can't be set by build system.
unset CFLAGS
unset CXXFLAGS
unset CPPFLAGS
unset LDFLAGS
unset CROSS_COMPILE
unset CC
unset CXX
# ccache and crossdirect "gcc"s are in PATH, get rid of them too,
# redefine PATH to be bare minimum
unset PATH
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
make LK2ND_VERSION="$pkgver-r$pkgrel-postmarketos" TOOLCHAIN_PREFIX=arm-none-eabi- lk2nd-msm8916
make LK2ND_VERSION="$pkgver-r$pkgrel-postmarketos" TOOLCHAIN_PREFIX=arm-none-eabi- lk2nd-msm8974
make LK2ND_VERSION="$pkgver-r$pkgrel-postmarketos" TOOLCHAIN_PREFIX=arm-none-eabi- lk2nd-msm8226
}
package() {
# main package is empty
mkdir -p "$pkgdir"
}
msm8916() {
install -Dm644 "$builddir"/build-lk2nd-msm8916/lk2nd.img -t \
"$subpkgdir"/boot
}
msm8916_appended() {
install -Dm644 "$builddir"/build-lk2nd-msm8916/lk2nd-appended-dtb.img \
"$subpkgdir"/boot/lk2nd.img
}
msm8974() {
install -Dm644 "$builddir"/build-lk2nd-msm8974/lk2nd.img -t \
"$subpkgdir"/boot
}
msm8226() {
install -Dm644 "$builddir"/build-lk2nd-msm8226/lk2nd.img \
"$subpkgdir"/boot/lk2nd.img
}
msm8226_appended() {
install -Dm644 "$builddir"/build-lk2nd-msm8226/lk2nd-appended-dtb.img \
"$subpkgdir"/boot/lk2nd.img
}
sha512sums="
20fc61cdad9e376e45a72eeb8e4fd5019548de1014e012abba9c278d62304fd50efc70fb34c19cc1540c4bd541d56472529a6324bb8189847a770d68efc268df lk2nd-0.13.0.tar.gz
"