diff --git a/projects/ArchR/packages/hardware/quirks/platforms/RK3326/030-suspend_mode b/projects/ArchR/packages/hardware/quirks/platforms/RK3326/030-suspend_mode new file mode 100755 index 0000000000..d5d1570ac5 --- /dev/null +++ b/projects/ArchR/packages/hardware/quirks/platforms/RK3326/030-suspend_mode @@ -0,0 +1,19 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2026-present ArchR (https://github.com/archr-linux/Arch-R) + +# Kernel suspend does not survive on px30 mainline (mem hangs on entry, +# freeze never wakes, RTC alarm included; tested 2026-07-07 on the +# Soysauce). Default the suspend mode to "off" so the power button +# takes the archr-fake-suspend path (display off, audio muted, +# powersave governors, input grabbed) instead of a hard lockup. +# +# Runs in two roles: at boot it seeds the default once (covers pacman +# upgrades whose storage still carries the old mem-first sleep.conf), +# and the suspendmode script calls it when the user picks "default" in +# the ES SUSPEND MODE menu. Explicit user choices are never overridden. +. /etc/profile + +if [ -z "$(get_setting system.suspendmode)" ]; then + /usr/bin/suspendmode off >/dev/null 2>&1 +fi diff --git a/projects/ArchR/packages/sysutils/sleep/package.mk b/projects/ArchR/packages/sysutils/sleep/package.mk index f4103e522f..4a7efab989 100644 --- a/projects/ArchR/packages/sysutils/sleep/package.mk +++ b/projects/ArchR/packages/sysutils/sleep/package.mk @@ -14,10 +14,16 @@ makeinstall_target() { mkdir -p ${INSTALL}/usr/config/sleep.conf.d cp sleep.conf ${INSTALL}/usr/config/sleep.conf.d/sleep.conf if [ "${DEVICE}" = "RK3326" ]; then - # px30 mainline has no working S3: with the stock order the kernel - # tries "mem" first and the console hangs instead of sleeping. Land - # on s2idle directly; the PMIC pwrkey is a wakeup-source in every - # board DTS so the power button wakes it back up. + # px30 mainline has no working kernel suspend at all: "mem" hangs + # on entry and "freeze" (s2idle) enters but never wakes, not even + # from an armed RTC alarm (tested 2026-07-07 on the Soysauce with + # every wakeup source enabled; real debugging needs UART). Inhibit + # real suspend by default so the power button falls through to + # archr-fake-suspend; the ES SUSPEND MODE menu rewrites this file + # via the suspendmode script, so advanced users can still opt in + # to experiment. Keep freeze first for that case: it is the least + # bad state on this SoC. + sed -i 's/^AllowSuspend=.*/AllowSuspend=no/' ${INSTALL}/usr/config/sleep.conf.d/sleep.conf sed -i 's/^SuspendState=.*/SuspendState=freeze/' ${INSTALL}/usr/config/sleep.conf.d/sleep.conf fi cp modules.bad ${INSTALL}/usr/config