wolf: fix Dolphin Sys folder writing to the wrong directory

Confirmed live: RetroArch's system_directory on this Wolf setup is
"~/bioses" (GoW's own shipped default, confirmed by reading a real
retroarch.cfg directly — wolf.sh never sets this itself), not RetroArch's
usual default of ~/.config/retroarch/system. The Dolphin Sys-folder
automation added earlier this session assumed the usual default and wrote
to retroarch/system/dolphin-emu/Sys on the host — a path RetroArch's own
config never actually reads, so it would have sat there doing nothing.

Now reads the real configured system_directory value out of
retroarch.cfg instead of assuming, and self-heals by moving a Sys folder
that's already sitting in the old wrong location (from before this fix)
into the correct one. Also corrects the same wrong assumption in the
MAME samples-directory documentation, which pointed at the same
retroarch/system/ default.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLX1yYKJExGSXmgUhxKQG6
This commit is contained in:
Claude
2026-09-02 19:16:05 +00:00
parent 2e7e073b63
commit 0fe0c74235
+33 -8
View File
@@ -1874,7 +1874,28 @@ fuse scummvm"
# own repo (Data/Sys), so fetch it here too instead of requiring that # own repo (Data/Sys), so fetch it here too instead of requiring that
# GUI step. Sparse+shallow checkout — the full repo is large, this # GUI step. Sparse+shallow checkout — the full repo is large, this
# folder isn't. # folder isn't.
SYS_DIR="$GAME_DIR/retroarch/system/dolphin-emu/Sys" #
# Confirmed live: RetroArch's own docs say this goes under
# system_directory/dolphin-emu/Sys, and GoW's own shipped
# retroarch.cfg sets system_directory = "~/bioses" — NOT RetroArch's
# usual default of ~/.config/retroarch/system. An earlier version of
# this script assumed the default and wrote to the wrong place
# (retroarch/system/dolphin-emu/Sys on the host, which the real
# config never reads). Read the actual configured value instead of
# assuming, and self-heal by moving a Sys folder that's already
# sitting in that old wrong location.
_RA_SYS_CFG=$(grep -i '^system_directory' "$GAME_DIR/retroarch/retroarch.cfg" 2>/dev/null \
| sed -E 's/^system_directory[[:space:]]*=[[:space:]]*"([^"]*)".*/\1/')
case "$_RA_SYS_CFG" in
"~/.config/retroarch/system") SYS_DIR="$GAME_DIR/retroarch/system/dolphin-emu/Sys" ;;
*) SYS_DIR="$GAME_DIR/bios/dolphin-emu/Sys" ;;
esac
OLD_SYS_DIR="$GAME_DIR/retroarch/system/dolphin-emu/Sys"
if [ "$OLD_SYS_DIR" != "$SYS_DIR" ] && [ -d "$OLD_SYS_DIR" ] && [ ! -d "$SYS_DIR" ]; then
mkdir -p "$(dirname "$SYS_DIR")"
mv "$OLD_SYS_DIR" "$SYS_DIR"
echo "Moved Dolphin's Sys folder to the location RetroArch's own config actually reads: $SYS_DIR"
fi
if [ -f "$CORES_DIR/dolphin_libretro.so" ] && [ ! -d "$SYS_DIR" ]; then if [ -f "$CORES_DIR/dolphin_libretro.so" ] && [ ! -d "$SYS_DIR" ]; then
echo "Fetching Dolphin's Sys folder (needed for GameCube/Wii to boot)..." echo "Fetching Dolphin's Sys folder (needed for GameCube/Wii to boot)..."
SYS_TMP=$(mktemp -d) SYS_TMP=$(mktemp -d)
@@ -3579,13 +3600,17 @@ exact same \`.zip\`-per-game naming as real ROMs, so if they're sitting in
\`roms/mame/\` alongside your actual ROM set, ES-DE/RetroArch's MAME core \`roms/mame/\` alongside your actual ROM set, ES-DE/RetroArch's MAME core
lists them as if they were games too — there's no reliable filename-only lists them as if they were games too — there's no reliable filename-only
way to tell them apart (a samples zip and a ROM zip for the same game can way to tell them apart (a samples zip and a ROM zip for the same game can
share the identical name). They belong in RetroArch's system directory share the identical name). They belong in RetroArch's \`system_directory\`
instead, under a MAME-core-specific \`samples/\` subfolder (e.g. instead, under a MAME-core-specific \`samples/\` subfolder — check
\`retroarch/system/mame2003-plus/samples/\` for MAME2003-Plus — the exact \`retroarch/retroarch.cfg\`'s own \`system_directory\` value before assuming
subfolder name depends on which MAME core variant you're using), never in a path (confirmed live: on this repo's Wolf setup it's actually \`bios/\`,
\`roms/mame/\` itself. A samples zip's contents are almost entirely \`.wav\` not RetroArch's usual default of \`retroarch/system/\` — the same thing
files where a real ROM zip's aren't, which is the practical way to tell that bit Dolphin's \`Sys\` folder earlier), so most likely
them apart if you're not sure which of your files are which. \`bios/mame2003-plus/samples/\` for MAME2003-Plus (the exact subfolder name
depends on which MAME core variant you're using), never in \`roms/mame/\`
itself. A samples zip's contents are almost entirely \`.wav\` files where a
real ROM zip's aren't, which is the practical way to tell them apart if
you're not sure which of your files are which.
## Troubleshooting: app exits immediately ("Permission denied") ## Troubleshooting: app exits immediately ("Permission denied")
If a launcher (Steam, etc.) closes the moment it opens, its Wolf-managed home If a launcher (Steam, etc.) closes the moment it opens, its Wolf-managed home