commit
d6c14f3b38
24 changed files with 166 additions and 58 deletions
0
packages/hardware/quirks/platforms/RK3326/010-governors
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3326/010-governors
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3326/050-audio_path
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3326/050-audio_path
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3326/050-modifiers
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3326/050-modifiers
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3326/060-game_settings
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3326/060-game_settings
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3326/090-ui_service
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3326/090-ui_service
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3399/040-affinity
Normal file → Executable file
0
packages/hardware/quirks/platforms/RK3399/040-affinity
Normal file → Executable file
|
@ -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}"
|
|
@ -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
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
# Minimal OS variable loading for performance
|
||||
. /etc/profile.d/001-functions
|
||||
. /etc/profile.d/030-powerfunctions
|
||||
. /etc/profile.d/099-freqfunctions
|
||||
|
||||
tocon "Setting performance mode..."
|
||||
|
|
|
@ -176,6 +176,7 @@ system.hostname=@DEVICENAME@
|
|||
system.language=en_US
|
||||
system.loglevel=none
|
||||
system.power.audio=1
|
||||
system.merged.storage=0
|
||||
system.power.cpu=1
|
||||
system.power.pcie=0
|
||||
system.power.rtpm=0
|
||||
|
|
|
@ -69,7 +69,6 @@ EOF
|
|||
|
||||
cp ${PKG_DIR}/sources/scripts/* ${INSTALL}/usr/bin
|
||||
chmod 0755 ${INSTALL}/usr/bin/* 2>/dev/null ||:
|
||||
enable_service jelos-automount.service
|
||||
|
||||
### Fix and migrate to autostart package
|
||||
enable_service jelos-autostart.service
|
||||
|
|
|
@ -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)
|
||||
|
@ -111,6 +125,13 @@ do
|
|||
rm -rf ${FILE} 2>/dev/null
|
||||
done
|
||||
|
||||
### 20231203 - Disable merged storage by default.
|
||||
MERGED_STORAGE=$(get_setting system.merged.storage)
|
||||
if [ -z "${MERGED_STORAGE}" ]
|
||||
then
|
||||
set_setting system.merged.storage 0
|
||||
fi
|
||||
|
||||
### Items below this line should not be removed.
|
||||
tocon "Update complete, rebooting..."
|
||||
reboot
|
||||
|
|
|
@ -5,29 +5,56 @@
|
|||
. /etc/profile
|
||||
. /etc/os-release
|
||||
|
||||
### Vars
|
||||
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"
|
||||
MS_ENABLED=$(get_setting system.merged.storage)
|
||||
MS_DEVICE=$(get_setting system.merged.device)
|
||||
|
||||
start_overlay() {
|
||||
if [ -e "/storage/.overlay_unsupported" ]
|
||||
### Default to the external storage device.
|
||||
MOUNT_PATH="/storage/games-external"
|
||||
|
||||
MS_PATH="/storage/roms"
|
||||
|
||||
function unmount() {
|
||||
log $0 "Unmount ${1}."
|
||||
umount -f "${1}" 2>/dev/null ||:
|
||||
}
|
||||
|
||||
function start_ms() {
|
||||
### Entrypoint will be either games card found (external), or not found (internal).
|
||||
MOUNT_PATH="/storage/games-${1}"
|
||||
|
||||
### Determine if internal or external is the primary target by configuration.
|
||||
case ${MS_DEVICE} in
|
||||
internal)
|
||||
LOWER="internal"
|
||||
UPPER="external"
|
||||
;;
|
||||
*)
|
||||
LOWER="external"
|
||||
UPPER="internal"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -e "/storage/.ms_unsupported" ] || \
|
||||
[ "${MS_ENABLED}" = 0 ]
|
||||
then
|
||||
# If we're not using the overlay, 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}/roms ${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 of /storage/games-${LOWER} and /storage/games-${UPPER} to ${MS_PATH}."
|
||||
|
||||
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 ${MS_PATH}
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -36,41 +63,45 @@ then
|
|||
set_setting system.automount 1
|
||||
elif [[ "${MOUNT_GAMES}" == "0" ]]
|
||||
then
|
||||
start_overlay
|
||||
start_ms internal
|
||||
exit 0
|
||||
fi
|
||||
|
||||
function create_game_dirs() {
|
||||
systemd-tmpfiles --create /usr/lib/tmpfiles.d/JELOS-system-dirs.conf >/dev/null 2>&1 ||:
|
||||
}
|
||||
|
||||
function load_modules() {
|
||||
for MODULE in exfat vfat
|
||||
do
|
||||
lsmod | grep ${MODULE} 2>/dev/null
|
||||
lsmod | grep ${MODULE} >/dev/null 2>&1
|
||||
if [ ! $? = 0 ]
|
||||
then
|
||||
log $0 "Loading ${MODULE}."
|
||||
modprobe ${MODULE} 2>/dev/null
|
||||
modprobe ${MODULE} >/dev/null 2>&1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function mount_games() {
|
||||
local MOUNT_PATH="/storage/games-external"
|
||||
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
|
||||
set_setting system.merged.storage 1
|
||||
touch /storage/.ms_supported
|
||||
;;
|
||||
*)
|
||||
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
|
||||
|
||||
|
@ -85,21 +116,28 @@ function mount_games() {
|
|||
[ -e "${1}" ] && \
|
||||
[ ! -e "/storage/.please_resize_me" ]
|
||||
then
|
||||
|
||||
### Udevil shouldn't mount it this early, but just in-case.
|
||||
umount /var/media/* 2>/dev/null
|
||||
|
||||
log $0 "Checking filesystem ${1}."
|
||||
fsck -Mly ${1} >/dev/null 2>&1
|
||||
|
||||
log $0 "Mounting ${1} on ${MOUNT_PATH}"
|
||||
/usr/bin/busybox mount ${1} ${MOUNT_PATH} >/dev/null 2>&1
|
||||
fi
|
||||
start_overlay
|
||||
start_ms external
|
||||
create_game_dirs
|
||||
exit 0
|
||||
}
|
||||
|
||||
find_games() {
|
||||
if /usr/bin/busybox mountpoint -q /storage ; then
|
||||
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
|
||||
ROOTDEV=$(echo ${DEV} | sed -e "s#^/.*/##g" -e "s#p[0-9].*\$##g")
|
||||
log $0 "Inspecting ${DEV}."
|
||||
SIZE=$(awk '/'${ROOTDEV}'$/ {print $3}' /proc/partitions)
|
||||
if (( ${SIZE} <= 8388608 ))
|
||||
then
|
||||
|
@ -113,25 +151,31 @@ find_games() {
|
|||
# Assume this is an android boot device and ignore it.
|
||||
continue
|
||||
fi
|
||||
# Udevil might mount it, and we shouldn't care if it does.
|
||||
NULL=$(cat /proc/mounts | grep -v -e "/var/media" 2>/dev/null | grep ${DEV})
|
||||
if [ ! "$?" = "0" ] && \
|
||||
[ -e "${DEV}" ] && \
|
||||
if [ -e "${DEV}" ] && \
|
||||
[ ! -e "/storage/.please_resize_me" ]
|
||||
then
|
||||
GAMES_DEVICE=${DEV}
|
||||
log $0 "Found ${DEV} available to mount."
|
||||
mount_games "${DEV}"
|
||||
break
|
||||
else
|
||||
log $0 "${DEV} not available."
|
||||
fi
|
||||
done
|
||||
# If we're here there is no external storage to use, but we want to start the overlay anyway.
|
||||
start_overlay
|
||||
log $0 "Could not find external card to mount, assume internal."
|
||||
start_ms internal
|
||||
create_game_dirs
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
## Main..
|
||||
|
||||
load_modules
|
||||
|
||||
### Unmount any existing storage before beginning operations.
|
||||
unmount /storage/games-external
|
||||
unmount /storage/roms
|
||||
|
||||
if [ -e "${GAMES_DEVICE}" ]
|
||||
then
|
||||
mount_games ${GAMES_DEVICE}
|
||||
|
|
11
packages/jelos/sources/scripts/cleanup_overlay
Executable file
11
packages/jelos/sources/scripts/cleanup_overlay
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
. /etc/profile
|
||||
|
||||
for STORAGE in /storage/games-internal /storage/games-external
|
||||
do
|
||||
find ${STORAGE} -type d -empty -delete
|
||||
done
|
||||
reboot
|
0
packages/jelos/sources/scripts/led_flash
Normal file → Executable file
0
packages/jelos/sources/scripts/led_flash
Normal file → Executable file
0
packages/jelos/sources/scripts/runemu.sh
Normal file → Executable file
0
packages/jelos/sources/scripts/runemu.sh
Normal file → Executable file
0
packages/jelos/sources/scripts/volume
Normal file → Executable file
0
packages/jelos/sources/scripts/volume
Normal file → Executable file
|
@ -8,7 +8,6 @@ Type=oneshot
|
|||
Environment=HOME=/storage
|
||||
EnvironmentFile=/etc/profile
|
||||
ExecStart=/usr/bin/automount
|
||||
ExecStartPost=systemd-tmpfiles --create /usr/lib/tmpfiles.d/JELOS-system-dirs.conf
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
PKG_NAME="linux"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_VERSION="6.6.3"
|
||||
PKG_VERSION="6.6.4"
|
||||
PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||
PKG_SITE="http://www.kernel.org"
|
||||
PKG_DEPENDS_HOST="ccache:host rsync:host openssl:host rdfind:host"
|
||||
|
|
|
@ -43,6 +43,9 @@ then
|
|||
done
|
||||
fi
|
||||
|
||||
### Start the automount service
|
||||
systemctl start jelos-automount
|
||||
|
||||
### Run common start scripts
|
||||
for script in /usr/lib/autostart/common/*
|
||||
do
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
PKG_NAME="emulationstation"
|
||||
PKG_VERSION="ac666f2"
|
||||
PKG_VERSION="adc7cb5"
|
||||
PKG_GIT_CLONE_BRANCH="main"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue