From 6bb971606bfec016bd72f596624e7bd027bd83ea Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Sat, 18 Apr 2026 01:33:53 -0300 Subject: [PATCH] Move ROMs to /storage/roms/ directly for easy PC access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously ROMs lived in /storage/games-internal/roms/ and were bind-mounted to /storage/roms/ at runtime. When users mounted the ROMS partition on PC, they had to navigate through games-internal/ to find their ROM folders. Now /storage/roms/ is the actual ROM directory: - Single SD: no bind mount needed, roms/ used directly - Dual SD (merged storage): overlay still works as before - Migration: if games-internal/roms has content, auto-moves to roms/ - Backwards compat: symlink games-internal/roms → roms Users now see their 130 system folders directly in the roms/ directory when they mount the ROMS partition on PC. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../packages/archr/sources/scripts/automount | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/projects/ArchR/packages/archr/sources/scripts/automount b/projects/ArchR/packages/archr/sources/scripts/automount index 6cc9f3f60e..f6492d64d4 100755 --- a/projects/ArchR/packages/archr/sources/scripts/automount +++ b/projects/ArchR/packages/archr/sources/scripts/automount @@ -40,21 +40,36 @@ function start_ms() { ;; esac - for GAME_PATH in internal external - do - if [ ! -d "/storage/games-${GAME_PATH}/roms" ] - then - log $0 "Create /storage/games-${GAME_PATH}/roms." - mkdir -p "/storage/games-${GAME_PATH}/roms" - fi - done + # Ensure roms directory exists directly on the partition + if [ ! -d "/storage/roms" ]; then + mkdir -p "/storage/roms" + fi + + # Migrate: if games-internal/roms has content but roms/ is empty, move it + if [ -d "/storage/games-internal/roms" ] && [ "$(ls -A /storage/games-internal/roms 2>/dev/null)" ] && [ ! "$(ls -A /storage/roms 2>/dev/null)" ]; then + log $0 "Migrating ROMs from games-internal/roms/ to roms/" + mv /storage/games-internal/roms/* /storage/roms/ 2>/dev/null + rmdir /storage/games-internal/roms 2>/dev/null + ln -sf /storage/roms /storage/games-internal/roms 2>/dev/null + fi + + # Backwards compat: symlink games-internal/roms → roms if not already + if [ ! -L "/storage/games-internal/roms" ] && [ ! -d "/storage/games-internal/roms" ]; then + mkdir -p /storage/games-internal + ln -sf /storage/roms /storage/games-internal/roms + fi + + # Ensure external games dir exists for dual-SD support + if [ ! -d "/storage/games-external/roms" ]; then + mkdir -p "/storage/games-external/roms" + fi MS_ENABLED=$(get_setting system.merged.storage) if [ -e "/storage/.ms_unsupported" ] || \ [ ! "${MS_ENABLED}" = 1 ] then - log $0 "Executing bind mount of ${MOUNT_PATH} to ${MS_PATH}" - mount --bind ${MOUNT_PATH}/roms ${MS_PATH} + # Single SD: /storage/roms is used directly (no bind mount needed) + log $0 "Using /storage/roms directly" else log $0 "Enabling merged storage of /storage/games-${LOWER} and /storage/games-${UPPER} to ${MS_PATH}."