commit
6808b55307
11 changed files with 53 additions and 75 deletions
|
@ -13,8 +13,6 @@ source /usr/bin/env.sh
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
rp_registerAllModules
|
rp_registerAllModules
|
||||||
|
|
||||||
stop_ui
|
|
||||||
|
|
||||||
joy2keyStart
|
joy2keyStart
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
|
|
||||||
|
@ -70,5 +68,5 @@ do
|
||||||
done
|
done
|
||||||
echo "Restarting EmulationStation...\n" >/dev/console
|
echo "Restarting EmulationStation...\n" >/dev/console
|
||||||
echo "Restarting EmulationStation..." >> /tmp/logs/dosbox_scan.log
|
echo "Restarting EmulationStation..." >> /tmp/logs/dosbox_scan.log
|
||||||
start_ui
|
systemctl restart ${UI_SERVICE}
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
|
|
|
@ -25,7 +25,6 @@ SUPPORTED_GRP=(
|
||||||
"PLATOONL.DAT"
|
"PLATOONL.DAT"
|
||||||
)
|
)
|
||||||
|
|
||||||
stop_ui
|
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
echo "Scanning for games..." >/dev/console
|
echo "Scanning for games..." >/dev/console
|
||||||
find_names=()
|
find_names=()
|
||||||
|
@ -64,5 +63,5 @@ while read -r grp_file; do
|
||||||
-- end --
|
-- end --
|
||||||
EOM
|
EOM
|
||||||
done <<<"${grp_files}"
|
done <<<"${grp_files}"
|
||||||
|
systemctl restart ${UI_SERVICE}
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
start_ui
|
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
# Copyright (C) 2020-present Fewtarius
|
# Copyright (C) 2020-present Fewtarius
|
||||||
|
|
||||||
. /etc/profile
|
. /etc/profile
|
||||||
stop_ui
|
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
echo "Scanning for games..." >/dev/console
|
echo "Scanning for games..." >/dev/console
|
||||||
bash /usr/bin/start_scummvm.sh add >/dev/console
|
bash /usr/bin/start_scummvm.sh add >/dev/console
|
||||||
echo "Adding games..." >/dev/console
|
echo "Adding games..." >/dev/console
|
||||||
bash /usr/bin/start_scummvm.sh create >/dev/console
|
bash /usr/bin/start_scummvm.sh create >/dev/console
|
||||||
|
systemctl restart ${UI_SERVICE}
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
start_ui
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
QUAKEPATH="/storage/roms/quake"
|
QUAKEPATH="/storage/roms/quake"
|
||||||
|
|
||||||
stop_ui
|
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
echo "Scanning for games..." >/dev/console
|
echo "Scanning for games..." >/dev/console
|
||||||
pak_files=$(find "${QUAKEPATH}" -mindepth 1 -type f -iname pak0.pak)
|
pak_files=$(find "${QUAKEPATH}" -mindepth 1 -type f -iname pak0.pak)
|
||||||
|
@ -31,5 +30,5 @@ while read -r pak_file; do
|
||||||
-- end --
|
-- end --
|
||||||
EOM
|
EOM
|
||||||
done <<<"${pak_files}"
|
done <<<"${pak_files}"
|
||||||
start_ui
|
systemctl restart ${UI_SERVICE}
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
|
|
|
@ -4,13 +4,15 @@
|
||||||
|
|
||||||
. /etc/os-release
|
. /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"
|
export SDL_GAMECONTROLLERCONFIG_FILE="/storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt"
|
||||||
|
|
||||||
J_DIR="/storage/.config/system"
|
J_DIR="/storage/.config/system"
|
||||||
J_CONF="${J_DIR}/configs/system.cfg"
|
J_CONF="${J_DIR}/configs/system.cfg"
|
||||||
ES_CONF="/storage/.emulationstation/es_settings.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() {
|
get_setting() {
|
||||||
if [ ! -z "${3}" ]
|
if [ ! -z "${3}" ]
|
||||||
|
@ -60,40 +62,42 @@ set_audio() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_es_setting() {
|
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() {
|
check_bios() {
|
||||||
PLATFORM="${1}"
|
|
||||||
CORE="${2}"
|
|
||||||
EMULATOR="${3}"
|
|
||||||
ROMNAME="${4}"
|
|
||||||
LOG="${5}"
|
|
||||||
|
|
||||||
if [[ -z "$LOG" ]]; then
|
PLATFORM="${1}"
|
||||||
LOG="/var/log/exec.log"
|
CORE="${2}"
|
||||||
cat /etc/motd > "$LOG"
|
EMULATOR="${3}"
|
||||||
fi
|
ROMNAME="${4}"
|
||||||
|
LOG="${5}"
|
||||||
|
|
||||||
MISSINGBIOS="$(batocera-systems --strictfilter ${PLATFORM})"
|
if [[ -z "$LOG" ]]; then
|
||||||
if [ "$?" == "2" ]; then
|
LOG="/var/log/exec.log"
|
||||||
# formating so it looks nice :)
|
cat /etc/motd > "$LOG"
|
||||||
PLATFORMNAME="${MISSINGBIOS##*>}" # read from -P onwards
|
fi
|
||||||
PLATFORMNAME="${PLATFORMNAME%%MISSING*}" # until a space is found
|
|
||||||
PLATFORMNAME=$(echo $PLATFORMNAME | sed -e 's/\\n//g')
|
|
||||||
|
|
||||||
if [[ -f "${LOG}" ]]; then
|
MISSINGBIOS="$(batocera-systems --strictfilter ${PLATFORM})"
|
||||||
echo "${CORE} ${EMULATOR} ${ROMNAME}" >> $LOG
|
if [ "$?" == "2" ]; then
|
||||||
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."
|
# formating so it looks nice :)
|
||||||
error_process="$!"
|
PLATFORMNAME="${MISSINGBIOS##*>}" # read from -P onwards
|
||||||
pkill -P $error_process
|
PLATFORMNAME="${PLATFORMNAME%%MISSING*}" # until a space is found
|
||||||
fi
|
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
|
# read config files from /storage/.config/profile.d
|
||||||
|
@ -102,21 +106,3 @@ check_bios() {
|
||||||
. $config
|
. $config
|
||||||
fi
|
fi
|
||||||
done
|
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
|
|
||||||
}
|
|
||||||
|
|
|
@ -69,9 +69,6 @@ done
|
||||||
|
|
||||||
### Safe to make changes below this line.
|
### 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.
|
# Swap es_input back to a writeable file so external controller configuration works properly.
|
||||||
if [ -L "/storage/.config/emulationstation/es_input.cfg" ]
|
if [ -L "/storage/.config/emulationstation/es_input.cfg" ]
|
||||||
then
|
then
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
# Copyright (C) 2020-present Shanti Gilbert (https://github.com/shantigilbert)
|
# Copyright (C) 2020-present Shanti Gilbert (https://github.com/shantigilbert)
|
||||||
# Copyright (C) 2020 Fewtarius (https://github.com/fewtarius)
|
# Copyright (C) 2020 Fewtarius (https://github.com/fewtarius)
|
||||||
|
|
||||||
. /etc/profile
|
|
||||||
|
|
||||||
# NOTE: to customize your backups, create a backuptool.conf file in
|
# NOTE: to customize your backups, create a backuptool.conf file in
|
||||||
# /storage/.config like this:
|
# /storage/.config like this:
|
||||||
|
|
||||||
|
@ -51,9 +49,9 @@ fi
|
||||||
|
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
"restore")
|
"restore")
|
||||||
stop_ui
|
systemctl stop ${UI_SERVICE}
|
||||||
unzip -o ${BACKUPFILE} -d /
|
unzip -o ${BACKUPFILE} -d /
|
||||||
start_ui
|
systemctl start ${UI_SERVICE}
|
||||||
;;
|
;;
|
||||||
"backup")
|
"backup")
|
||||||
if [ -f ${BACKUPFILE} ]
|
if [ -f ${BACKUPFILE} ]
|
||||||
|
@ -63,9 +61,9 @@ case "${1}" in
|
||||||
mv ${BACKUPFILE} "${BACKUPFOLDER}/${ARCHIVEFILENAME}"
|
mv ${BACKUPFILE} "${BACKUPFOLDER}/${ARCHIVEFILENAME}"
|
||||||
fi
|
fi
|
||||||
[ -f "${BACKUPFILE}" ] && rm "${BACKUPFILE}"
|
[ -f "${BACKUPFILE}" ] && rm "${BACKUPFILE}"
|
||||||
[ -z "$2" ] && stop_ui
|
[ -z "$2" ] && systemctl stop ${UI_SERVICE}
|
||||||
zip -9 -r ${BACKUPFILE} \
|
zip -9 -r ${BACKUPFILE} \
|
||||||
${COMPRESSLOCATIONS[@]}
|
${COMPRESSLOCATIONS[@]}
|
||||||
[ -z "${2}" ] && start_ui
|
[ -z "${2}" ] && systemctl start ${UI_SERVICE}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -10,7 +10,7 @@ case "${1}" in
|
||||||
cp -rf /usr/config/retroarch/retroarch.cfg /storage/.config/retroarch/retroarch.cfg
|
cp -rf /usr/config/retroarch/retroarch.cfg /storage/.config/retroarch/retroarch.cfg
|
||||||
;;
|
;;
|
||||||
"ALL")
|
"ALL")
|
||||||
stop_ui
|
systemctl stop ${UI_SERVICE}
|
||||||
cd /
|
cd /
|
||||||
find /storage -mindepth 1 \( ! -regex '^/storage/.update.*' -a ! -regex '^/storage/roms.*' \) -delete
|
find /storage -mindepth 1 \( ! -regex '^/storage/.update.*' -a ! -regex '^/storage/roms.*' \) -delete
|
||||||
mkdir /storage/.config/
|
mkdir /storage/.config/
|
||||||
|
|
|
@ -68,11 +68,12 @@ update_es_folders() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
stop_ui
|
systemctl stop ${UI_SERVICE}
|
||||||
|
|
||||||
# check the external folders first
|
# check the external folders first
|
||||||
update_es_folders "external" "${EXT_ROM_FOLDERS}" "${ES_LIST}"
|
update_es_folders "external" "${EXT_ROM_FOLDERS}" "${ES_LIST}"
|
||||||
# next check the local folders
|
# next check the local folders
|
||||||
# if there are duplicate folders in EXTERNAL, LOCAL ones will take preference
|
# if there are duplicate folders in EXTERNAL, LOCAL ones will take preference
|
||||||
update_es_folders "local" "${LOCAL_ROM_FOLDERS}" "${ES_LIST}"
|
update_es_folders "local" "${LOCAL_ROM_FOLDERS}" "${ES_LIST}"
|
||||||
start_ui
|
|
||||||
|
systemctl start ${UI_SERVICE}
|
||||||
|
|
|
@ -48,12 +48,12 @@ check_space() {
|
||||||
NEEDED=$(( (${REQUIRED} - ${MYSIZE} ) / 1024 ))
|
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 -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
|
echo "Exiting in 5 seconds..." >/dev/console && sleep 5
|
||||||
start_ui
|
systemctl start ${UI_SERVICE} &
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_ui
|
systemctl stop ${UI_SERVICE}
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
|
|
||||||
ONLINE_STATUS=$(check_network)
|
ONLINE_STATUS=$(check_network)
|
||||||
|
@ -61,7 +61,7 @@ if [ ! "${ONLINE_STATUS}" == true ]
|
||||||
then
|
then
|
||||||
echo "System not online, cannot continue..." >/dev/console
|
echo "System not online, cannot continue..." >/dev/console
|
||||||
echo "Exiting in 5 seconds..." >/dev/console && sleep 5
|
echo "Exiting in 5 seconds..." >/dev/console && sleep 5
|
||||||
start_ui
|
systemctl start ${UI_SERVICE} &
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ if [ "${OS_VERSION}" -ge "${LATEST_RELEASE_TAG}" ] && [ ! "${FORCE}" = "1" ]
|
||||||
then
|
then
|
||||||
echo "No new updates are available..." >/dev/console
|
echo "No new updates are available..." >/dev/console
|
||||||
echo "Exiting in 5 seconds..." >/dev/console && sleep 5
|
echo "Exiting in 5 seconds..." >/dev/console && sleep 5
|
||||||
start_ui
|
systemctl start ${UI_SERVICE} &
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ then
|
||||||
rm -f ${UPDATE_PATH}/*
|
rm -f ${UPDATE_PATH}/*
|
||||||
sleep 5
|
sleep 5
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
start_ui
|
systemctl start ${UI_SERVICE}
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Verification successful..." >/dev/console
|
echo "Verification successful..." >/dev/console
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
. /etc/profile
|
. /etc/profile
|
||||||
source /usr/bin/env.sh
|
source /usr/bin/env.sh
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
stop_ui
|
systemctl stop ${UI_SERVICE}
|
||||||
echo "Cleaning ._ files from /storage/roms" >/dev/console
|
echo "Cleaning ._ files from /storage/roms" >/dev/console
|
||||||
find /storage/roms -iname '._*' -exec rm -rf {} \;
|
find /storage/roms -iname '._*' -exec rm -rf {} \;
|
||||||
clear >/dev/console
|
clear >/dev/console
|
||||||
start_ui
|
systemctl start ${UI_SERVICE}
|
||||||
|
|
Loading…
Reference in a new issue