Skip to content

Add MiniLoong CFW support (device_info probe + mod_Loong.txt)#324

Open
jenny92-tech wants to merge 2 commits into
PortsMaster:mainfrom
jenny92-tech:feat/miniloong-cfw-detection
Open

Add MiniLoong CFW support (device_info probe + mod_Loong.txt)#324
jenny92-tech wants to merge 2 commits into
PortsMaster:mainfrom
jenny92-tech:feat/miniloong-cfw-detection

Conversation

@jenny92-tech
Copy link
Copy Markdown

@jenny92-tech jenny92-tech commented May 19, 2026

Summary

Adds support for MiniLoong, a Loongson-based handheld CFW, by following the same two-file pattern used by every existing CFW in the repo (Batocera, knulli, muOS, TrimUI, ROCKNIX, etc.):

  1. PortMaster/device_info.txt — probe /loong/loong_version (a JSON-style version file shipped by the MiniLoong firmware) and set $CFW_NAME=Loong / $CFW_VERSION.
  2. PortMaster/mod_Loong.txt — CFW-specific tweaks loaded via the existing [ -f "$controlfolder/mod_$CFW_NAME.txt" ] && source ... convention. Structurally identical to mod_TrimUI.txt / mod_muOS.txt (same CUR_TTY, Godot opts, pm_platform_helper stub) plus one MiniLoong-specific override.

The MiniLoong-specific override

export directory="mnt/sdcard/roms"

MiniLoong mounts the SD card at /mnt/sdcard/ rather than /roms/. Other CFWs with non-standard mounts (e.g. TrimUI at /mnt/SDCARD) rely on a system-level /roms<real mount> symlink. MiniLoong's firmware does not currently provide one, so ports need this $directory override to resolve $GAMEDIR correctly.

Scope is contained: the override only runs when $CFW_NAME == "Loong", which only triggers when /loong/loong_version exists (a MiniLoong-exclusive path). No other CFW is affected.

Why not patch control.txt to be mount-agnostic instead

Considered and dropped. Generalizing the $directory derivation in control.txt is the more principled fix, but it touches core code used by every CFW and I cannot verify behavior on ArkOS/JELOS/ROCKNIX/muOS/TrimUI etc. without access to those devices. Until that broader testing can be done, the conservative path is to keep the change CFW-local.

Test plan

  • bash -n PortMaster/device_info.txt PortMaster/mod_Loong.txt
  • Verified on a MiniLoong device: CFW_NAME=Loong, CFW_VERSION populated from verShow, mod_Loong.txt sourced by the existing convention, ports launch with $GAMEDIR=/mnt/sdcard/roms/ports/<port>.
  • No diff to control.txt or any non-Loong CFW file, so no risk of regression elsewhere.

Commits

  • device_info: detect MiniLoong CFW via /loong/loong_version
  • mod_Loong: add MiniLoong CFW-specific overrides

MiniLoong is a Loongson-based handheld CFW that identifies itself with
a JSON-style file at /loong/loong_version. Without an explicit probe, the
detection chain falls through to the generic os-release branch and returns
"Unknown" for both name and version, which in turn prevents launchers
from sourcing mod_Loong.txt (loaded by the convention
[ -f "$controlfolder/mod_$CFW_NAME.txt" ] && source ...).

This restores parity with earlier releases that shipped the check.
@jenny92-tech jenny92-tech changed the title device_info: detect MiniLoong CFW via /loong/loong_version PortMaster: make SD-card mount detection generic + add MiniLoong CFW probe May 19, 2026
@jenny92-tech jenny92-tech force-pushed the feat/miniloong-cfw-detection branch from 63a4252 to f75814c Compare May 19, 2026 09:51
@jenny92-tech jenny92-tech changed the title PortMaster: make SD-card mount detection generic + add MiniLoong CFW probe Add MiniLoong CFW support (device_info probe + mod_Loong.txt) May 19, 2026
Companion to the MiniLoong probe in device_info.txt. Follows the existing
mod_<CFW>.txt pattern (CUR_TTY, Godot opts, pm_platform_helper stub).

MiniLoong-specific bit: override $directory to "mnt/sdcard/roms" because the
SD card lives at /mnt/sdcard/, not at /roms/. Other CFWs with non-standard
mounts (e.g. TrimUI at /mnt/SDCARD) rely on a system-level /roms symlink, but
MiniLoong's firmware does not provide one; until/unless that changes upstream
in the MiniLoong image, ports need this override to resolve $GAMEDIR.
@jenny92-tech jenny92-tech force-pushed the feat/miniloong-cfw-detection branch from f75814c to cd92efd Compare May 19, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant