grout icon indicating copy to clipboard operation
grout copied to clipboard

Compatibility Breaks on muOS Andromeda (UnionFS Removed & Shift to Pickles Frontend Saves)

Open greywolf1499 opened this issue 2 months ago • 1 comments

Testing Grout on the latest muOS Andromeda alpha/test builds reveals two major compatibility breaks due to deep architectural overhauls in the OS filesystem layout. This issue details the root causes and proposes sustainable architectural changes to handle muOS’s new storage configuration and the introduction of the "Pickles" frontend.


1. ROMs Directory Crash (UnionFS Removal)

  • The Error: At application boot, the UI gets stuck on Rom Directory not found. The log file exposes the following halting error:
    {"time":"2026-09-09T00:07:41.242662994+01:00","level":"ERROR","msg":"failed to read ROM directory","error":"open /mnt/union/ROMS: no such file or directory"}
    
  • Root Cause: Grout's binary expects to scan a UnionFS layer at /mnt/union/ROMS (from an earlier Andromeda implementation). However, muOS developers have officially stripped UnionFS completely out of the latest test builds.
  • Proposed Solutions:
    • Option A: Implement a validation check at boot to scan which raw volume exists (/mnt/sdcard/ROMS or /mnt/mmc/ROMS) and prompt the user to select their preference.
    • Option B (Ideal): Query muOS's own internal system configurations directly to read which storage device the user has actively designated as the default target for ROMs.

2. Save Directory Sync Broken (The "Pickles" Frontend Shift)

  • The Error: Saves download successfully via the RomM API but are written to obsolete pathways that the emulators never read.
    {"time":"2026-09-09T00:58:31.83745345+01:00","level":"DEBUG","msg":"Download successful","path":"/run/muos/storage/save/file/mGBA/WarioWare, Inc. - Mega Microgame\$! (USA).srm","recordedSlot":"autosave"}
    
  • Root Cause: Grout currently appends static structures like file/mGBA/ onto /run/muos/storage/save/ (the legacy RetroArch paths). Andromeda introduces a native frontend called "Pickles", which deprecates old paths and shifts files to lowercase structures on the physical card: /mnt/sdcard/muos/save/pickles/sram/<core>/<system or the system folder used, i.e. - gba in my case>.
  • Proposed Solution: Because RetroArch remains accessible as a secondary choice alongside Pickles in Andromeda, hardcoding a single new directory isn't sufficient.
    • The Fix: Introduce an option allowing users to toggle their preferred Frontend per-system within Grout. This shifts the internal save path generation model to a dynamic construction: Base Path + Frontend Selection + Core Target. This structure can be handled cleanly by expanding Grout's internal system mapping JSON layout.

Tested Workaround Layer (mux_launch.sh):

To maintain workflow testing, I modified Grout’s local startup script (mux_launch.sh) to act as a virtual bridge. It spoofs the missing UnionFS layout via a bind mount, maps legacy mixed-case core targets to Andromeda's new lowercase Pickles directory structures, and cleanly unmounts everything upon exiting the application to prevent system double-vision:

#!/bin/bash
. /opt/muos/script/var/func.sh
echo app >/tmp/act_go
GOV_GO="/tmp/gov_go"
[ -e "\$GOV_GO" ] && cat "\(GOV_GO" >"\)(GET_VAR "device" "cpu/governor")"

CUR_DIR="\$(dirname "\$0")"
GROUT_ICON_PATH="\${CUR_DIR}/resources/grout.png"
CURRENT_THEME_FILE="/opt/muos/config/theme/active"

# --- MUOS ANDROMEDA COMPATIBILITY WORKAROUND ---
rm -rf /mnt/union && mkdir -p /mnt/union
if ! mountpoint -q /mnt/union; then
    mount --bind /mnt/sdcard/ROMS /mnt/union
fi

setup_pickles_routing() {
    sleep 2
    mkdir -p /run/muos/storage/save/file
    ln -sf /mnt/sdcard/muos/save/pickles/sram/mgba/gba /run/muos/storage/save/file/mGBA
    ln -sf /mnt/sdcard/muos/save/pickles/sram/snes9x/snes /run/muos/storage/save/file/Snes9x
    ln -sf /mnt/sdcard/muos/save/pickles/sram/nestopia/nes /run/muos/storage/save/file/Nestopia
    ln -sf /mnt/sdcard/muos/save/pickles/sram/gambatte/gb /run/muos/storage/save/file/Gambatte
    ln -sf /mnt/sdcard/muos/save/pickles/sram/gambatte/gbc /run/muos/storage/save/file/Gambatte
    ln -sf /mnt/sdcard/muos/save/pickles/sram/pcsx_rearmed/psx /run/muos/storage/save/file/PCSX-ReARMed
    ln -sf /mnt/sdcard/muos/save/pickles/sram/genesis_plus_gx/genesis /run/muos/storage/save/file/Genesis\ Plus\ GX
}
setup_pickles_routing &
# -----------------------------------------------

ICON_DIR=/opt/muos/share/theme/active/glyph/muxapp/
cp "\({GROUT_ICON_PATH}" "\){ICON_DIR}/grout.png"
THEME=(cat "CURRENT_THEME_FILE")
if [ -n "\$THEME" ]; then
    TARGETS=("/opt/muos/browse/SD1 (mmc)/MUOS/theme/THEME/glyph/muxapp" "/opt/muos/browse/SD2 (sdcard)/MUOS/theme/{THEME}/glyph/muxapp")
    for DIR in "\${TARGETS[@]}"; do
        [ -d "\$DIR" ] && cp "\(GROUT_ICON_PATH" "\)DIR/grout.png"
    done
fi

cd "\$CUR_DIR" || exit 1
[ -d "../.update" ] && cp -rf ../.update/* .. && rm -rf ../.update

export CFW=MUOS
export LD_LIBRARY_PATH=\(CUR_DIR/lib:\)LD_LIBRARY_PATH
./grout

# --- POST-EXIT SANITISATION ---
umount /mnt/union 2>/dev/null
rm -rf /mnt/union
rm -rf /run/muos/storage/save/file/* 2>/dev/null

Environment Info:

  • OS: muOS Andromeda (Testing / Alpha Branch)
  • Grout Version: Latest compiled binary layout

greywolf1499 avatar Sep 10 '26 10:09 greywolf1499

Will be in the v5.3.0.0 release.

BrandonKowalski avatar Sep 28 '26 03:09 BrandonKowalski