2019-01-10 03:47:19 +00:00
|
|
|
# Reference: <https://postmarketos.org/vendorkernel>
|
2019-09-01 04:06:00 +00:00
|
|
|
# Kernel config based on: arch/arm64/configs/librem5-devkit_defconfig
|
2020-01-12 02:51:36 +00:00
|
|
|
pkgname="linux-purism-librem5"
|
|
|
|
pkgver=5.3
|
2020-02-02 20:16:38 +00:00
|
|
|
pkgrel=1
|
2020-01-12 02:51:36 +00:00
|
|
|
pkgdesc="Purism Librem 5 phone kernel fork"
|
2019-01-10 03:47:19 +00:00
|
|
|
arch="aarch64"
|
|
|
|
_carch="arm64"
|
2020-01-12 02:51:36 +00:00
|
|
|
_flavor="purism-librem5"
|
2019-01-10 03:47:19 +00:00
|
|
|
url="https://kernel.org"
|
|
|
|
license="GPL-2.0-only"
|
2019-08-24 12:17:56 +00:00
|
|
|
options="!strip !check !tracedeps"
|
2019-01-10 03:47:19 +00:00
|
|
|
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev
|
|
|
|
devicepkg-dev bison flex openssl-dev"
|
|
|
|
|
|
|
|
# Compiler: latest GCC from Alpine
|
|
|
|
HOSTCC="${CC:-gcc}"
|
|
|
|
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
|
|
|
|
|
|
|
|
# Source
|
2019-09-01 04:06:00 +00:00
|
|
|
_repository="linux-next"
|
2020-01-12 02:51:36 +00:00
|
|
|
# imx8-current-librem5 branch:
|
2020-02-02 20:16:38 +00:00
|
|
|
_commit="1309cc0a813e70af9b3d8c29d513e78715475de5"
|
|
|
|
# kconfig generated with: ARCH=arm64 make defconfig KBUILD_DEFCONFIG=librem5_defconfig
|
2020-01-12 02:51:36 +00:00
|
|
|
_config="config-$_flavor.$arch"
|
2019-01-10 03:47:19 +00:00
|
|
|
source="
|
2020-01-12 02:51:36 +00:00
|
|
|
$pkgname-$_commit.tar.gz::https://source.puri.sm/Librem5/$_repository/-/archive/$_commit.tar.gz
|
2019-01-10 03:47:19 +00:00
|
|
|
$_config
|
|
|
|
"
|
2020-01-12 02:51:36 +00:00
|
|
|
builddir="$srcdir/$_repository-$_commit"
|
2019-01-10 03:47:19 +00:00
|
|
|
|
|
|
|
prepare() {
|
|
|
|
default_prepare
|
2019-01-29 08:50:55 +00:00
|
|
|
REPLACE_GCCH=0 \
|
|
|
|
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
|
2019-01-10 03:47:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
unset LDFLAGS
|
|
|
|
make ARCH="$_carch" CC="${CC:-gcc}" \
|
|
|
|
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
cd "$builddir"
|
|
|
|
local _install
|
|
|
|
case "$CARCH" in
|
|
|
|
aarch64*|arm*) _install="modules_install dtbs_install" ;;
|
|
|
|
*) _install="modules_install" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
make -j1 $_install \
|
|
|
|
ARCH="$_carch" \
|
|
|
|
INSTALL_MOD_PATH="$pkgdir" \
|
|
|
|
INSTALL_DTBS_PATH="$pkgdir/usr/share/dtb"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-02-02 20:16:38 +00:00
|
|
|
sha512sums="85cf8671c4d9481477edbb994423b3745cac684e7a056db889a97a18eb8e26778a900b7151865e8bc79f4394f0bb86c360ecf9eee01cbed6e7d4cbe2862b9e0c linux-purism-librem5-1309cc0a813e70af9b3d8c29d513e78715475de5.tar.gz
|
|
|
|
79046403a26384518ccdb849abc9cfdfe6873986286e4ce97af3e8f633fdb6c8f55b18c954b36edffed3f42f08cbc68f3311e1157f573ee8759fa3da800ad91e config-purism-librem5.aarch64"
|