Files
pmaports-rtwo/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD
T
snlavaiseandClaude Sonnet 5 4bd61bd652 linux-postmarketos-qcom-sm8550: add APSS watchdog node for rtwo
'fastboot boot' hands off cleanly (OKAY / booting) and the device then
resets - classic unpetted APSS watchdog. sm8550.dtsi at 6.13-rc3 has no
watchdog node; add it for rtwo so qcom_wdt binds and keeps it fed.

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

114 lines
3.8 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=1
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
rtwo.config
"
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, then merge the
# rtwo bring-up fragment on top.
# 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).
cp "$srcdir/rtwo.config" arch/$_carch/configs/rtwo.config
make ARCH="$_carch" LLVM=1 HOSTLDFLAGS="-fuse-ld=lld" \
defconfig pmos.config devices.config rtwo.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
02d8dc574f20027a4aace5238fa879bb2d305551f8583f2b5b37d5388ab9ba6c7337f6f2bb4e23ddb3d852a3195fb4cddfc9791e7c6a33e60bee552b028d101c sm8550-motorola-rtwo.dts
91cebe340d9e1a3f308725ced37d2f6c4695869100e198d693317f476b1123128b1b24a0604f4aa132d6269de68a87017485149df7d2924cf3a09241b999ffcf rtwo.config
"