From 105a6b026756a81585ac82e1fe1b5a49cc363a97 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Tue, 13 Sep 2022 20:33:11 -0400 Subject: [PATCH] Revert. --- .../config/games/_Scan DOSBox Games.sh | 4 +- .../common/games/_Scan Build Engine Games.sh | 3 +- .../config/games/_Scan ScummVM Games.sh | 4 +- .../config/common/games/_Scan Quake Games.sh | 3 +- packages/jelos/profile.d/02-distribution | 80 ++++++++----------- packages/jelos/sources/post-update | 3 - packages/jelos/sources/scripts/backuptool | 10 +-- packages/jelos/sources/scripts/factoryreset | 2 +- .../jelos/sources/scripts/rom_system_split | 5 +- packages/jelos/sources/scripts/system-upgrade | 10 +-- .../misc/modules/sources/Remove ._ Files.sh | 4 +- 11 files changed, 53 insertions(+), 75 deletions(-) diff --git a/packages/games/emulators/dosbox-sdl2/config/games/_Scan DOSBox Games.sh b/packages/games/emulators/dosbox-sdl2/config/games/_Scan DOSBox Games.sh index be9d5e984..34e28e6b6 100644 --- a/packages/games/emulators/dosbox-sdl2/config/games/_Scan DOSBox Games.sh +++ b/packages/games/emulators/dosbox-sdl2/config/games/_Scan DOSBox Games.sh @@ -13,8 +13,6 @@ source /usr/bin/env.sh source /etc/profile rp_registerAllModules -stop_ui - joy2keyStart clear >/dev/console @@ -70,5 +68,5 @@ do done echo "Restarting EmulationStation...\n" >/dev/console echo "Restarting EmulationStation..." >> /tmp/logs/dosbox_scan.log -start_ui +systemctl restart ${UI_SERVICE} clear >/dev/console diff --git a/packages/games/emulators/raze/config/common/games/_Scan Build Engine Games.sh b/packages/games/emulators/raze/config/common/games/_Scan Build Engine Games.sh index e9997d950..71a09da89 100644 --- a/packages/games/emulators/raze/config/common/games/_Scan Build Engine Games.sh +++ b/packages/games/emulators/raze/config/common/games/_Scan Build Engine Games.sh @@ -25,7 +25,6 @@ SUPPORTED_GRP=( "PLATOONL.DAT" ) -stop_ui clear >/dev/console echo "Scanning for games..." >/dev/console find_names=() @@ -64,5 +63,5 @@ while read -r grp_file; do -- end -- EOM done <<<"${grp_files}" +systemctl restart ${UI_SERVICE} clear >/dev/console -start_ui diff --git a/packages/games/emulators/scummvmsa/config/games/_Scan ScummVM Games.sh b/packages/games/emulators/scummvmsa/config/games/_Scan ScummVM Games.sh index 5ec3d7a31..2de077969 100644 --- a/packages/games/emulators/scummvmsa/config/games/_Scan ScummVM Games.sh +++ b/packages/games/emulators/scummvmsa/config/games/_Scan ScummVM Games.sh @@ -5,11 +5,11 @@ # Copyright (C) 2020-present Fewtarius . /etc/profile -stop_ui + clear >/dev/console echo "Scanning for games..." >/dev/console bash /usr/bin/start_scummvm.sh add >/dev/console echo "Adding games..." >/dev/console bash /usr/bin/start_scummvm.sh create >/dev/console +systemctl restart ${UI_SERVICE} clear >/dev/console -start_ui diff --git a/packages/games/libretro/tyrquake/config/common/games/_Scan Quake Games.sh b/packages/games/libretro/tyrquake/config/common/games/_Scan Quake Games.sh index e3101c114..e465cfbb9 100644 --- a/packages/games/libretro/tyrquake/config/common/games/_Scan Quake Games.sh +++ b/packages/games/libretro/tyrquake/config/common/games/_Scan Quake Games.sh @@ -7,7 +7,6 @@ QUAKEPATH="/storage/roms/quake" -stop_ui clear >/dev/console echo "Scanning for games..." >/dev/console pak_files=$(find "${QUAKEPATH}" -mindepth 1 -type f -iname pak0.pak) @@ -31,5 +30,5 @@ while read -r pak_file; do -- end -- EOM done <<<"${pak_files}" -start_ui +systemctl restart ${UI_SERVICE} clear >/dev/console diff --git a/packages/jelos/profile.d/02-distribution b/packages/jelos/profile.d/02-distribution index ef647201a..c43ec2c1c 100644 --- a/packages/jelos/profile.d/02-distribution +++ b/packages/jelos/profile.d/02-distribution @@ -4,13 +4,15 @@ . /etc/os-release -export PATH="/usr/bin:/usr/local/bin:/storage/bin:${PATH}" +export PATH="$PATH:/usr/local/bin:/usr/bin:/storage/bin" export SDL_GAMECONTROLLERCONFIG_FILE="/storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt" J_DIR="/storage/.config/system" J_CONF="${J_DIR}/configs/system.cfg" ES_CONF="/storage/.emulationstation/es_settings.cfg" -JSLISTENCONF="${J_DIR}/configs/jslisten.cfg" +EE_DEVICE=${HW_DEVICE} + +JSLISTENCONF="/storage/.config/system/configs/jslisten.cfg" get_setting() { if [ ! -z "${3}" ] @@ -60,40 +62,42 @@ set_audio() { } get_es_setting() { - echo $(sed -n "s|\s*<${1} name=\"${2}\" value=\"\(.*\)\" />|\1|p" ${ES_CONF}) + echo $(sed -n "s|\s*<${1} name=\"${2}\" value=\"\(.*\)\" />|\1|p" ${ES_CONF}) } check_bios() { - PLATFORM="${1}" - CORE="${2}" - EMULATOR="${3}" - ROMNAME="${4}" - LOG="${5}" - if [[ -z "$LOG" ]]; then - LOG="/var/log/exec.log" - cat /etc/motd > "$LOG" - fi +PLATFORM="${1}" +CORE="${2}" +EMULATOR="${3}" +ROMNAME="${4}" +LOG="${5}" - MISSINGBIOS="$(batocera-systems --strictfilter ${PLATFORM})" - if [ "$?" == "2" ]; then - # formating so it looks nice :) - PLATFORMNAME="${MISSINGBIOS##*>}" # read from -P onwards - PLATFORMNAME="${PLATFORMNAME%%MISSING*}" # until a space is found - PLATFORMNAME=$(echo $PLATFORMNAME | sed -e 's/\\n//g') +if [[ -z "$LOG" ]]; then + LOG="/var/log/exec.log" + cat /etc/motd > "$LOG" +fi - if [[ -f "${LOG}" ]]; then - echo "${CORE} ${EMULATOR} ${ROMNAME}" >> $LOG - echo "${PLATFORMNAME} missing BIOS - Could not find all BIOS: " >> $LOG - echo "please make sure you copied the files into the corresponding folder " >> $LOG - echo "${MISSINGBIOS}" >> $LOG - fi - MISSINGBIOS=$(echo "$MISSINGBIOS" | sed -e 's/$/\\n/g') +MISSINGBIOS="$(batocera-systems --strictfilter ${PLATFORM})" +if [ "$?" == "2" ]; then - /usr/bin/error.sh "${PLATFORMNAME} missing BIOS" "Could not find all BIOS/files in /storage/roms, the game may not work:\n\n ${MISSINGBIOS}\n\nPlease make sure you copied the files into the corresponding folder." - error_process="$!" - pkill -P $error_process - fi +# formating so it looks nice :) +PLATFORMNAME="${MISSINGBIOS##*>}" # read from -P onwards +PLATFORMNAME="${PLATFORMNAME%%MISSING*}" # until a space is found +PLATFORMNAME=$(echo $PLATFORMNAME | sed -e 's/\\n//g') + +if [[ -f "${LOG}" ]]; then +echo "${CORE} ${EMULATOR} ${ROMNAME}" >> $LOG +echo "${PLATFORMNAME} missing BIOS - Could not find all BIOS: " >> $LOG +echo "please make sure you copied the files into the corresponding folder " >> $LOG +echo "${MISSINGBIOS}" >> $LOG +fi + MISSINGBIOS=$(echo "$MISSINGBIOS" | sed -e 's/$/\\n/g') + + /usr/bin/error.sh "${PLATFORMNAME} missing BIOS" "Could not find all BIOS/files in /storage/roms, the game may not work:\n\n ${MISSINGBIOS}\n\nPlease make sure you copied the files into the corresponding folder." + error_process="$!" + pkill -P $error_process +fi } # read config files from /storage/.config/profile.d @@ -102,21 +106,3 @@ check_bios() { . $config fi done - -stop_ui() { - if [ "${UI_SERVICE}" = "weston.service" ] - then - chvt 2 - else - systemctl stop ${UI_SERVICE} - fi -} - -start_ui() { - if [ "${UI_SERVICE}" = "weston.service" ] - then - chvt 1 - else - systemctl start ${UI_SERVICE} - fi -} diff --git a/packages/jelos/sources/post-update b/packages/jelos/sources/post-update index cd5720139..454313153 100644 --- a/packages/jelos/sources/post-update +++ b/packages/jelos/sources/post-update @@ -69,9 +69,6 @@ done ### Safe to make changes below this line. -# Default modules need to be updated to use the new stop/start ui function. -rsync -av /usr/config/modules/*sh /storage/.config/modules/ - # Swap es_input back to a writeable file so external controller configuration works properly. if [ -L "/storage/.config/emulationstation/es_input.cfg" ] then diff --git a/packages/jelos/sources/scripts/backuptool b/packages/jelos/sources/scripts/backuptool index a6c66b6bb..6da06f2c7 100755 --- a/packages/jelos/sources/scripts/backuptool +++ b/packages/jelos/sources/scripts/backuptool @@ -4,8 +4,6 @@ # Copyright (C) 2020-present Shanti Gilbert (https://github.com/shantigilbert) # Copyright (C) 2020 Fewtarius (https://github.com/fewtarius) -. /etc/profile - # NOTE: to customize your backups, create a backuptool.conf file in # /storage/.config like this: @@ -51,9 +49,9 @@ fi case "${1}" in "restore") - stop_ui + systemctl stop ${UI_SERVICE} unzip -o ${BACKUPFILE} -d / - start_ui + systemctl start ${UI_SERVICE} ;; "backup") if [ -f ${BACKUPFILE} ] @@ -63,9 +61,9 @@ case "${1}" in mv ${BACKUPFILE} "${BACKUPFOLDER}/${ARCHIVEFILENAME}" fi [ -f "${BACKUPFILE}" ] && rm "${BACKUPFILE}" - [ -z "$2" ] && stop_ui + [ -z "$2" ] && systemctl stop ${UI_SERVICE} zip -9 -r ${BACKUPFILE} \ ${COMPRESSLOCATIONS[@]} - [ -z "${2}" ] && start_ui + [ -z "${2}" ] && systemctl start ${UI_SERVICE} ;; esac diff --git a/packages/jelos/sources/scripts/factoryreset b/packages/jelos/sources/scripts/factoryreset index 8b6bc3845..426926ee8 100755 --- a/packages/jelos/sources/scripts/factoryreset +++ b/packages/jelos/sources/scripts/factoryreset @@ -10,7 +10,7 @@ case "${1}" in cp -rf /usr/config/retroarch/retroarch.cfg /storage/.config/retroarch/retroarch.cfg ;; "ALL") - stop_ui + systemctl stop ${UI_SERVICE} cd / find /storage -mindepth 1 \( ! -regex '^/storage/.update.*' -a ! -regex '^/storage/roms.*' \) -delete mkdir /storage/.config/ diff --git a/packages/jelos/sources/scripts/rom_system_split b/packages/jelos/sources/scripts/rom_system_split index 975c246ec..17dfe0d8a 100755 --- a/packages/jelos/sources/scripts/rom_system_split +++ b/packages/jelos/sources/scripts/rom_system_split @@ -68,11 +68,12 @@ update_es_folders() { fi done } -stop_ui +systemctl stop ${UI_SERVICE} # check the external folders first update_es_folders "external" "${EXT_ROM_FOLDERS}" "${ES_LIST}" # next check the local folders # if there are duplicate folders in EXTERNAL, LOCAL ones will take preference update_es_folders "local" "${LOCAL_ROM_FOLDERS}" "${ES_LIST}" -start_ui + +systemctl start ${UI_SERVICE} diff --git a/packages/jelos/sources/scripts/system-upgrade b/packages/jelos/sources/scripts/system-upgrade index af8c3020b..6d4ed26ad 100755 --- a/packages/jelos/sources/scripts/system-upgrade +++ b/packages/jelos/sources/scripts/system-upgrade @@ -48,12 +48,12 @@ check_space() { NEEDED=$(( (${REQUIRED} - ${MYSIZE} ) / 1024 )) echo -e "There is not enough free space available ${VOLNAME} to install this update. Free up an additional ${NEEDED}MB, or reflash the newer version." >/dev/console echo "Exiting in 5 seconds..." >/dev/console && sleep 5 - start_ui + systemctl start ${UI_SERVICE} & exit 1 fi } -stop_ui +systemctl stop ${UI_SERVICE} clear >/dev/console ONLINE_STATUS=$(check_network) @@ -61,7 +61,7 @@ if [ ! "${ONLINE_STATUS}" == true ] then echo "System not online, cannot continue..." >/dev/console echo "Exiting in 5 seconds..." >/dev/console && sleep 5 - start_ui + systemctl start ${UI_SERVICE} & exit 0 fi @@ -78,7 +78,7 @@ if [ "${OS_VERSION}" -ge "${LATEST_RELEASE_TAG}" ] && [ ! "${FORCE}" = "1" ] then echo "No new updates are available..." >/dev/console echo "Exiting in 5 seconds..." >/dev/console && sleep 5 - start_ui + systemctl start ${UI_SERVICE} & exit 0 fi @@ -98,7 +98,7 @@ then rm -f ${UPDATE_PATH}/* sleep 5 clear >/dev/console - start_ui + systemctl start ${UI_SERVICE} exit 1 else echo "Verification successful..." >/dev/console diff --git a/packages/misc/modules/sources/Remove ._ Files.sh b/packages/misc/modules/sources/Remove ._ Files.sh index 6d750a23b..55071191b 100755 --- a/packages/misc/modules/sources/Remove ._ Files.sh +++ b/packages/misc/modules/sources/Remove ._ Files.sh @@ -7,8 +7,8 @@ . /etc/profile source /usr/bin/env.sh clear >/dev/console -stop_ui +systemctl stop ${UI_SERVICE} echo "Cleaning ._ files from /storage/roms" >/dev/console find /storage/roms -iname '._*' -exec rm -rf {} \; clear >/dev/console -start_ui +systemctl start ${UI_SERVICE}