Files
pmaports-rtwo/device/testing/linux-next/APKBUILD
T

98 lines
2.7 KiB
Bash

# Maintainer: Casey Connolly <kcxt@postmarketos.org>
# Kernel config based on: arch/arm64/configs/defconfig
pkgname=linux-next
pkgver=6.18_git20251212
pkgrel=0
_nextver="${pkgver#*_git}"
pkgdesc="Linux next kernel"
arch="armv7 aarch64"
case "$CARCH" in
aarch64) _carch="arm64";_defconfig="defconfig";;
# FIXME: We should not be using qcom_defconfig. Instead we should be using multi_v7_defconfig.
# The problem is two-fold:
# - We need to reduce the amount of mainline kernels.
# - We need to find a way to not duplicate upstream defconfigs into our repo.
# Please see: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6133#note_468011
armv7) _carch="arm";_defconfig="qcom_defconfig";;
esac
_flavor="generic-trailblazer"
url="https://kernel.org"
license="GPL-2.0-only"
# FIXME: kconfigcheck isn't supported since we use fragments
options="!strip !check !tracedeps pmb:cross-native"
source="
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/snapshot/linux-next-next-$_nextver.tar.gz
devices.config
pmos.config
"
makedepends="
bash
bc
bison
clang
clang-libclang
devicepkg-dev
elfutils-dev
findutils
flex
git
lld
llvm
openssl-dev
perl
postmarketos-installkernel
python3
rust
rust-bindgen
rust-src
rustfmt
zstd
"
builddir="$srcdir/linux-next-next-$_nextver"
prepare() {
default_prepare
cp "$srcdir/pmos.config" "$builddir"/arch/"$_carch"/configs/
cp "$srcdir/devices.config" "$builddir"/arch/"$_carch"/configs/
# Generate .config
unset LDFLAGS
make ARCH="$_carch" LLVM=1 \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-next-$_nextver" \
"$_defconfig" pmos.config devices.config
}
build() {
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" LLVM=1 \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
if [ "$CARCH" != "armv7" ]; then
install -Dm644 "$builddir/arch/$_carch/boot/vmlinuz.efi" \
"$pkgdir/boot/linux.efi"
fi
mkdir -p "$pkgdir"/boot
make LLVM=1 zinstall modules_install dtbs_install \
ARCH="$_carch" \
INSTALL_PATH="$pkgdir"/boot/ \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_MOD_STRIP=1 \
INSTALL_DTBS_PATH="$pkgdir"/boot/dtbs
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/next-"$_nextver"/kernel.release
}
sha512sums="
0b7d71e55d67754cc258e482c45e1b7e276ff0aed6564be550ff884220c16a7be98f92581f191b3a00e0a1b6af5d986648b27a9d84ddb9026522dd54b9b22f66 linux-next-next-20251212.tar.gz
9b97849df749c6051503b4f4522db72bc6d5ec718a65a24f99132138a9262b6a473a33bc02e5f09fdb721066d3f6e6a0577de363cdd8a0e38ee99c9e3b08d01d devices.config
ea219f10f6509193d1940f34a92627bf7d6d6b21c2c43f4cbd2c733bdf3e5bcb6b9b39d5bcc3f597f207c6e729a4ca118529fe0cf4d2805e16059de225e3c354 pmos.config
"