From b130c51dc693a94fd841b03c0254ede48c85ae8d Mon Sep 17 00:00:00 2001 From: t0b10 Date: Sun, 15 Dec 2024 03:46:39 -0700 Subject: [PATCH 1/3] Ready-to-Runs: Replace symbolic links with bind mounts. --- ports/armagetronad/Armagetron Advanced.sh | 7 +++---- ports/asylum/Asylum.sh | 7 ++----- ports/block.attack/Block Attack.sh | 6 +++--- ports/boswars/Bos Wars.sh | 7 ++----- ports/c-dogs/C-Dogs.sh | 5 +++-- "ports/ceferino/Don Ceferino Haza\303\261a.sh" | 6 ++---- ports/freesiege/FreeSiege.sh | 7 ++----- ports/gigalomania/Gigalomania.sh | 5 +++-- ports/grafx2/Grafx2.sh | 7 ++----- ports/heroes/Heroes.sh | 7 ++----- ports/hex-a-hop/Hex-A-Hop.sh | 5 +++-- ports/holotzcastle/Holotz Castle.sh | 7 ++----- ports/lierolibre/LieroLibre.sh | 6 +++--- ports/opentyrian/OpenTyrian.sh | 6 ++++-- ports/rocksndiamonds/Rocks n Diamonds.sh | 5 +++-- ports/shippy/Shippy.sh | 5 +++-- ports/supertransball2/Super Transball 2.sh | 7 ++----- ports/vvvvvv/VVVVVV.sh | 5 +++-- ports/wolf3d/Wolfenstein 3D.sh | 9 ++++----- 19 files changed, 51 insertions(+), 68 deletions(-) diff --git a/ports/armagetronad/Armagetron Advanced.sh b/ports/armagetronad/Armagetron Advanced.sh index be25c72040..8ba9b490f8 100644 --- a/ports/armagetronad/Armagetron Advanced.sh +++ b/ports/armagetronad/Armagetron Advanced.sh @@ -13,7 +13,7 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -31,8 +31,7 @@ export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export TEXTINPUTINTERACTIVE="Y" #export XDG_DATA_HOME="$CONFDIR" -$ESUDO rm -rf ~/.armagetronad -ln -sfv /$directory/ports/armagetronad/conf/.armagetronad ~/ +bind_directories ~/.armagetronad /$directory/ports/armagetronad/conf/.armagetronad cd $GAMEDIR @@ -61,4 +60,4 @@ $GPTOKEYB "armagetronad.${DEVICE_ARCH}" -c "./armagetronad.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 \ No newline at end of file +printf "\033c" > /dev/tty0 diff --git a/ports/asylum/Asylum.sh b/ports/asylum/Asylum.sh index 96706abc44..d4124c148a 100644 --- a/ports/asylum/Asylum.sh +++ b/ports/asylum/Asylum.sh @@ -12,8 +12,6 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -35,8 +33,7 @@ export XDG_DATA_HOME="$CONFDIR" $ESUDO chmod 666 /dev/uinput -$ESUDO rm -rf ~/.asylum -ln -sfv /$directory/ports/asylum/conf/.asylum ~/ +bind_files ~/.asylum /$directory/ports/asylum/conf/.asylum cd $GAMEDIR @@ -51,4 +48,4 @@ $GPTOKEYB "asylum" -c "./asylum.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 \ No newline at end of file +printf "\033c" > /dev/tty0 diff --git a/ports/block.attack/Block Attack.sh b/ports/block.attack/Block Attack.sh index 3872f3f1ba..be707e5995 100644 --- a/ports/block.attack/Block Attack.sh +++ b/ports/block.attack/Block Attack.sh @@ -13,7 +13,7 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -21,8 +21,7 @@ GAMEDIR="/$directory/ports/blockattack" > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 cd $GAMEDIR -$ESUDO rm -rf ~/.local/share/blockattack -ln -sfv $GAMEDIR/ ~/.local/share +bind_directories ~/.local/share/blockattack $GAMEDIR/ DEVICE_ARCH="${DEVICE_ARCH:-aarch64}" @@ -37,3 +36,4 @@ $GPTOKEYB "blockattack.${DEVICE_ARCH}" -c "$GAMEDIR/blockattack.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty1 + diff --git a/ports/boswars/Bos Wars.sh b/ports/boswars/Bos Wars.sh index 87e77ec8b9..18e48b9a62 100644 --- a/ports/boswars/Bos Wars.sh +++ b/ports/boswars/Bos Wars.sh @@ -12,8 +12,6 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -30,8 +28,7 @@ export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export XDG_DATA_HOME="$CONFDIR" -$ESUDO rm -rf ~/.boswars -ln -sfv $GAMEDIR/conf/.boswars ~/ +bind_directories ~/.boswars $GAMEDIR/conf/.boswars sed -i "s/\(VideoWidth = \)[0-9]\+\(,\)/\1$DISPLAY_WIDTH\2/" $GAMEDIR/conf/.boswars/preferences.lua sed -i "s/\(VideoHeight = \)[0-9]\+\(,\)/\1$DISPLAY_HEIGHT\2/" $GAMEDIR/conf/.boswars/preferences.lua @@ -43,4 +40,4 @@ $GPTOKEYB "$BINARY" -c ./boswars.${ANALOG_STICKS}.gptk textinput & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 \ No newline at end of file +printf "\033c" > /dev/tty0 diff --git a/ports/c-dogs/C-Dogs.sh b/ports/c-dogs/C-Dogs.sh index ad064b5ef9..197297d83e 100644 --- a/ports/c-dogs/C-Dogs.sh +++ b/ports/c-dogs/C-Dogs.sh @@ -13,6 +13,7 @@ else fi source $controlfolder/control.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -42,8 +43,7 @@ fi -rm -rf ~/.config/cdogs-sdl -ln -sfv $GAMEDIR/conf/cdogs-sdl/ ~/.config/ +bind_directories ~/.config/cdogs-sdl $GAMEDIR/conf/cdogs-sdl/ cd $GAMEDIR/data @@ -54,3 +54,4 @@ $ESUDO kill -9 $(pidof oga_controls) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty1 + diff --git "a/ports/ceferino/Don Ceferino Haza\303\261a.sh" "b/ports/ceferino/Don Ceferino Haza\303\261a.sh" index 7911ad417c..626c085d21 100644 --- "a/ports/ceferino/Don Ceferino Haza\303\261a.sh" +++ "b/ports/ceferino/Don Ceferino Haza\303\261a.sh" @@ -13,7 +13,6 @@ else fi source $controlfolder/control.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -31,8 +30,7 @@ export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export XDG_DATA_HOME="$CONFDIR" export TEXTINPUTINTERACTIVE="Y" -$ESUDO rm -rf ~/.ceferino -ln -sfv $GAMEDIR/conf/.ceferino ~/ +bind_files ~/.ceferino $GAMEDIR/conf/.ceferino cd $GAMEDIR @@ -40,4 +38,4 @@ $GPTOKEYB "$BINARY" -c ./$BINARY.gptk & pm_platform_helper "$GAMEDIR/$BINARY" ./$BINARY -pm_finish \ No newline at end of file +pm_finish diff --git a/ports/freesiege/FreeSiege.sh b/ports/freesiege/FreeSiege.sh index 1642d2e2eb..22124d1bca 100644 --- a/ports/freesiege/FreeSiege.sh +++ b/ports/freesiege/FreeSiege.sh @@ -12,8 +12,6 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -33,8 +31,7 @@ export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" #export TEXTINPUTINTERACTIVE="Y" -$ESUDO rm -rf ~/.freesiege -ln -sfv /$directory/ports/freesiege/conf/.freesiege ~/ +bind_directories ~/.freesiege /$directory/ports/freesiege/conf/.freesiege cd $GAMEDIR @@ -43,4 +40,4 @@ $GPTOKEYB "freesiege" -c "./freesiege.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 \ No newline at end of file +printf "\033c" > /dev/tty0 diff --git a/ports/gigalomania/Gigalomania.sh b/ports/gigalomania/Gigalomania.sh index 3764b7d812..9fc2ed6f1f 100644 --- a/ports/gigalomania/Gigalomania.sh +++ b/ports/gigalomania/Gigalomania.sh @@ -13,6 +13,7 @@ else fi source $controlfolder/control.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -21,8 +22,7 @@ GAMEDIR=/$directory/ports/gigalomania cd $GAMEDIR -$ESUDO rm -rf ~/.config/gigalomania/ -ln -sfv /$directory/ports/gigalomania/conf/ ~/.config/gigalomania +bind_directories ~/.config/gigalomania/ /$directory/ports/gigalomania/conf/ export LD_LIBRARY_PATH="$PWD/libs:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" @@ -35,3 +35,4 @@ $GPTOKEYB "gigalomania" -c "./gigalomania.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty0 + diff --git a/ports/grafx2/Grafx2.sh b/ports/grafx2/Grafx2.sh index cf8c6a9977..af60412915 100644 --- a/ports/grafx2/Grafx2.sh +++ b/ports/grafx2/Grafx2.sh @@ -12,8 +12,6 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -27,8 +25,7 @@ mkdir -p "$GAMEDIR/conf" $ESUDO chmod 666 /dev/uinput -$ESUDO rm -rf ~/.config/grafx2 -ln -sfv $GAMEDIR/conf/.config/grafx2 ~/.config/ +bind_directories ~/.config/grafx2 $GAMEDIR/conf/.config/grafx2 export XDG_DATA_HOME="$CONFDIR" export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" @@ -42,4 +39,4 @@ bin/grafx2-sdl2 -double $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 \ No newline at end of file +printf "\033c" > /dev/tty0 diff --git a/ports/heroes/Heroes.sh b/ports/heroes/Heroes.sh index f395ed1d5d..23d3837eb3 100644 --- a/ports/heroes/Heroes.sh +++ b/ports/heroes/Heroes.sh @@ -12,8 +12,6 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -30,8 +28,7 @@ export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export XDG_DATA_HOME="$CONFDIR" -$ESUDO rm -rf ~/.heroes -ln -sfv $GAMEDIR/conf/.heroes ~/ +bind_directories ~/.heroes $GAMEDIR/conf/.heroes cd $GAMEDIR @@ -40,4 +37,4 @@ $GPTOKEYB "$BINARY" -c ./$BINARY.gptk textinput & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 \ No newline at end of file +printf "\033c" > /dev/tty0 diff --git a/ports/hex-a-hop/Hex-A-Hop.sh b/ports/hex-a-hop/Hex-A-Hop.sh index 7daa79c04a..ff3dbaa0fe 100644 --- a/ports/hex-a-hop/Hex-A-Hop.sh +++ b/ports/hex-a-hop/Hex-A-Hop.sh @@ -13,6 +13,7 @@ else fi source $controlfolder/control.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -20,8 +21,7 @@ GAMEDIR=/$directory/ports/hex-a-hop > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 cd $GAMEDIR -$ESUDO rm -rf ~/.hex-a-hop -ln -sfv /$directory/ports/hex-a-hop/conf/.hex-a-hop ~/ +bind_directories ~/.hex-a-hop /$directory/ports/hex-a-hop/conf/.hex-a-hop export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export LD_LIBRARY_PATH="$GAMEDIR/libs:$LD_LIBRARY_PATH" @@ -34,3 +34,4 @@ $GPTOKEYB "hex-a-hop" -c "./hex-a-hop.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty0 + diff --git a/ports/holotzcastle/Holotz Castle.sh b/ports/holotzcastle/Holotz Castle.sh index 7d5e93be9b..f5a7e0ddc4 100644 --- a/ports/holotzcastle/Holotz Castle.sh +++ b/ports/holotzcastle/Holotz Castle.sh @@ -13,8 +13,6 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -31,8 +29,7 @@ export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export XDG_DATA_HOME="$CONFDIR" -$ESUDO rm -rf ~/.holotz-castle -ln -sfv $GAMEDIR/conf/.holotz-castle ~/ +bind_directories ~/.holotz-castle $GAMEDIR/conf/.holotz-castle cd $GAMEDIR @@ -43,4 +40,4 @@ $GPTOKEYB "$BINARY" -c ./$BINARY.gptk & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 \ No newline at end of file +printf "\033c" > /dev/tty0 diff --git a/ports/lierolibre/LieroLibre.sh b/ports/lierolibre/LieroLibre.sh index 82ca06d512..947f2df56d 100644 --- a/ports/lierolibre/LieroLibre.sh +++ b/ports/lierolibre/LieroLibre.sh @@ -13,15 +13,14 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls GAMEDIR=/$directory/ports/lierolibre # Set up savedata -$ESUDO rm -rf ~/.lierolibre -ln -sfv "$GAMEDIR/savedata/.lierolibre" ~/ +bind_directories ~/.lierolibre "$GAMEDIR/savedata/.lierolibre" # Enable logging > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 @@ -41,3 +40,4 @@ $GPTOKEYB "lierolibre" -c "./lierolibre.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty0 + diff --git a/ports/opentyrian/OpenTyrian.sh b/ports/opentyrian/OpenTyrian.sh index a7c6bf69e9..2f93370ec8 100644 --- a/ports/opentyrian/OpenTyrian.sh +++ b/ports/opentyrian/OpenTyrian.sh @@ -13,6 +13,7 @@ else fi source $controlfolder/control.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -31,8 +32,8 @@ elif [[ $whichos == *"RetroOZ"* ]]; then cp /home/odroid/.asoundrcfords /home/odroid/.asoundrc fi -$ESUDO rm -rf ~/.config/opentyrian -ln -sfv $GAMEDIR/ ~/.config/ +bind_directories ~/.config/opentyrian $GAMEDIR/ + cd $GAMEDIR $GPTOKEYB opentyrian & $GAMEDIR/opentyrian --data=$GAMEDIR/data 2>&1 | tee $GAMEDIR/log.txt @@ -47,3 +48,4 @@ $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" >> /dev/tty1 + diff --git a/ports/rocksndiamonds/Rocks n Diamonds.sh b/ports/rocksndiamonds/Rocks n Diamonds.sh index 044562ec7b..18927c43e7 100644 --- a/ports/rocksndiamonds/Rocks n Diamonds.sh +++ b/ports/rocksndiamonds/Rocks n Diamonds.sh @@ -13,6 +13,7 @@ else fi source $controlfolder/control.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -20,8 +21,7 @@ GAMEDIR="/$directory/ports/rocksndiamonds" $ESUDO chmod 666 /dev/tty1 -$ESUDO rm -rf ~/.rocksndiamonds -ln -sfv $GAMEDIR/conf/.rocksndiamonds/ ~/ +bind_directories ~/.rocksndiamonds $GAMEDIR/conf/.rocksndiamonds/ cd $GAMEDIR $ESUDO $controlfolder/oga_controls rocksndiamonds $param_device & ./rocksndiamonds 2>&1 | tee $GAMEDIR/log.txt @@ -29,3 +29,4 @@ $ESUDO kill -9 $(pidof oga_controls) $ESUDO systemctl restart oga_events & printf "\033c" >> /dev/tty1 + diff --git a/ports/shippy/Shippy.sh b/ports/shippy/Shippy.sh index edeb90b4f4..f76ba765e4 100644 --- a/ports/shippy/Shippy.sh +++ b/ports/shippy/Shippy.sh @@ -13,6 +13,7 @@ else fi source $controlfolder/control.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -20,8 +21,7 @@ GAMEDIR=/$directory/ports/shippy exec > >(tee "$GAMEDIR/log.txt") 2>&1 -$ESUDO rm -rf /storage/.local/share/shippy -ln -sfv /$directory/ports/shippy /storage/.local/share/shippy +bind_directories /storage/.local/share/shippy /$directory/ports/shippy cd $GAMEDIR @@ -33,3 +33,4 @@ SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" ./shippy $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty0 + diff --git a/ports/supertransball2/Super Transball 2.sh b/ports/supertransball2/Super Transball 2.sh index 394e46ed74..3775fe9f87 100644 --- a/ports/supertransball2/Super Transball 2.sh +++ b/ports/supertransball2/Super Transball 2.sh @@ -13,8 +13,6 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -33,8 +31,7 @@ export XDG_DATA_HOME="$CONFDIR" export SUPERTRANSBALL2_CONFIG_DIR=$GAMEDIR/data/ export SUPERTRANSBALL2_DATA_DIR=$GAMEDIR/data/ -$ESUDO rm -rf ~/.supertransball2 -ln -sfv $GAMEDIR/conf/.supertransball2 ~/ +bind_directories ~/.supertransball2 $GAMEDIR/conf/.supertransball2 cd $GAMEDIR @@ -45,4 +42,4 @@ $GPTOKEYB "$BINARY" -c ./$BINARY.gptk & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 \ No newline at end of file +printf "\033c" > /dev/tty0 diff --git a/ports/vvvvvv/VVVVVV.sh b/ports/vvvvvv/VVVVVV.sh index ebb4883d50..8bf57232da 100644 --- a/ports/vvvvvv/VVVVVV.sh +++ b/ports/vvvvvv/VVVVVV.sh @@ -13,6 +13,7 @@ else fi source $controlfolder/control.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -20,10 +21,10 @@ GAMEDIR="/$directory/ports/VVVVVV" cd $GAMEDIR $ESUDO chmod 666 /dev/tty1 -$ESUDO rm -rf ~/.local/share/VVVVVV -ln -s $GAMEDIR ~/.local/share/ +bind_directories ~/.local/share/VVVVVV $GAMEDIR $ESUDO $controlfolder/oga_controls VVVVVV $param_device & SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" ./VVVVVV 2>&1 | tee $GAMEDIR/log.txt $ESUDO kill -9 $(pidof oga_controls) $ESUDO systemctl restart oga_events & printf "\033c" >> /dev/tty1 + diff --git a/ports/wolf3d/Wolfenstein 3D.sh b/ports/wolf3d/Wolfenstein 3D.sh index 3f3f6d1bed..a8cee15afe 100644 --- a/ports/wolf3d/Wolfenstein 3D.sh +++ b/ports/wolf3d/Wolfenstein 3D.sh @@ -13,8 +13,8 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" + get_controls # Variables @@ -26,10 +26,8 @@ cd $GAMEDIR > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 # Create config dir -rm -rf "$XDG_DATA_HOME/lzwolf" -rm -rf "$XDG_DATA_HOME/ecwolf" -ln -s "$GAMEDIR/cfg" "$XDG_DATA_HOME/lzwolf" -ln -s "$GAMEDIR/cfg" "$XDG_DATA_HOME/ecwolf" +bind_directories "$XDG_DATA_HOME/lzwolf" "$GAMEDIR/cfg" +bind_directories "$XDG_DATA_HOME/ecwolf" "$GAMEDIR/cfg" # Permissions $ESUDO chmod 666 /dev/tty0 @@ -167,3 +165,4 @@ $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty1 printf "\033c" > /dev/tty0 + From b5cdad8b05f14f19da659fe30665fd1d65cb32fe Mon Sep 17 00:00:00 2001 From: t0b10 Date: Sun, 15 Dec 2024 03:47:02 -0700 Subject: [PATCH 2/3] Revert "Ready-to-Runs: Replace symbolic links with bind mounts." This reverts commit b130c51dc693a94fd841b03c0254ede48c85ae8d. --- ports/armagetronad/Armagetron Advanced.sh | 7 ++++--- ports/asylum/Asylum.sh | 7 +++++-- ports/block.attack/Block Attack.sh | 6 +++--- ports/boswars/Bos Wars.sh | 7 +++++-- ports/c-dogs/C-Dogs.sh | 5 ++--- "ports/ceferino/Don Ceferino Haza\303\261a.sh" | 6 ++++-- ports/freesiege/FreeSiege.sh | 7 +++++-- ports/gigalomania/Gigalomania.sh | 5 ++--- ports/grafx2/Grafx2.sh | 7 +++++-- ports/heroes/Heroes.sh | 7 +++++-- ports/hex-a-hop/Hex-A-Hop.sh | 5 ++--- ports/holotzcastle/Holotz Castle.sh | 7 +++++-- ports/lierolibre/LieroLibre.sh | 6 +++--- ports/opentyrian/OpenTyrian.sh | 6 ++---- ports/rocksndiamonds/Rocks n Diamonds.sh | 5 ++--- ports/shippy/Shippy.sh | 5 ++--- ports/supertransball2/Super Transball 2.sh | 7 +++++-- ports/vvvvvv/VVVVVV.sh | 5 ++--- ports/wolf3d/Wolfenstein 3D.sh | 9 +++++---- 19 files changed, 68 insertions(+), 51 deletions(-) diff --git a/ports/armagetronad/Armagetron Advanced.sh b/ports/armagetronad/Armagetron Advanced.sh index 8ba9b490f8..be25c72040 100644 --- a/ports/armagetronad/Armagetron Advanced.sh +++ b/ports/armagetronad/Armagetron Advanced.sh @@ -13,7 +13,7 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" +source $controlfolder/device_info.txt get_controls @@ -31,7 +31,8 @@ export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export TEXTINPUTINTERACTIVE="Y" #export XDG_DATA_HOME="$CONFDIR" -bind_directories ~/.armagetronad /$directory/ports/armagetronad/conf/.armagetronad +$ESUDO rm -rf ~/.armagetronad +ln -sfv /$directory/ports/armagetronad/conf/.armagetronad ~/ cd $GAMEDIR @@ -60,4 +61,4 @@ $GPTOKEYB "armagetronad.${DEVICE_ARCH}" -c "./armagetronad.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 +printf "\033c" > /dev/tty0 \ No newline at end of file diff --git a/ports/asylum/Asylum.sh b/ports/asylum/Asylum.sh index d4124c148a..96706abc44 100644 --- a/ports/asylum/Asylum.sh +++ b/ports/asylum/Asylum.sh @@ -12,6 +12,8 @@ else fi source $controlfolder/control.txt +source $controlfolder/device_info.txt + [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -33,7 +35,8 @@ export XDG_DATA_HOME="$CONFDIR" $ESUDO chmod 666 /dev/uinput -bind_files ~/.asylum /$directory/ports/asylum/conf/.asylum +$ESUDO rm -rf ~/.asylum +ln -sfv /$directory/ports/asylum/conf/.asylum ~/ cd $GAMEDIR @@ -48,4 +51,4 @@ $GPTOKEYB "asylum" -c "./asylum.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 +printf "\033c" > /dev/tty0 \ No newline at end of file diff --git a/ports/block.attack/Block Attack.sh b/ports/block.attack/Block Attack.sh index be707e5995..3872f3f1ba 100644 --- a/ports/block.attack/Block Attack.sh +++ b/ports/block.attack/Block Attack.sh @@ -13,7 +13,7 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" +source $controlfolder/device_info.txt get_controls @@ -21,7 +21,8 @@ GAMEDIR="/$directory/ports/blockattack" > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 cd $GAMEDIR -bind_directories ~/.local/share/blockattack $GAMEDIR/ +$ESUDO rm -rf ~/.local/share/blockattack +ln -sfv $GAMEDIR/ ~/.local/share DEVICE_ARCH="${DEVICE_ARCH:-aarch64}" @@ -36,4 +37,3 @@ $GPTOKEYB "blockattack.${DEVICE_ARCH}" -c "$GAMEDIR/blockattack.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty1 - diff --git a/ports/boswars/Bos Wars.sh b/ports/boswars/Bos Wars.sh index 18e48b9a62..87e77ec8b9 100644 --- a/ports/boswars/Bos Wars.sh +++ b/ports/boswars/Bos Wars.sh @@ -12,6 +12,8 @@ else fi source $controlfolder/control.txt +source $controlfolder/device_info.txt + [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -28,7 +30,8 @@ export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export XDG_DATA_HOME="$CONFDIR" -bind_directories ~/.boswars $GAMEDIR/conf/.boswars +$ESUDO rm -rf ~/.boswars +ln -sfv $GAMEDIR/conf/.boswars ~/ sed -i "s/\(VideoWidth = \)[0-9]\+\(,\)/\1$DISPLAY_WIDTH\2/" $GAMEDIR/conf/.boswars/preferences.lua sed -i "s/\(VideoHeight = \)[0-9]\+\(,\)/\1$DISPLAY_HEIGHT\2/" $GAMEDIR/conf/.boswars/preferences.lua @@ -40,4 +43,4 @@ $GPTOKEYB "$BINARY" -c ./boswars.${ANALOG_STICKS}.gptk textinput & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 +printf "\033c" > /dev/tty0 \ No newline at end of file diff --git a/ports/c-dogs/C-Dogs.sh b/ports/c-dogs/C-Dogs.sh index 197297d83e..ad064b5ef9 100644 --- a/ports/c-dogs/C-Dogs.sh +++ b/ports/c-dogs/C-Dogs.sh @@ -13,7 +13,6 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -43,7 +42,8 @@ fi -bind_directories ~/.config/cdogs-sdl $GAMEDIR/conf/cdogs-sdl/ +rm -rf ~/.config/cdogs-sdl +ln -sfv $GAMEDIR/conf/cdogs-sdl/ ~/.config/ cd $GAMEDIR/data @@ -54,4 +54,3 @@ $ESUDO kill -9 $(pidof oga_controls) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty1 - diff --git "a/ports/ceferino/Don Ceferino Haza\303\261a.sh" "b/ports/ceferino/Don Ceferino Haza\303\261a.sh" index 626c085d21..7911ad417c 100644 --- "a/ports/ceferino/Don Ceferino Haza\303\261a.sh" +++ "b/ports/ceferino/Don Ceferino Haza\303\261a.sh" @@ -13,6 +13,7 @@ else fi source $controlfolder/control.txt + [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -30,7 +31,8 @@ export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export XDG_DATA_HOME="$CONFDIR" export TEXTINPUTINTERACTIVE="Y" -bind_files ~/.ceferino $GAMEDIR/conf/.ceferino +$ESUDO rm -rf ~/.ceferino +ln -sfv $GAMEDIR/conf/.ceferino ~/ cd $GAMEDIR @@ -38,4 +40,4 @@ $GPTOKEYB "$BINARY" -c ./$BINARY.gptk & pm_platform_helper "$GAMEDIR/$BINARY" ./$BINARY -pm_finish +pm_finish \ No newline at end of file diff --git a/ports/freesiege/FreeSiege.sh b/ports/freesiege/FreeSiege.sh index 22124d1bca..1642d2e2eb 100644 --- a/ports/freesiege/FreeSiege.sh +++ b/ports/freesiege/FreeSiege.sh @@ -12,6 +12,8 @@ else fi source $controlfolder/control.txt +source $controlfolder/device_info.txt + [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -31,7 +33,8 @@ export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" #export TEXTINPUTINTERACTIVE="Y" -bind_directories ~/.freesiege /$directory/ports/freesiege/conf/.freesiege +$ESUDO rm -rf ~/.freesiege +ln -sfv /$directory/ports/freesiege/conf/.freesiege ~/ cd $GAMEDIR @@ -40,4 +43,4 @@ $GPTOKEYB "freesiege" -c "./freesiege.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 +printf "\033c" > /dev/tty0 \ No newline at end of file diff --git a/ports/gigalomania/Gigalomania.sh b/ports/gigalomania/Gigalomania.sh index 9fc2ed6f1f..3764b7d812 100644 --- a/ports/gigalomania/Gigalomania.sh +++ b/ports/gigalomania/Gigalomania.sh @@ -13,7 +13,6 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -22,7 +21,8 @@ GAMEDIR=/$directory/ports/gigalomania cd $GAMEDIR -bind_directories ~/.config/gigalomania/ /$directory/ports/gigalomania/conf/ +$ESUDO rm -rf ~/.config/gigalomania/ +ln -sfv /$directory/ports/gigalomania/conf/ ~/.config/gigalomania export LD_LIBRARY_PATH="$PWD/libs:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" @@ -35,4 +35,3 @@ $GPTOKEYB "gigalomania" -c "./gigalomania.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty0 - diff --git a/ports/grafx2/Grafx2.sh b/ports/grafx2/Grafx2.sh index af60412915..cf8c6a9977 100644 --- a/ports/grafx2/Grafx2.sh +++ b/ports/grafx2/Grafx2.sh @@ -12,6 +12,8 @@ else fi source $controlfolder/control.txt +source $controlfolder/device_info.txt + [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -25,7 +27,8 @@ mkdir -p "$GAMEDIR/conf" $ESUDO chmod 666 /dev/uinput -bind_directories ~/.config/grafx2 $GAMEDIR/conf/.config/grafx2 +$ESUDO rm -rf ~/.config/grafx2 +ln -sfv $GAMEDIR/conf/.config/grafx2 ~/.config/ export XDG_DATA_HOME="$CONFDIR" export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" @@ -39,4 +42,4 @@ bin/grafx2-sdl2 -double $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 +printf "\033c" > /dev/tty0 \ No newline at end of file diff --git a/ports/heroes/Heroes.sh b/ports/heroes/Heroes.sh index 23d3837eb3..f395ed1d5d 100644 --- a/ports/heroes/Heroes.sh +++ b/ports/heroes/Heroes.sh @@ -12,6 +12,8 @@ else fi source $controlfolder/control.txt +source $controlfolder/device_info.txt + [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -28,7 +30,8 @@ export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export XDG_DATA_HOME="$CONFDIR" -bind_directories ~/.heroes $GAMEDIR/conf/.heroes +$ESUDO rm -rf ~/.heroes +ln -sfv $GAMEDIR/conf/.heroes ~/ cd $GAMEDIR @@ -37,4 +40,4 @@ $GPTOKEYB "$BINARY" -c ./$BINARY.gptk textinput & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 +printf "\033c" > /dev/tty0 \ No newline at end of file diff --git a/ports/hex-a-hop/Hex-A-Hop.sh b/ports/hex-a-hop/Hex-A-Hop.sh index ff3dbaa0fe..7daa79c04a 100644 --- a/ports/hex-a-hop/Hex-A-Hop.sh +++ b/ports/hex-a-hop/Hex-A-Hop.sh @@ -13,7 +13,6 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -21,7 +20,8 @@ GAMEDIR=/$directory/ports/hex-a-hop > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 cd $GAMEDIR -bind_directories ~/.hex-a-hop /$directory/ports/hex-a-hop/conf/.hex-a-hop +$ESUDO rm -rf ~/.hex-a-hop +ln -sfv /$directory/ports/hex-a-hop/conf/.hex-a-hop ~/ export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export LD_LIBRARY_PATH="$GAMEDIR/libs:$LD_LIBRARY_PATH" @@ -34,4 +34,3 @@ $GPTOKEYB "hex-a-hop" -c "./hex-a-hop.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty0 - diff --git a/ports/holotzcastle/Holotz Castle.sh b/ports/holotzcastle/Holotz Castle.sh index f5a7e0ddc4..7d5e93be9b 100644 --- a/ports/holotzcastle/Holotz Castle.sh +++ b/ports/holotzcastle/Holotz Castle.sh @@ -13,6 +13,8 @@ else fi source $controlfolder/control.txt +source $controlfolder/device_info.txt + [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -29,7 +31,8 @@ export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export XDG_DATA_HOME="$CONFDIR" -bind_directories ~/.holotz-castle $GAMEDIR/conf/.holotz-castle +$ESUDO rm -rf ~/.holotz-castle +ln -sfv $GAMEDIR/conf/.holotz-castle ~/ cd $GAMEDIR @@ -40,4 +43,4 @@ $GPTOKEYB "$BINARY" -c ./$BINARY.gptk & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 +printf "\033c" > /dev/tty0 \ No newline at end of file diff --git a/ports/lierolibre/LieroLibre.sh b/ports/lierolibre/LieroLibre.sh index 947f2df56d..82ca06d512 100644 --- a/ports/lierolibre/LieroLibre.sh +++ b/ports/lierolibre/LieroLibre.sh @@ -13,14 +13,15 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" +source $controlfolder/device_info.txt get_controls GAMEDIR=/$directory/ports/lierolibre # Set up savedata -bind_directories ~/.lierolibre "$GAMEDIR/savedata/.lierolibre" +$ESUDO rm -rf ~/.lierolibre +ln -sfv "$GAMEDIR/savedata/.lierolibre" ~/ # Enable logging > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 @@ -40,4 +41,3 @@ $GPTOKEYB "lierolibre" -c "./lierolibre.gptk" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty0 - diff --git a/ports/opentyrian/OpenTyrian.sh b/ports/opentyrian/OpenTyrian.sh index 2f93370ec8..a7c6bf69e9 100644 --- a/ports/opentyrian/OpenTyrian.sh +++ b/ports/opentyrian/OpenTyrian.sh @@ -13,7 +13,6 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -32,8 +31,8 @@ elif [[ $whichos == *"RetroOZ"* ]]; then cp /home/odroid/.asoundrcfords /home/odroid/.asoundrc fi -bind_directories ~/.config/opentyrian $GAMEDIR/ - +$ESUDO rm -rf ~/.config/opentyrian +ln -sfv $GAMEDIR/ ~/.config/ cd $GAMEDIR $GPTOKEYB opentyrian & $GAMEDIR/opentyrian --data=$GAMEDIR/data 2>&1 | tee $GAMEDIR/log.txt @@ -48,4 +47,3 @@ $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" >> /dev/tty1 - diff --git a/ports/rocksndiamonds/Rocks n Diamonds.sh b/ports/rocksndiamonds/Rocks n Diamonds.sh index 18927c43e7..044562ec7b 100644 --- a/ports/rocksndiamonds/Rocks n Diamonds.sh +++ b/ports/rocksndiamonds/Rocks n Diamonds.sh @@ -13,7 +13,6 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -21,7 +20,8 @@ GAMEDIR="/$directory/ports/rocksndiamonds" $ESUDO chmod 666 /dev/tty1 -bind_directories ~/.rocksndiamonds $GAMEDIR/conf/.rocksndiamonds/ +$ESUDO rm -rf ~/.rocksndiamonds +ln -sfv $GAMEDIR/conf/.rocksndiamonds/ ~/ cd $GAMEDIR $ESUDO $controlfolder/oga_controls rocksndiamonds $param_device & ./rocksndiamonds 2>&1 | tee $GAMEDIR/log.txt @@ -29,4 +29,3 @@ $ESUDO kill -9 $(pidof oga_controls) $ESUDO systemctl restart oga_events & printf "\033c" >> /dev/tty1 - diff --git a/ports/shippy/Shippy.sh b/ports/shippy/Shippy.sh index f76ba765e4..edeb90b4f4 100644 --- a/ports/shippy/Shippy.sh +++ b/ports/shippy/Shippy.sh @@ -13,7 +13,6 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -21,7 +20,8 @@ GAMEDIR=/$directory/ports/shippy exec > >(tee "$GAMEDIR/log.txt") 2>&1 -bind_directories /storage/.local/share/shippy /$directory/ports/shippy +$ESUDO rm -rf /storage/.local/share/shippy +ln -sfv /$directory/ports/shippy /storage/.local/share/shippy cd $GAMEDIR @@ -33,4 +33,3 @@ SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" ./shippy $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty0 - diff --git a/ports/supertransball2/Super Transball 2.sh b/ports/supertransball2/Super Transball 2.sh index 3775fe9f87..394e46ed74 100644 --- a/ports/supertransball2/Super Transball 2.sh +++ b/ports/supertransball2/Super Transball 2.sh @@ -13,6 +13,8 @@ else fi source $controlfolder/control.txt +source $controlfolder/device_info.txt + [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -31,7 +33,8 @@ export XDG_DATA_HOME="$CONFDIR" export SUPERTRANSBALL2_CONFIG_DIR=$GAMEDIR/data/ export SUPERTRANSBALL2_DATA_DIR=$GAMEDIR/data/ -bind_directories ~/.supertransball2 $GAMEDIR/conf/.supertransball2 +$ESUDO rm -rf ~/.supertransball2 +ln -sfv $GAMEDIR/conf/.supertransball2 ~/ cd $GAMEDIR @@ -42,4 +45,4 @@ $GPTOKEYB "$BINARY" -c ./$BINARY.gptk & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 +printf "\033c" > /dev/tty0 \ No newline at end of file diff --git a/ports/vvvvvv/VVVVVV.sh b/ports/vvvvvv/VVVVVV.sh index 8bf57232da..ebb4883d50 100644 --- a/ports/vvvvvv/VVVVVV.sh +++ b/ports/vvvvvv/VVVVVV.sh @@ -13,7 +13,6 @@ else fi source $controlfolder/control.txt -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -21,10 +20,10 @@ GAMEDIR="/$directory/ports/VVVVVV" cd $GAMEDIR $ESUDO chmod 666 /dev/tty1 -bind_directories ~/.local/share/VVVVVV $GAMEDIR +$ESUDO rm -rf ~/.local/share/VVVVVV +ln -s $GAMEDIR ~/.local/share/ $ESUDO $controlfolder/oga_controls VVVVVV $param_device & SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" ./VVVVVV 2>&1 | tee $GAMEDIR/log.txt $ESUDO kill -9 $(pidof oga_controls) $ESUDO systemctl restart oga_events & printf "\033c" >> /dev/tty1 - diff --git a/ports/wolf3d/Wolfenstein 3D.sh b/ports/wolf3d/Wolfenstein 3D.sh index a8cee15afe..3f3f6d1bed 100644 --- a/ports/wolf3d/Wolfenstein 3D.sh +++ b/ports/wolf3d/Wolfenstein 3D.sh @@ -13,8 +13,8 @@ else fi source $controlfolder/control.txt +source $controlfolder/device_info.txt [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" - get_controls # Variables @@ -26,8 +26,10 @@ cd $GAMEDIR > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 # Create config dir -bind_directories "$XDG_DATA_HOME/lzwolf" "$GAMEDIR/cfg" -bind_directories "$XDG_DATA_HOME/ecwolf" "$GAMEDIR/cfg" +rm -rf "$XDG_DATA_HOME/lzwolf" +rm -rf "$XDG_DATA_HOME/ecwolf" +ln -s "$GAMEDIR/cfg" "$XDG_DATA_HOME/lzwolf" +ln -s "$GAMEDIR/cfg" "$XDG_DATA_HOME/ecwolf" # Permissions $ESUDO chmod 666 /dev/tty0 @@ -165,4 +167,3 @@ $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty1 printf "\033c" > /dev/tty0 - From 883033d0f549be8fc9f8887c7c58994dbc07a306 Mon Sep 17 00:00:00 2001 From: t0b10 Date: Sun, 15 Dec 2024 04:30:20 -0700 Subject: [PATCH 3/3] Ready-to-Runs (control issues found): Replace symbolic links with bind mounts. --- ports/abuse/Abuse.sh | 8 +++----- ports/blobwars/Blobwars.sh | 6 +++--- ports/cave.story-evo/Cave Story-evo.sh | 6 +++--- ports/penguincommand/Penguin Command.sh | 7 ++----- ports/rockdodger/Rockdodger.sh | 6 ++---- 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/ports/abuse/Abuse.sh b/ports/abuse/Abuse.sh index 110edbd44b..a5737b5739 100644 --- a/ports/abuse/Abuse.sh +++ b/ports/abuse/Abuse.sh @@ -13,12 +13,10 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls -[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" - GAMEDIR="/$directory/ports/Abuse" > "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1 @@ -56,8 +54,7 @@ if [ -f "/boot/rk3326-rg351v-linux.dtb" ] || [ $(cat "/storage/.config/.OS_ARCH" sed -i '/ctr_left_stick_aim\=0/s//ctr_left_stick_aim\=1/' $GAMEDIR/user/config.txt fi -$ESUDO rm -rf ~/.abuse -ln -sfv $GAMEDIR/conf/.abuse ~/ +bind_directories ~/.abuse $GAMEDIR/conf/.abuse $ESUDO chmod 666 /dev/uinput $GPTOKEYB "abuse" -c "$GAMEDIR/$GPTOKEYB_CONFIG" & @@ -65,3 +62,4 @@ $GPTOKEYB "abuse" -c "$GAMEDIR/$GPTOKEYB_CONFIG" & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty1 + diff --git a/ports/blobwars/Blobwars.sh b/ports/blobwars/Blobwars.sh index c3be03400c..da49654a3f 100644 --- a/ports/blobwars/Blobwars.sh +++ b/ports/blobwars/Blobwars.sh @@ -13,7 +13,7 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt +[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -22,8 +22,7 @@ GAMEDIR=/$directory/ports/blobwars cd $GAMEDIR -$ESUDO rm -rf ~/.parallelrealities/blobwars -ln -sfv /$directory/ports/blobwars/conf/.parallelrealities/blobwars ~/ +bind_directories ~/.parallelrealities/blobwars /$directory/ports/blobwars/conf/.parallelrealities/blobwars export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" @@ -35,3 +34,4 @@ $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & printf "\033c" > /dev/tty0 + diff --git a/ports/cave.story-evo/Cave Story-evo.sh b/ports/cave.story-evo/Cave Story-evo.sh index e6909b50b4..f421696fae 100644 --- a/ports/cave.story-evo/Cave Story-evo.sh +++ b/ports/cave.story-evo/Cave Story-evo.sh @@ -13,8 +13,8 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" + get_controls $ESUDO chmod 666 /dev/tty0 @@ -49,8 +49,7 @@ if [ ! -f "$GAMEDIR/conf/nxengine/settings.dat" ]; then rm -f "$GAMEDIR/conf/nxengine/settings.dat.*" fi -$ESUDO rm -rf ~/.local/share/nxengine -$ESUDO ln -s $GAMEDIR/conf/nxengine ~/.local/share/ +bind_directories ~/.local/share/nxengine $GAMEDIR/conf/nxengine export LD_LIBRARY_PATH="$GAMEDIR/libs:$LD_LIBRARY_PATH" export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" @@ -62,3 +61,4 @@ $GPTOKEYB "nxengine-evo" -c nxengine-evo.gptk & $ESUDO kill -9 $(pidof gptokeyb) & printf "\033c" >> /dev/tty1 + diff --git a/ports/penguincommand/Penguin Command.sh b/ports/penguincommand/Penguin Command.sh index 8f4fbf434d..af9bf26be2 100644 --- a/ports/penguincommand/Penguin Command.sh +++ b/ports/penguincommand/Penguin Command.sh @@ -13,8 +13,6 @@ else fi source $controlfolder/control.txt -source $controlfolder/device_info.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -32,8 +30,7 @@ export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" export XDG_DATA_HOME="$CONFDIR" export TEXTINPUTINTERACTIVE="Y" -$ESUDO rm -rf ~/.penguin-command -ln -sfv $GAMEDIR/conf/.penguin-command ~/ +bind_directories ~/.penguin-command $GAMEDIR/conf/.penguin-command cd $GAMEDIR @@ -44,4 +41,4 @@ $GPTOKEYB "$BINARY" -c ./$BINARY.gptk & $ESUDO kill -9 $(pidof gptokeyb) $ESUDO systemctl restart oga_events & -printf "\033c" > /dev/tty0 \ No newline at end of file +printf "\033c" > /dev/tty0 diff --git a/ports/rockdodger/Rockdodger.sh b/ports/rockdodger/Rockdodger.sh index dee07bf469..eefea25211 100644 --- a/ports/rockdodger/Rockdodger.sh +++ b/ports/rockdodger/Rockdodger.sh @@ -13,7 +13,6 @@ else fi source $controlfolder/control.txt - [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" get_controls @@ -32,8 +31,7 @@ export XDG_DATA_HOME="$CONFDIR" export TEXTINPUTINTERACTIVE="Y" #bind_directories not compatible with single files -$ESUDO rm -rf ~/.rockdodger_high -ln -sfv $GAMEDIR/conf/.rockdodger_high ~/ +bind_files ~/.rockdodger_high $GAMEDIR/conf/.rockdodger_high cd $GAMEDIR @@ -41,4 +39,4 @@ $GPTOKEYB2 "$BINARY" -c ./$BINARY.gptk & pm_platform_helper "$GAMEDIR/$BINARY" ./$BINARY -k -f -pm_finish \ No newline at end of file +pm_finish