From b0e6512aa29ef20b54bf20abbe65fb4c227e7010 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Fri, 2 Jun 2023 20:58:46 +0000 Subject: [PATCH] Rework scripts to enable configuring suspend mode, and to display panel info on RG353 devices. --- .../ATARI VCS 800 Onyx/001-hardwareinit | 11 ++ .../devices/AYANEO AIR Plus/001-hardwareinit | 11 +- .../devices/AYANEO AIR/001-hardwareinit | 11 ++ .../devices/Anbernic RG351M/001-hardwareinit | 10 +- .../hardware/quirks/devices/Anbernic RG353M | 1 + .../devices/Anbernic RG353M/001-deviceconfig | 38 ----- .../devices/Anbernic RG353M/001-hardwareinit | 17 -- .../quirks/devices/Anbernic RG353M/003-audio | 146 ------------------ .../devices/Anbernic RG353M/004-display | 16 -- .../devices/Anbernic RG353P/001-hardwareinit | 12 +- .../devices/Anbernic RG353P/info.d/001-panel | 18 +++ .../devices/Anbernic RG353V/001-hardwareinit | 10 +- .../devices/Anbernic RG353V/info.d/001-panel | 18 +++ .../devices/Anbernic RG503/001-hardwareinit | 12 +- .../devices/GPD G1619-04/001-hardwareinit | 11 ++ .../001-hardwareinit | 12 +- .../devices/LENOVO 81TC/001-hardwareinit | 6 + .../001-hardwareinit | 10 +- .../ODROID-GO Advance/001-hardwareinit | 10 +- .../devices/ODROID-GO Super/001-hardwareinit | 10 +- .../devices/Orange Pi 5/001-hardwareinit | 6 + .../devices/Powkiddy RK2023/001-hardwareinit | 12 +- .../devices/Powkiddy x55/001-hardwareinit | 10 +- .../Powkiddy x55/{sleep => sleep.d}/README | 0 .../{sleep => sleep.d}/post/001-audio | 0 .../devices/Valve Jupiter/001-hardwareinit | 11 ++ packages/jelos/autostart/001-setup | 8 + packages/jelos/sources/scripts/jelos-info | 18 +++ packages/jelos/sources/scripts/setsuspendmode | 10 ++ packages/sysutils/sleep/sources/sleep.sh | 2 +- packages/ui/emulationstation/package.mk | 2 +- 31 files changed, 192 insertions(+), 277 deletions(-) create mode 100755 packages/hardware/quirks/devices/ATARI VCS 800 Onyx/001-hardwareinit create mode 100755 packages/hardware/quirks/devices/AYANEO AIR/001-hardwareinit create mode 120000 packages/hardware/quirks/devices/Anbernic RG353M delete mode 100755 packages/hardware/quirks/devices/Anbernic RG353M/001-deviceconfig delete mode 100755 packages/hardware/quirks/devices/Anbernic RG353M/001-hardwareinit delete mode 100755 packages/hardware/quirks/devices/Anbernic RG353M/003-audio delete mode 100755 packages/hardware/quirks/devices/Anbernic RG353M/004-display create mode 100755 packages/hardware/quirks/devices/Anbernic RG353P/info.d/001-panel create mode 100755 packages/hardware/quirks/devices/Anbernic RG353V/info.d/001-panel create mode 100755 packages/hardware/quirks/devices/GPD G1619-04/001-hardwareinit rename packages/hardware/quirks/devices/Powkiddy x55/{sleep => sleep.d}/README (100%) rename packages/hardware/quirks/devices/Powkiddy x55/{sleep => sleep.d}/post/001-audio (100%) create mode 100755 packages/hardware/quirks/devices/Valve Jupiter/001-hardwareinit create mode 100755 packages/jelos/sources/scripts/setsuspendmode diff --git a/packages/hardware/quirks/devices/ATARI VCS 800 Onyx/001-hardwareinit b/packages/hardware/quirks/devices/ATARI VCS 800 Onyx/001-hardwareinit new file mode 100755 index 000000000..10dfc078b --- /dev/null +++ b/packages/hardware/quirks/devices/ATARI VCS 800 Onyx/001-hardwareinit @@ -0,0 +1,11 @@ +#!/bin/bash +# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius) + +. /etc/profile + +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode mem +fi diff --git a/packages/hardware/quirks/devices/AYANEO AIR Plus/001-hardwareinit b/packages/hardware/quirks/devices/AYANEO AIR Plus/001-hardwareinit index f61695981..10dfc078b 100755 --- a/packages/hardware/quirks/devices/AYANEO AIR Plus/001-hardwareinit +++ b/packages/hardware/quirks/devices/AYANEO AIR Plus/001-hardwareinit @@ -4,9 +4,8 @@ . /etc/profile -# S3 sleep does not work on this device yet. -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode mem +fi diff --git a/packages/hardware/quirks/devices/AYANEO AIR/001-hardwareinit b/packages/hardware/quirks/devices/AYANEO AIR/001-hardwareinit new file mode 100755 index 000000000..10dfc078b --- /dev/null +++ b/packages/hardware/quirks/devices/AYANEO AIR/001-hardwareinit @@ -0,0 +1,11 @@ +#!/bin/bash +# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius) + +. /etc/profile + +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode mem +fi diff --git a/packages/hardware/quirks/devices/Anbernic RG351M/001-hardwareinit b/packages/hardware/quirks/devices/Anbernic RG351M/001-hardwareinit index 29d093314..ff69e640c 100755 --- a/packages/hardware/quirks/devices/Anbernic RG351M/001-hardwareinit +++ b/packages/hardware/quirks/devices/Anbernic RG351M/001-hardwareinit @@ -4,8 +4,8 @@ . /etc/profile -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode freeze +fi diff --git a/packages/hardware/quirks/devices/Anbernic RG353M b/packages/hardware/quirks/devices/Anbernic RG353M new file mode 120000 index 000000000..58afc9983 --- /dev/null +++ b/packages/hardware/quirks/devices/Anbernic RG353M @@ -0,0 +1 @@ +Anbernic RG353P \ No newline at end of file diff --git a/packages/hardware/quirks/devices/Anbernic RG353M/001-deviceconfig b/packages/hardware/quirks/devices/Anbernic RG353M/001-deviceconfig deleted file mode 100755 index 3bf2a1056..000000000 --- a/packages/hardware/quirks/devices/Anbernic RG353M/001-deviceconfig +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: Apache-2.0 -# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius) - -cat </storage/.config/profile.d/001-deviceconfig -# Device Features -DEVICE_HAS_FAN=false -DEVICE_FAKE_JACKSENSE=false -DEVICE_VOLUMECTL=true -DEVICE_POWER_LED=false -DEVICE_AUDIO_MIXER="Master" -DEVICE_PLAYBACK_PATH_SPK="SPK" -DEVICE_PLAYBACK_PATH_HP="HP" -#DEVICE_HEADPHONE_DEV="" -DEVICE_BRIGHTNESS="128" -UI_SERVICE="emustation.service" - -# Kernel Modules -DEVICE_INTERNAL_WIFI=true -DEVICE_WIFI_MODULE="8821cs" - -# GPIOS -DEVICE_WIFI="0" -#DEVICE_LED="" -DEVICE_PWM_MOTOR="pwmchip1" -#DEVICE_PWM_FAN="" -#DEVICE_JACK="" - -# FREQ governors -CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0") -GPU_FREQ="/sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu" -DMC_FREQ="/sys/devices/platform/dmc/devfreq/dmc" - -# Volume Keys -DEVICE_KEY_VOLUMEDOWN=114 -DEVICE_KEY_VOLUMEUP=115 -DEVICE_VOL_MODIFIER="BTN_MODE" -EOF diff --git a/packages/hardware/quirks/devices/Anbernic RG353M/001-hardwareinit b/packages/hardware/quirks/devices/Anbernic RG353M/001-hardwareinit deleted file mode 100755 index 9acb074ca..000000000 --- a/packages/hardware/quirks/devices/Anbernic RG353M/001-hardwareinit +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: Apache-2.0 -# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius) - -. /etc/profile - -# Enable PWM for rumble and turn rumble off during startup. -echo 0 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/export -echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/period -echo 1 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/enable -echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/duty_cycle - -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF diff --git a/packages/hardware/quirks/devices/Anbernic RG353M/003-audio b/packages/hardware/quirks/devices/Anbernic RG353M/003-audio deleted file mode 100755 index f253c3337..000000000 --- a/packages/hardware/quirks/devices/Anbernic RG353M/003-audio +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: Apache-2.0 -# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius) - -. /etc/profile - -### Set a custom device so we don't clobber it. -set-audio set "CUSTOM (UNMANAGED)" -set-audio esset "Master" - -cat </storage/.config/asound.conf -pcm.!default { - type plug - slave.pcm "softvol" -} - -ctl.!default { - type hw - card 0 -} - -pcm.ddmix { - ipc_key 1024 - type dmix - slave { - pcm "hw:0,0" - period_time 0 - period_size 1024 - buffer_size 4096 - rate 44100 - } -} - -pcm.softvol { - type softvol - slave { - pcm "ddmix" - } - control { - name "Master" - card 0 - } -} -EOF - -if [ ! -e "/storage/.config/asound.state" ] -then - cat </storage/.config/asound.state -state.rockchiprk817co { - control.1 { - iface MIXER - name 'Playback Path' - value HP - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 OFF - item.1 RCV - item.2 SPK - item.3 HP - item.4 HP_NO_MIC - item.5 BT - item.6 SPK_HP - item.7 RING_SPK - item.8 RING_HP - item.9 RING_HP_NO_MIC - item.10 RING_SPK_HP - } - } - control.2 { - iface MIXER - name 'Capture MIC Path' - value 'MIC OFF' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'MIC OFF' - item.1 'Main Mic' - item.2 'Hands Free Mic' - item.3 'BT Sco Mic' - } - } - control.3 { - iface MIXER - name Master - value.0 109 - value.1 109 - comment { - access 'read write user' - type INTEGER - count 2 - range '0 - 255' - tlv '0000000100000008ffffec1400000014' - dbmin -5100 - dbmax 0 - dbvalue.0 -2920 - dbvalue.1 -2920 - } - } -} -state.rockchiphdmi { - control.1 { - iface PCM - name 'Playback Channel Map' - value.0 0 - value.1 0 - value.2 0 - value.3 0 - value.4 0 - value.5 0 - value.6 0 - value.7 0 - comment { - access read - type INTEGER - count 8 - range '0 - 36' - } - } - control.2 { - iface PCM - name ELD - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read volatile' - type BYTES - count 128 - } - } - control.3 { - iface PCM - name 'AUDIO MODE' - value 0 - comment { - access 'read write volatile' - type INTEGER - count 1 - range '0 - 2' - } - } -} -EOF - alsactl restore -f /storage/.config/asound.state -fi diff --git a/packages/hardware/quirks/devices/Anbernic RG353M/004-display b/packages/hardware/quirks/devices/Anbernic RG353M/004-display deleted file mode 100755 index c9dcc2f8a..000000000 --- a/packages/hardware/quirks/devices/Anbernic RG353M/004-display +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: Apache-2.0 -# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius) - -. /etc/profile - -# Configure default contrast saturation and hue values -for PROPERTY in brightness contrast saturation hue -do - MYVAL=$(get_setting display.${PROPERTY}) - if [ -z "${MYVAL}" ] - then - MYVAL=$(drm_tool list | sed -n '/Connector: 133/,$p' | awk '/'${PROPERTY}'/ {print $5}') - fi - paneladj ${PROPERTY} ${MYVAL} -done diff --git a/packages/hardware/quirks/devices/Anbernic RG353P/001-hardwareinit b/packages/hardware/quirks/devices/Anbernic RG353P/001-hardwareinit index 9acb074ca..4e3778c34 100755 --- a/packages/hardware/quirks/devices/Anbernic RG353P/001-hardwareinit +++ b/packages/hardware/quirks/devices/Anbernic RG353P/001-hardwareinit @@ -10,8 +10,10 @@ echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/period echo 1 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/enable echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/duty_cycle -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode freeze +fi + +echo s2idle >/sys/power/mem_sleep diff --git a/packages/hardware/quirks/devices/Anbernic RG353P/info.d/001-panel b/packages/hardware/quirks/devices/Anbernic RG353P/info.d/001-panel new file mode 100755 index 000000000..16eacd8a5 --- /dev/null +++ b/packages/hardware/quirks/devices/Anbernic RG353P/info.d/001-panel @@ -0,0 +1,18 @@ +#!/bin/sh +ID=$(dmesg | grep "panel id:" | sed "s#^.*panel id: ##g") +case ${ID} in + "30 52") + ID="v1 (${ID})" + ;; + "38 21") + ID="v2 (${ID})" + ;; + *) + ID="Unknown" + ;; +esac + +if [ -n "${ID}" ] +then + echo "PANEL VERSION: ${ID}" +fi diff --git a/packages/hardware/quirks/devices/Anbernic RG353V/001-hardwareinit b/packages/hardware/quirks/devices/Anbernic RG353V/001-hardwareinit index 9acb074ca..9a0f3ec8f 100755 --- a/packages/hardware/quirks/devices/Anbernic RG353V/001-hardwareinit +++ b/packages/hardware/quirks/devices/Anbernic RG353V/001-hardwareinit @@ -10,8 +10,8 @@ echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/period echo 1 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/enable echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/duty_cycle -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode freeze +fi diff --git a/packages/hardware/quirks/devices/Anbernic RG353V/info.d/001-panel b/packages/hardware/quirks/devices/Anbernic RG353V/info.d/001-panel new file mode 100755 index 000000000..e4cf3cb55 --- /dev/null +++ b/packages/hardware/quirks/devices/Anbernic RG353V/info.d/001-panel @@ -0,0 +1,18 @@ +#!/bin/sh +ID=$(dmesg | grep "panel id:" | sed "s#^.*panel id: ##g") +case ${ID} in + "30 52") + ID="v1" + ;; + "38 21") + ID="v2" + ;; + *) + ID="Unknown" + ;; +esac + +if [ -n "${ID}" ] +then + echo "PANEL VERSION: ${ID}" +fi diff --git a/packages/hardware/quirks/devices/Anbernic RG503/001-hardwareinit b/packages/hardware/quirks/devices/Anbernic RG503/001-hardwareinit index 781debeae..387400013 100755 --- a/packages/hardware/quirks/devices/Anbernic RG503/001-hardwareinit +++ b/packages/hardware/quirks/devices/Anbernic RG503/001-hardwareinit @@ -10,8 +10,10 @@ echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/period echo 1 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/enable echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/duty_cycle -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode freeze +fi + +echo s2idle >/sys/power/mem_sleep diff --git a/packages/hardware/quirks/devices/GPD G1619-04/001-hardwareinit b/packages/hardware/quirks/devices/GPD G1619-04/001-hardwareinit new file mode 100755 index 000000000..10dfc078b --- /dev/null +++ b/packages/hardware/quirks/devices/GPD G1619-04/001-hardwareinit @@ -0,0 +1,11 @@ +#!/bin/bash +# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius) + +. /etc/profile + +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode mem +fi diff --git a/packages/hardware/quirks/devices/Hardkernel ODROID-GO-Ultra/001-hardwareinit b/packages/hardware/quirks/devices/Hardkernel ODROID-GO-Ultra/001-hardwareinit index d0bc840f9..cf26ed7b3 100755 --- a/packages/hardware/quirks/devices/Hardkernel ODROID-GO-Ultra/001-hardwareinit +++ b/packages/hardware/quirks/devices/Hardkernel ODROID-GO-Ultra/001-hardwareinit @@ -8,10 +8,8 @@ echo none > /sys/class/leds/blue\:/trigger -### Sleep is currently broken, so we'll disable it. - -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=no -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode freeze +fi diff --git a/packages/hardware/quirks/devices/LENOVO 81TC/001-hardwareinit b/packages/hardware/quirks/devices/LENOVO 81TC/001-hardwareinit index 23e21e61a..7a5f68df9 100755 --- a/packages/hardware/quirks/devices/LENOVO 81TC/001-hardwareinit +++ b/packages/hardware/quirks/devices/LENOVO 81TC/001-hardwareinit @@ -9,3 +9,9 @@ then echo 19000 > /sys/class/backlight/$(brightness device)/brightness touch /storage/.quirks fi + +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode mem +fi diff --git a/packages/hardware/quirks/devices/ODROID-GO Advance Black Edition/001-hardwareinit b/packages/hardware/quirks/devices/ODROID-GO Advance Black Edition/001-hardwareinit index 29d093314..ff69e640c 100755 --- a/packages/hardware/quirks/devices/ODROID-GO Advance Black Edition/001-hardwareinit +++ b/packages/hardware/quirks/devices/ODROID-GO Advance Black Edition/001-hardwareinit @@ -4,8 +4,8 @@ . /etc/profile -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode freeze +fi diff --git a/packages/hardware/quirks/devices/ODROID-GO Advance/001-hardwareinit b/packages/hardware/quirks/devices/ODROID-GO Advance/001-hardwareinit index 29d093314..ff69e640c 100755 --- a/packages/hardware/quirks/devices/ODROID-GO Advance/001-hardwareinit +++ b/packages/hardware/quirks/devices/ODROID-GO Advance/001-hardwareinit @@ -4,8 +4,8 @@ . /etc/profile -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode freeze +fi diff --git a/packages/hardware/quirks/devices/ODROID-GO Super/001-hardwareinit b/packages/hardware/quirks/devices/ODROID-GO Super/001-hardwareinit index 29d093314..ff69e640c 100755 --- a/packages/hardware/quirks/devices/ODROID-GO Super/001-hardwareinit +++ b/packages/hardware/quirks/devices/ODROID-GO Super/001-hardwareinit @@ -4,8 +4,8 @@ . /etc/profile -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode freeze +fi diff --git a/packages/hardware/quirks/devices/Orange Pi 5/001-hardwareinit b/packages/hardware/quirks/devices/Orange Pi 5/001-hardwareinit index 73a7bd85f..5833b25cd 100644 --- a/packages/hardware/quirks/devices/Orange Pi 5/001-hardwareinit +++ b/packages/hardware/quirks/devices/Orange Pi 5/001-hardwareinit @@ -6,3 +6,9 @@ # Enable verticle USB Port echo host > /sys/kernel/debug/usb/fc000000.usb/mode + +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode mem +fi diff --git a/packages/hardware/quirks/devices/Powkiddy RK2023/001-hardwareinit b/packages/hardware/quirks/devices/Powkiddy RK2023/001-hardwareinit index 29d093314..27c4c0171 100755 --- a/packages/hardware/quirks/devices/Powkiddy RK2023/001-hardwareinit +++ b/packages/hardware/quirks/devices/Powkiddy RK2023/001-hardwareinit @@ -4,8 +4,10 @@ . /etc/profile -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode freeze +fi + +echo s2idle >/sys/power/mem_sleep diff --git a/packages/hardware/quirks/devices/Powkiddy x55/001-hardwareinit b/packages/hardware/quirks/devices/Powkiddy x55/001-hardwareinit index 29d093314..10dfc078b 100755 --- a/packages/hardware/quirks/devices/Powkiddy x55/001-hardwareinit +++ b/packages/hardware/quirks/devices/Powkiddy x55/001-hardwareinit @@ -4,8 +4,8 @@ . /etc/profile -cat </storage/.config/sleep.conf.d/sleep.conf -[Sleep] -AllowSuspend=yes -SuspendState=freeze -EOF +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode mem +fi diff --git a/packages/hardware/quirks/devices/Powkiddy x55/sleep/README b/packages/hardware/quirks/devices/Powkiddy x55/sleep.d/README similarity index 100% rename from packages/hardware/quirks/devices/Powkiddy x55/sleep/README rename to packages/hardware/quirks/devices/Powkiddy x55/sleep.d/README diff --git a/packages/hardware/quirks/devices/Powkiddy x55/sleep/post/001-audio b/packages/hardware/quirks/devices/Powkiddy x55/sleep.d/post/001-audio similarity index 100% rename from packages/hardware/quirks/devices/Powkiddy x55/sleep/post/001-audio rename to packages/hardware/quirks/devices/Powkiddy x55/sleep.d/post/001-audio diff --git a/packages/hardware/quirks/devices/Valve Jupiter/001-hardwareinit b/packages/hardware/quirks/devices/Valve Jupiter/001-hardwareinit new file mode 100755 index 000000000..10dfc078b --- /dev/null +++ b/packages/hardware/quirks/devices/Valve Jupiter/001-hardwareinit @@ -0,0 +1,11 @@ +#!/bin/bash +# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius) + +. /etc/profile + +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -z "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode mem +fi diff --git a/packages/jelos/autostart/001-setup b/packages/jelos/autostart/001-setup index b5326a75c..9630213a7 100755 --- a/packages/jelos/autostart/001-setup +++ b/packages/jelos/autostart/001-setup @@ -42,3 +42,11 @@ then set_setting system.cpugovernor schedutil fi +### Configure suspend mode. +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -n "${MYSLEEPMODE}" ] +then + /usr/bin/setsuspendmode ${MYSLEEPMODE} +else + /usr/bin/setsuspendmode mem +fi diff --git a/packages/jelos/sources/scripts/jelos-info b/packages/jelos/sources/scripts/jelos-info index e1586b756..00a859054 100755 --- a/packages/jelos/sources/scripts/jelos-info +++ b/packages/jelos/sources/scripts/jelos-info @@ -2,6 +2,22 @@ source /etc/profile +### Load quirks so we can display device specific info when it exists. +if [ -e "/sys/firmware/devicetree/base/model" ] +then + QUIRK_DEVICE=$(cat /sys/firmware/devicetree/base/model 2>/dev/null) +else + QUIRK_DEVICE="$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) $(cat /sys/class/dmi/id/product_name 2>/dev/null)" +fi +QUIRK_DEVICE="$(echo ${QUIRK_DEVICE} | sed -e "s#[/]#-#g")" + +info_quirks() { + for QUIRK in /usr/lib/autostart/quirks/"${QUIRK_DEVICE}"/info.d/${1}/* + do + "${QUIRK}" 2>/dev/null + done +} + ### short version (for osd) if test "$1" = "--short" then @@ -131,3 +147,5 @@ case ${HW_ARCH} in done ;; esac + +info_quirks diff --git a/packages/jelos/sources/scripts/setsuspendmode b/packages/jelos/sources/scripts/setsuspendmode new file mode 100755 index 000000000..f0a3d52d5 --- /dev/null +++ b/packages/jelos/sources/scripts/setsuspendmode @@ -0,0 +1,10 @@ +#!/bin/bash +. /etc/profile + +cat </storage/.config/sleep.conf.d/sleep.conf +[Sleep] +AllowSuspend=yes +SuspendState=${1} +EOF + +set_setting system.suspendmode ${1} diff --git a/packages/sysutils/sleep/sources/sleep.sh b/packages/sysutils/sleep/sources/sleep.sh index 6a694c288..d2d453133 100755 --- a/packages/sysutils/sleep/sources/sleep.sh +++ b/packages/sysutils/sleep/sources/sleep.sh @@ -95,7 +95,7 @@ modules() { } quirks() { - for QUIRK in /usr/lib/autostart/quirks/"${QUIRK_DEVICE}"/sleep/${1}/* + for QUIRK in /usr/lib/autostart/quirks/"${QUIRK_DEVICE}"/sleep.d/${1}/* do "${QUIRK}" >/dev/null 2>&1 done diff --git a/packages/ui/emulationstation/package.mk b/packages/ui/emulationstation/package.mk index 36eb53cd5..ddc3f6faa 100644 --- a/packages/ui/emulationstation/package.mk +++ b/packages/ui/emulationstation/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2020-present Fewtarius PKG_NAME="emulationstation" -PKG_VERSION="c0d963d" +PKG_VERSION="9b85d77" PKG_GIT_CLONE_BRANCH="main" PKG_REV="1" PKG_ARCH="any"