Files
pmaports-rtwo/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD
T
snlavaiseandClaude Sonnet 5 5683af653a linux-postmarketos-qcom-sm8550: use rtwo-specific regulator ranges
The reference-design rail voltages that both sm8550-mtp and the rtwo
downstream share are unchanged, but three rails carry board-specific
ranges in the Motorola DT / device DTB dump:

  L11B (panel VDD):  1.20-1.50 V  ->  1.23-1.28 V
  L1E  (USB HS phy): fixed 0.88 V ->  0.88-0.912 V
  L1G  (UFS VCCQ):   fixed 1.20 V ->  1.144-1.256 V

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QF5HebjUsRaxbW4cBX6HJP
2026-09-08 14:16:34 -03:00

110 lines
3.6 KiB
Bash

# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/defconfig (+ pmos.config, devices.config)
maintainer="snlavaise <snlavaise@gmail.com>"
_flavor="postmarketos-qcom-sm8550"
pkgname=linux-$_flavor
pkgver=6.13_rc3
pkgrel=0
pkgdesc="Mainline kernel fork for Qualcomm SM8550 (Snapdragon 8 Gen 2) devices"
arch="aarch64"
_carch="arm64"
url="https://gitlab.postmarketos.org/soc/qcom-sm8550/linux"
license="GPL-2.0-only"
options="
!check
!strip
!tracedeps
pmb:cross-native
pmb:kconfigcheck-community
pmb:kconfigcheck-uefi
"
makedepends="
bash
bison
clang
elfutils-dev
findutils
flex
linux-headers
lld
llvm
openssl-dev
pahole
perl
postmarketos-installkernel
python3
zstd
"
# Source: snapshot of the postmarketOS SM8550 bring-up tree (branch: bringup).
# Bump _commit to move forward; then run 'pmbootstrap checksum linux-postmarketos-qcom-sm8550'.
_commit="22591bbc21da5cc0c6e37503b77bd2d852fe241c"
source="
$pkgname-$_commit.tar.gz::https://gitlab.postmarketos.org/soc/qcom-sm8550/linux/-/archive/$_commit/linux-$_commit.tar.gz
sm8550-motorola-rtwo.dts
"
builddir="$srcdir/linux-$_commit"
prepare() {
default_prepare
# The Motorola rtwo (Moto Edge 40 Pro) device tree is not upstream yet, so
# drop it into the tree and register it in the Makefile before configuring.
local _dtsdir="$builddir/arch/$_carch/boot/dts/qcom"
cp "$srcdir/sm8550-motorola-rtwo.dts" "$_dtsdir/sm8550-motorola-rtwo.dts"
if ! grep -q "sm8550-motorola-rtwo.dtb" "$_dtsdir/Makefile"; then
sed -i '/sm8550-mtp\.dtb/a dtb-$(CONFIG_ARCH_QCOM) += sm8550-motorola-rtwo.dtb' \
"$_dtsdir/Makefile"
fi
# Generate .config from the in-tree upstream defconfig plus the postmarketOS
# and device config fragments shipped by the kernel repo.
# To "freeze" this config: build once, copy "$builddir"/.config to
# config-$_flavor.$CARCH, add it to source= and switch prepare() to a plain
# 'cp "$srcdir/config-$_flavor.$CARCH" .config' (like the other qcom kernels).
make ARCH="$_carch" LLVM=1 HOSTLDFLAGS="-fuse-ld=lld" \
defconfig pmos.config devices.config
}
build() {
unset LDFLAGS
make ARCH="$_carch" LLVM=1 HOSTLDFLAGS="-fuse-ld=lld" \
KBUILD_BUILD_VERSION="$((pkgrel + 1))-$_flavor"
}
package() {
mkdir -p "$pkgdir"/boot
if [ -e "$builddir/arch/$_carch/boot/vmlinuz.efi" ]; then
# ZBOOT EFI decompressor for EFI booting
install -Dm644 "$builddir/arch/$_carch/boot/vmlinuz.efi" \
"$pkgdir/boot/linux.efi"
# gzip'd image for Android boot.img compatibility
install -Dm644 "$builddir/arch/$_carch/boot/vmlinuz" \
"$pkgdir/boot/vmlinuz"
else
echo "WARNING: CONFIG_EFI_ZBOOT not enabled!"
install -Dm644 "$builddir/arch/$_carch/boot/Image.gz" \
"$pkgdir/boot/vmlinuz"
fi
make modules_install dtbs_install \
ARCH="$_carch" \
LLVM=1 \
INSTALL_PATH="$pkgdir"/boot \
INSTALL_MOD_PATH="$pkgdir"/usr \
INSTALL_MOD_STRIP=1 \
INSTALL_DTBS_PATH="$pkgdir"/boot/dtbs
rm -f "$pkgdir"/usr/lib/modules/*/build "$pkgdir"/usr/lib/modules/*/source
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/"$_flavor"/kernel.release
}
# The kernel tarball checksum is filled in by
# 'pmbootstrap checksum linux-postmarketos-qcom-sm8550' (it downloads ~250 MB).
sha512sums="
19f6d0ee8481e34b0b8c27f07f3023182cda9e2a3d67e40989b1f300b7e82d7ea606fb112599dd9399e0d5f973d43b289d8932a4b578b6ffe4168af05e19f795 linux-postmarketos-qcom-sm8550-22591bbc21da5cc0c6e37503b77bd2d852fe241c.tar.gz
11210b15854d92754b7bc801c1e807497b3336585498770d62d5aec6f81bc5b0b0ad6f775421e3af34edaece04f2b81e9bbc01381b78d1030d97598902d6fb11 sm8550-motorola-rtwo.dts
"