2023-05-09 16:30:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2023-10-24 13:59:09 +00:00
|
|
|
# Copyright (C) 2022-present - The JELOS Project (https://github.com/JustEnoughLinuxOS)
|
2023-05-09 16:30:48 +00:00
|
|
|
|
|
|
|
. /etc/profile
|
2023-11-10 14:40:16 +00:00
|
|
|
jslisten set "PortMaster"
|
2023-05-09 16:30:48 +00:00
|
|
|
|
|
|
|
#Make sure PortMaster exists in .config/PortMaster
|
|
|
|
if [ ! -d "/storage/.config/PortMaster" ]; then
|
2023-11-13 17:15:48 +00:00
|
|
|
mkdir -p "/storage/.config/PortMaster"
|
2023-05-09 16:30:48 +00:00
|
|
|
cp -r "/usr/config/PortMaster" "/storage/.config/"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd /storage/.config/PortMaster
|
|
|
|
|
2023-11-10 00:08:15 +00:00
|
|
|
#Grab the latest control.txt
|
2023-07-06 03:18:52 +00:00
|
|
|
cp /usr/config/PortMaster/control.txt control.txt
|
2023-11-13 17:15:48 +00:00
|
|
|
cp /usr/config/PortMaster/mapper.txt mapper.txt
|
2023-05-09 16:30:48 +00:00
|
|
|
|
|
|
|
#Use our gamecontrollerdb.txt
|
2023-11-10 00:08:15 +00:00
|
|
|
rm -r gamecontrollerdb.txt
|
2023-05-25 13:21:03 +00:00
|
|
|
ln -sf /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt gamecontrollerdb.txt
|
2023-05-09 16:30:48 +00:00
|
|
|
|
2023-11-10 00:08:15 +00:00
|
|
|
#Delete old PortMaster fold first (we can probably remove this later)
|
|
|
|
if [ ! -f "/storage/roms/ports/PortMaster/pugwash" ]; then
|
|
|
|
rm -r /storage/roms/ports/PortMaster
|
|
|
|
fi
|
2023-05-09 16:30:48 +00:00
|
|
|
|
|
|
|
#Make sure roms/ports/PortMaster folder exists
|
|
|
|
if [ ! -d "/storage/roms/ports/PortMaster" ]; then
|
2023-11-10 00:08:15 +00:00
|
|
|
unzip /usr/config/PortMaster/release/PortMaster.zip -d /storage/roms/ports/
|
|
|
|
chmod +x /storage/roms/ports/PortMaster/PortMaster.sh
|
2023-05-09 16:30:48 +00:00
|
|
|
fi
|
|
|
|
|
2023-11-14 15:10:50 +00:00
|
|
|
#We dont use tasksetter, delete it
|
|
|
|
if [ ! -f /storage/roms/ports/PortMaster/tasksetter ]; then
|
|
|
|
rm -r /storage/roms/ports/PortMaster/tasksetter
|
|
|
|
fi
|
|
|
|
|
2023-11-10 00:08:15 +00:00
|
|
|
#Use PortMasters gptokeyb
|
|
|
|
rm gptokeyb
|
|
|
|
cp /storage/roms/ports/PortMaster/gptokeyb gptokeyb
|
2023-05-09 16:30:48 +00:00
|
|
|
|
|
|
|
#Copy over required files for ports
|
|
|
|
cp /storage/.config/PortMaster/control.txt /storage/roms/ports/PortMaster/control.txt
|
2023-05-25 13:27:19 +00:00
|
|
|
cp /storage/.config/PortMaster/gamecontrollerdb.txt /storage/roms/ports/PortMaster/gamecontrollerdb.txt
|
2023-07-05 04:13:47 +00:00
|
|
|
cp /usr/bin/oga_controls* /storage/roms/ports/PortMaster/
|
|
|
|
|
2023-11-14 15:10:50 +00:00
|
|
|
#Hide PortMaster folder in ports
|
|
|
|
if [ ! -f /storage/roms/ports/gamelist.xml ]; then
|
|
|
|
echo "<gameList>
|
|
|
|
<folder>
|
|
|
|
<path>./PortMaster</path>
|
|
|
|
<name>PortMaster</name>
|
|
|
|
<hidden>true</hidden>
|
|
|
|
</folder>
|
|
|
|
</gameList>" > /storage/roms/ports/gamelist.xml
|
|
|
|
else
|
2023-11-15 22:48:11 +00:00
|
|
|
xmlstarlet ed --inplace -d "/gameList/folder[name='PortMaster']" /storage/roms/ports/gamelist.xml
|
|
|
|
xmlstarlet ed --inplace -d "/gameList/game[name='PortMaster']" /storage/roms/ports/gamelist.xml
|
|
|
|
xmlstarlet ed --inplace --subnode "/gameList" --type elem -n folder -v "" /storage/roms/ports/gamelist.xml
|
|
|
|
xmlstarlet ed --inplace --subnode "/gameList/folder[last()]" --type elem -n path -v "./PortMaster" /storage/roms/ports/gamelist.xml
|
|
|
|
xmlstarlet ed --inplace --subnode "/gameList/folder[last()]" --type elem -n name -v "PortMaster" /storage/roms/ports/gamelist.xml
|
|
|
|
xmlstarlet ed --inplace --subnode "/gameList/folder[last()]" --type elem -n hidden -v "true" /storage/roms/ports/gamelist.xml
|
2023-11-14 15:10:50 +00:00
|
|
|
fi
|
|
|
|
|
2023-05-09 16:30:48 +00:00
|
|
|
#Start PortMaster
|
2023-11-10 00:08:15 +00:00
|
|
|
@LIBEGL@
|
|
|
|
cd /storage/roms/ports/PortMaster
|
|
|
|
run ./PortMaster.sh 2>/dev/null
|