diff --git a/packages/hardware/quirks/platforms/RK3326/010-governors b/packages/hardware/quirks/platforms/RK3326/010-governors old mode 100644 new mode 100755 diff --git a/packages/hardware/quirks/platforms/RK3326/050-audio_path b/packages/hardware/quirks/platforms/RK3326/050-audio_path old mode 100644 new mode 100755 diff --git a/packages/hardware/quirks/platforms/RK3326/050-modifiers b/packages/hardware/quirks/platforms/RK3326/050-modifiers old mode 100644 new mode 100755 diff --git a/packages/hardware/quirks/platforms/RK3326/060-game_settings b/packages/hardware/quirks/platforms/RK3326/060-game_settings old mode 100644 new mode 100755 diff --git a/packages/hardware/quirks/platforms/RK3326/090-ui_service b/packages/hardware/quirks/platforms/RK3326/090-ui_service old mode 100644 new mode 100755 diff --git a/packages/hardware/quirks/platforms/RK3399/040-affinity b/packages/hardware/quirks/platforms/RK3399/040-affinity old mode 100644 new mode 100755 diff --git a/packages/hardware/quirks/platforms/RK3566/sleep.d/post/002-freq b/packages/hardware/quirks/platforms/RK3566/sleep.d/post/002-freq new file mode 100644 index 000000000..d5c06cc41 --- /dev/null +++ b/packages/hardware/quirks/platforms/RK3566/sleep.d/post/002-freq @@ -0,0 +1,23 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS) + +### Restore previous governors before going to sleep + +. /etc/profile + +### Grab the old governors. +OLD_CPU_FREQ=$(get_setting "sleep.cpugovernor") +if [ ! -n "${OLD_CPU_FREQ}" ]; then + OLD_CPU_FREQ="schedutil" +fi + +OLD_GPU_FREQ=$(get_setting "sleep.gpugovernor") +if [ ! -n "${OLD_GPU_FREQ}" ]; then + OLD_GPU_FREQ="simple_ondemand" +fi + +# Restore old governors. +set_cpu_gov "${OLD_CPU_FREQ}" +set_dmc_gov "${OLD_CPU_FREQ}" +set_gpu_gov "${OLD_GPU_FREQ}" diff --git a/packages/hardware/quirks/platforms/RK3566/sleep.d/pre/002-freq b/packages/hardware/quirks/platforms/RK3566/sleep.d/pre/002-freq new file mode 100644 index 000000000..4fbe8c64f --- /dev/null +++ b/packages/hardware/quirks/platforms/RK3566/sleep.d/pre/002-freq @@ -0,0 +1,19 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS) + +# Store current freq governors and set governors to powersave. + +. /etc/profile + +### Get the current cpu and gpu governor, save for when the device wakes from sleep. +CUR_CPU_FREQ="$(cat ${CPU_FREQ}/scaling_governor)" +CUR_GPU_FREQ="$(cat ${GPU_FREQ}/governor)" + +set_setting sleep.cpugovernor "${CUR_CPU_FREQ}" +set_setting sleep.gpugovernor "${CUR_GPU_FREQ}" + +### Set all governors to powersave +set_cpu_gov powersave +set_dmc_gov powersave +set_gpu_gov powersave diff --git a/packages/jelos/sources/post-update b/packages/jelos/sources/post-update index a0ba48874..ab676e199 100644 --- a/packages/jelos/sources/post-update +++ b/packages/jelos/sources/post-update @@ -73,8 +73,12 @@ sed -i 's~"pulse"~"alsathread"~g' /storage/.config/retroarch/retroarch.cfg ### 20231114 - Update hosts.conf grep "127.0.0.1" /storage/.config/hosts.conf >/dev/null 2>&1 || cp /usr/config/hosts.conf /storage/.config/ -### 20231127 - Migrate games to overlayfs -systemctl stop storage-roms.mount +### 20231127 - Migrate games to overlayfs (updated 20231203) +NULL=$(cat /proc/mounts | grep -v -e "/storage/roms" 2>/dev/null | grep ${1}) +if [ ! "$?" = 0 ] +then + umount /storage/roms +fi GAMECOUNT=$(find /storage/roms -type f | wc -l) if [ "${GAMECOUNT}" -gt 20 ] && \ [ ! -e "/storage/.migrated_games" ] @@ -91,7 +95,17 @@ then else echo "Game weight too low (${GAMECOUNT}) or content already migrated." >>${LOG} fi -systemctl start storage-roms.mount + +### Migration part 2 +for GAMES in /storage/games-internal /storage/games-external +do + if [ ! -d "${GAMES}/roms" ] + then + mkdir -p "${GAMES}/roms" + mv "${GAMES}/"* "${GAMES}/roms/" + fi +done +systemctl restart jelos-automount ### 20231129 - Don't default to performance. EPP=$(get_setting system.power.epp) diff --git a/packages/jelos/sources/scripts/automount b/packages/jelos/sources/scripts/automount index 8f9837492..f833dd2f5 100755 --- a/packages/jelos/sources/scripts/automount +++ b/packages/jelos/sources/scripts/automount @@ -8,26 +8,51 @@ UPDATE_ROOT="/storage/.update" MOUNT_GAMES=$(get_setting system.automount) GAMES_DEVICE=$(get_setting system.gamesdevice) -MOUNT_PATH="/storage/games-external" -OVERLAY_PATH="/storage/roms" -start_overlay() { - if [ -e "/storage/.overlay_unsupported" ] +MS_ENABLED=$(get_setting system.merged.storage) +MS_DEVICE=$(get_setting system.merged.device) +MS_PATH="/storage/roms" +if [ -z "${MS_DEVICE}" ] +then + MS_DEVICE="external" +fi +MOUNT_PATH="/storage/games-${MS_DEVICE}" + +function start_ms() { + if [ -e "/storage/.ms_unsupported" ] || \ + [ "${MS_ENABLED}" = "false" ] then - # If we're not using the overlay, bind mount the external storage path + # If we're not using merged storage, bind mount the external storage path # so we don't need to change any configs. grep ${MOUNT_PATH} /proc/mounts >/dev/null 2>&1 if [ ! $? = 0 ] then MOUNT_PATH="/storage/games-internal" fi - log $0 "Executing bind mount of ${MOUNT_PATH} to ${OVERLAY_PATH}" - mount --bind ${MOUNT_PATH} ${OVERLAY_PATH} + log $0 "Executing bind mount of ${MOUNT_PATH} to ${MS_PATH}" + mount --bind ${MOUNT_PATH} ${MS_PATH} exit 0 else - log $0 "Enabling overlay." - systemctl enable storage-roms.mount >/dev/null 2>&1 - systemctl start storage-roms.mount >/dev/null 2>&1 + log $0 "Enabling merged storage." + + case ${MS_DEVICE} in + internal) + LOWER="internal" + UPPER="external" + ;; + *) + LOWER="external" + UPPER="internal" + ;; + esac + for DIR in /storage/games-${UPPER}/.tmp/games-workdir /storage/games-${LOWER}/roms /storage/games-${UPPER}/roms + do + if [ ! -d "${DIR}" ] + then + mkdir -p "${DIR}" + fi + done + mount overlay -t overlay -o lowerdir=/storage/games-${LOWER}/roms,upperdir=/storage/games-${UPPER}/roms,workdir=/storage/games-${UPPER}/.tmp/games-workdir /storage/roms fi } @@ -36,10 +61,18 @@ then set_setting system.automount 1 elif [[ "${MOUNT_GAMES}" == "0" ]] then - start_overlay + start_ms exit 0 fi +function unmount_roms() { + NULL=$(cat /proc/mounts | grep -v -e "${MS_PATH}" 2>/dev/null | grep ${1}) + if [ ! "$?" = "0" ] + then + umount -f "${MS_PATH}" + fi +} + function load_modules() { for MODULE in exfat vfat do @@ -53,24 +86,25 @@ function load_modules() { } function mount_games() { + unmount_roms FSTYPE=$(blkid -o export ${1} | awk 'BEGIN {FS="="} /TYPE/ {print $2}') case ${FSTYPE} in ext4) log $0 "Found supported partition for overlayfs." - if [ -e "/storage/.overlay_unsupported" ] + if [ -e "/storage/.ms_unsupported" ] then - rm -f /storage/.overlay_unsupported + rm -f /storage/.ms_unsupported fi - touch /storage/.overlay_supported + touch /storage/.ms_supported set_setting system.merged.storage 1 ;; *) log $0 "Partition does not support overlayfs, disabling." - if [ -e "/storage/.overlay_supported" ] + if [ -e "/storage/.ms_supported" ] then - rm -f /storage/.overlay_supported + rm -f /storage/.ms_supported fi - touch /storage/.overlay_unsupported + touch /storage/.ms_unsupported ;; esac @@ -92,10 +126,11 @@ function mount_games() { log $0 "Mounting ${1} on ${MOUNT_PATH}" /usr/bin/busybox mount ${1} ${MOUNT_PATH} >/dev/null 2>&1 fi - start_overlay + start_ms + exit 0 } -find_games() { +function find_games() { if /usr/bin/busybox mountpoint -q /storage ; then for DEV in $(for dev in mmcblk[0-9] sd[a-z] nvme[0-9]; do blkid | grep ${dev} | awk 'BEGIN {FS=":"}; /ext4/ || /fat/ {print $1}' | sort -r; done) do @@ -125,8 +160,8 @@ find_games() { break fi done - # If we're here there is no external storage to use, but we want to start the overlay anyway. - start_overlay + # If we're here there is no external storage to use, but we want to start merged storage or the bind mount anyway. + start_ms fi } diff --git a/packages/jelos/sources/scripts/led_flash b/packages/jelos/sources/scripts/led_flash old mode 100644 new mode 100755 diff --git a/packages/jelos/sources/scripts/runemu.sh b/packages/jelos/sources/scripts/runemu.sh old mode 100644 new mode 100755 diff --git a/packages/jelos/sources/scripts/volume b/packages/jelos/sources/scripts/volume old mode 100644 new mode 100755 diff --git a/packages/ui/emulationstation/package.mk b/packages/ui/emulationstation/package.mk index 3b5316a08..e09b16d77 100644 --- a/packages/ui/emulationstation/package.mk +++ b/packages/ui/emulationstation/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS) PKG_NAME="emulationstation" -PKG_VERSION="ac666f2" +PKG_VERSION="a70b20b" PKG_GIT_CLONE_BRANCH="main" PKG_REV="1" PKG_ARCH="any" diff --git a/packages/virtual/emulators/system.d/storage-roms.mount b/packages/virtual/emulators/system.d/storage-roms.mount deleted file mode 100644 index e93769cbf..000000000 --- a/packages/virtual/emulators/system.d/storage-roms.mount +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Overlays directory -After=systemd-tmpfiles-setup.service -DefaultDependencies=no - -[Mount] -What=none -Where=/storage/roms -Type=overlay -Options=lowerdir=/storage/games-external,upperdir=/storage/games-internal,workdir=/storage/.tmp/games-workdir - -[Install] -WantedBy=jelos.target diff --git a/packages/virtual/emulators/udev.d/99-automount.rules b/packages/virtual/emulators/udev.d/99-automount.rules index ca3eba055..ba601f767 100644 --- a/packages/virtual/emulators/udev.d/99-automount.rules +++ b/packages/virtual/emulators/udev.d/99-automount.rules @@ -14,7 +14,7 @@ GOTO="exit" # mount or umount for hdds LABEL="harddisk" -ACTION=="add", PROGRAM="/usr/bin/sh -c '/usr/bin/grep -E ^/dev/%k\ /proc/mounts || true'", RESULT=="", RUN+="/usr/bin/systemctl stop storage-roms.mount", RUN+="/usr/bin/systemctl restart jelos-automount.service" +ACTION=="add", PROGRAM="/usr/bin/sh -c '/usr/bin/grep -E ^/dev/%k\ /proc/mounts || true'", RESULT=="", RUN+="/usr/bin/systemctl restart jelos-automount.service" GOTO="exit" # Exit