From f62928e73a485efb543817af0fed2238d2c71a22 Mon Sep 17 00:00:00 2001 From: jenny92-tech <259030800+jenny92-tech@users.noreply.github.com> Date: Tue, 19 May 2026 16:55:52 +0800 Subject: [PATCH 1/2] device_info: detect MiniLoong CFW via /loong/loong_version 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. --- PortMaster/device_info.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PortMaster/device_info.txt b/PortMaster/device_info.txt index eae1725..9f38c2e 100755 --- a/PortMaster/device_info.txt +++ b/PortMaster/device_info.txt @@ -49,7 +49,11 @@ fi CFW_NAME="Unknown" CFW_VERSION="Unknown" -if [ -f "/usr/share/plymouth/themes/text.plymouth" ]; then +if [ -f "/loong/loong_version" ]; then + CFW_NAME="Loong" + CFW_VERSION=$(cat /loong/loong_version 2>/dev/null | grep -o '"verShow"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4) + [ -z "$CFW_VERSION" ] && CFW_VERSION="Unknown" +elif [ -f "/usr/share/plymouth/themes/text.plymouth" ]; then CFW_INFO=$(grep "title=" "/usr/share/plymouth/themes/text.plymouth") CFW_FFS=$(grep -a "title=" "/usr/share/plymouth/themes/text.plymouth" | cut -d'=' -f 2- | tr -cd 'a-zA-Z' | tr '[:upper:]' '[:lower:]') From cd92efd69e2ea45de71dbe4b7d2e837eb8eaf257 Mon Sep 17 00:00:00 2001 From: jenny92-tech <259030800+jenny92-tech@users.noreply.github.com> Date: Tue, 19 May 2026 17:51:21 +0800 Subject: [PATCH 2/2] mod_Loong: add MiniLoong CFW-specific overrides Companion to the MiniLoong probe in device_info.txt. Follows the existing mod_.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. --- PortMaster/mod_Loong.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 PortMaster/mod_Loong.txt diff --git a/PortMaster/mod_Loong.txt b/PortMaster/mod_Loong.txt new file mode 100644 index 0000000..58516dc --- /dev/null +++ b/PortMaster/mod_Loong.txt @@ -0,0 +1,30 @@ +#!/bin/bash +# +# SPDX-License-Identifier: MIT +# + +## Modular - Loong +# +# A modular file that is sourced for specific script lines required by ports running on MiniLoong. +# +# usage `[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"` + +# Set virtual screen +CUR_TTY="/dev/fd/1" + +# Use for Godot 2 +GODOT2_OPTS="-r ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} -f" + +# Use for Godot 3+ +GODOT_OPTS="--resolution ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} -f" + +export directory="mnt/sdcard/roms" + +pm_platform_helper() { + if [ -e "$PM_PIPE" ]; then + PortMasterDialogExit + fi + + # DO SOMETHING HERE + printf "" +}