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
|
2019-01-10 03:47:19 +00:00
|
|
|
|
|
|
|
pkgname="linux-purism-librem5dev"
|
2019-09-01 04:06:00 +00:00
|
|
|
pkgver=5.2
|
|
|
|
pkgrel=0
|
2019-01-10 03:47:19 +00:00
|
|
|
pkgdesc="Purism Librem 5 devkit kernel fork"
|
|
|
|
arch="aarch64"
|
|
|
|
_carch="arm64"
|
2019-01-29 04:08:52 +00:00
|
|
|
_flavor="purism-librem5dev"
|
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"
|
|
|
|
# imx8-5.2-devkit branch:
|
|
|
|
_commit="ef814e5c7b41dfbaeb0ac468de0035d5c3cb3b15"
|
2019-01-10 03:47:19 +00:00
|
|
|
_config="config-${_flavor}.${arch}"
|
|
|
|
source="
|
|
|
|
$pkgname-$_commit.tar.gz::https://source.puri.sm/Librem5/${_repository}/-/archive/${_commit}.tar.gz
|
|
|
|
$_config
|
|
|
|
"
|
|
|
|
builddir="$srcdir/${_repository}-${_commit}"
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-09-01 04:06:00 +00:00
|
|
|
sha512sums="4e9fb564f57656064e139760bb68336a4d208d65004e043452a19f9e1e9ae11d927ca469271f71f0d2b9c5bf257e8a3e3f049f7861b2f4bfe24b71485b8cd542 linux-purism-librem5dev-ef814e5c7b41dfbaeb0ac468de0035d5c3cb3b15.tar.gz
|
|
|
|
7b767918c425eb0dec029a5780615187bc972d30fd11cc7eca43c0a5ae97c7e5be80464be2d743a97f1fa042a74c02dac89a2ab9ed3bff35213f963a0d51e19c config-purism-librem5dev.aarch64"
|