From 4b519d9911417c5f0f2d1571052ce8c2bed5619d Mon Sep 17 00:00:00 2001 From: Michel-FK Date: Sat, 15 May 2021 23:48:45 +0200 Subject: [PATCH] change for new pid script Signed-off-by: Michel-FK --- .../usr/games/launchers/gamegear_launch.sh | 4 +- .../usr/games/launchers/gb_launch.sh | 4 +- .../usr/games/launchers/gba_launch_gpsp.sh | 4 +- .../games/launchers/gba_launch_mednafen.sh | 4 +- .../usr/games/launchers/lynx_launch.sh | 4 +- .../games/launchers/mame_launch_mednafen.sh | 4 +- .../usr/games/launchers/megadrive_launch.sh | 4 +- .../usr/games/launchers/nes_launch.sh | 4 +- .../usr/games/launchers/ngp_launch.sh | 4 +- .../usr/games/launchers/pce_launch.sh | 4 +- .../games/launchers/psone_launch_mednafen.sh | 4 +- .../usr/games/launchers/psone_launch_pcsx.sh | 4 +- .../usr/games/launchers/sms_launch.sh | 4 +- .../usr/games/launchers/snes_launch.sh | 4 +- .../games/launchers/snes_launch_mednafen.sh | 4 +- .../usr/games/launchers/wonderswan_launch.sh | 4 +- .../rootfs-overlay/usr/local/sbin/erase_pid | 12 ----- .../rootfs-overlay/usr/local/sbin/frontend | 4 +- .../usr/local/sbin/instant_play | 4 +- .../funkey/rootfs-overlay/usr/local/sbin/pid | 47 +++++++++++++++++++ .../rootfs-overlay/usr/local/sbin/record_pid | 12 ----- FunKey/package/ProdScreens/ProdScreens.mk | 2 +- FunKey/package/retrofe/retrofe.mk | 2 +- 23 files changed, 85 insertions(+), 62 deletions(-) delete mode 100755 FunKey/board/funkey/rootfs-overlay/usr/local/sbin/erase_pid create mode 100755 FunKey/board/funkey/rootfs-overlay/usr/local/sbin/pid delete mode 100755 FunKey/board/funkey/rootfs-overlay/usr/local/sbin/record_pid diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gamegear_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gamegear_launch.sh index 8364468..44c0072 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gamegear_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gamegear_launch.sh @@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID mednafen -fs 1 -gg.stretch full "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gb_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gb_launch.sh index 5ae85d2..83076e7 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gb_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gb_launch.sh @@ -3,6 +3,6 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID sdlgnuboy --syncrtc --stereo=0 "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_gpsp.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_gpsp.sh index fb4d910..53b2069 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_gpsp.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_gpsp.sh @@ -4,7 +4,7 @@ # for the process to terminate and erase the recorded PID cd ${HOME} gpsp "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_mednafen.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_mednafen.sh index 88dd220..fbaefaa 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_mednafen.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_mednafen.sh @@ -3,6 +3,6 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID gpsp "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/lynx_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/lynx_launch.sh index 300941f..9672270 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/lynx_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/lynx_launch.sh @@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID mednafen -fs 1 -lynx.stretch full "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/mame_launch_mednafen.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/mame_launch_mednafen.sh index cca6afe..8d1026e 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/mame_launch_mednafen.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/mame_launch_mednafen.sh @@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID mednafen -sound 1 -soundrate 22050 -soundbufsize 100 -vdriver sdl -frameskip 1 -fs 0 "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/megadrive_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/megadrive_launch.sh index cf3805a..fc54ba5 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/megadrive_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/megadrive_launch.sh @@ -3,6 +3,6 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID PicoDrive "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/nes_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/nes_launch.sh index e241779..11efc78 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/nes_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/nes_launch.sh @@ -3,6 +3,6 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID fceux "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/ngp_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/ngp_launch.sh index 54e6eb9..ca5e48e 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/ngp_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/ngp_launch.sh @@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID mednafen -fs 1 -ngp.stretch full "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/pce_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/pce_launch.sh index 6c3f914..f98d467 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/pce_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/pce_launch.sh @@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID mednafen -fs 1 -force_module pce_fast -pce_fast.stretch full "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_mednafen.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_mednafen.sh index b81a321..cda7247 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_mednafen.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_mednafen.sh @@ -3,6 +3,6 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID pcsx -frameskip -cdfile "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_pcsx.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_pcsx.sh index b2a0613..b49fa61 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_pcsx.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_pcsx.sh @@ -3,6 +3,6 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID pcsx -cdfile "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/sms_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/sms_launch.sh index cf3805a..fc54ba5 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/sms_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/sms_launch.sh @@ -3,6 +3,6 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID PicoDrive "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch.sh index e0b39cf..7cf1ea7 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch.sh @@ -3,6 +3,6 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID psnes "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch_mednafen.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch_mednafen.sh index e0b39cf..7cf1ea7 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch_mednafen.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch_mednafen.sh @@ -3,6 +3,6 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID psnes "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/wonderswan_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/wonderswan_launch.sh index 69f7ca2..bfb896f 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/wonderswan_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/wonderswan_launch.sh @@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID mednafen -fs 1 -wswan.stretch full "$1"& -record_pid $! +pid record $! wait $! -erase_pid +pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/erase_pid b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/erase_pid deleted file mode 100755 index afb3597..0000000 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/erase_pid +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Uncomment the following line to get debug info -#set -x - -# Check args -if [ ${#} -ne 0 ]; then - echo "Usage: $(basename ${0})" - exit 1 -fi -rm -f /var/run/funkey.pid -exit 0 diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/frontend b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/frontend index 4dc4d5e..ccc20b3 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/frontend +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/frontend @@ -94,9 +94,9 @@ init_frontend() { # Record the PID into a file, wait for the process to # terminate and erase the recorded PID - record_pid $! + pid record $! wait $! - erase_pid + pid erase # In case retrofe/opkrun quits with errors, clear graphic VT termfix_all diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/instant_play b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/instant_play index 157c8b7..319e885 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/instant_play +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/instant_play @@ -57,9 +57,9 @@ case ${1} in # terminate and erase the recorded PID cat << EOF >> "${INSTANT_PLAY_FILE}" & -record_pid \$! +pid record \$! wait \$! -erase_pid +pid erase EOF # Now terminate gracefully diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/pid b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/pid new file mode 100755 index 0000000..75533bd --- /dev/null +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/pid @@ -0,0 +1,47 @@ +#!/bin/sh + +# Uncomment the following line to get debug info +#set -x + +SELF="$(basename ${0})" +PID_FILE="/var/run/funkey.pid" + +usage() { + >&2 echo "Usage: ${SELF} record pid" + >&2 echo " ${SELF} erase" + exit 1 +} + +record_pid() { + local pid="${1}" + if ! [ ! "${pid}" -ne "${pid}" ]; then + >&2 echo "error: ${pid} is not a number" + exit 2 + fi + echo "${1}" > "${PID_FILE}" +} + +erase_pid() { + rm -f "${PID_FILE}" +} + +case "${1}" in + record) + if [ ${#} -ne 2 ]; then + usage + fi + record_pid "${2}" + ;; + + erase) + if [ ${#} -ne 1 ]; then + usage + fi + erase_pid + ;; + + *) + usage + ;; +esac +exit 0 diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/record_pid b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/record_pid deleted file mode 100755 index 0f98bfc..0000000 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/record_pid +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Uncomment the following line to get debug info -#set -x - -# Check args -if [ ${#} -ne 1 ]; then - echo "Usage: $(basename ${0}) pid" - exit 1 -fi -echo ${1} > /var/run/funkey.pid -exit 0 diff --git a/FunKey/package/ProdScreens/ProdScreens.mk b/FunKey/package/ProdScreens/ProdScreens.mk index b8ba6a5..f023b2f 100644 --- a/FunKey/package/ProdScreens/ProdScreens.mk +++ b/FunKey/package/ProdScreens/ProdScreens.mk @@ -4,7 +4,7 @@ # ################################################################################ -PRODSCREENS_VERSION = 428290b +PRODSCREENS_VERSION = e58f3a6 PRODSCREENS_SITE_METHOD = git PRODSCREENS_SITE = https://github.com/FunKey-Project/FunKey-ProdScreens.git PRODSCREENS_SITE_LICENSE = GPL-2.1+ diff --git a/FunKey/package/retrofe/retrofe.mk b/FunKey/package/retrofe/retrofe.mk index 6ab887c..8b8d1aa 100644 --- a/FunKey/package/retrofe/retrofe.mk +++ b/FunKey/package/retrofe/retrofe.mk @@ -4,7 +4,7 @@ # ################################################################################ -RETROFE_VERSION = 77ccbc2 +RETROFE_VERSION = bc9195f RETROFE_SITE_METHOD = git RETROFE_SITE = https://github.com/FunKey-Project/RetroFE.git RETROFE_DEPENDENCIES = gstreamer1 gst1-plugins-base sdl sdl_image sdl_mixer sdl_sound sdl_ttf libglib2 sqlite zlib