[Tutorial] Rebuilding Gameshell from Clean Install

I ran into a little problem the other day (Again!), where ClockworkOS became corrupted to the point of being un-bootable. Yet again, I had to start over from scratch.

Fortunately, I had previously backed up my ~/games & ~/apps/emulators so all I needed to do was re-install the emulators, support files & scripts. After exhaustive searching the ClockWork forums, I was able to piece together everything and get it functioning again; Only to screw it up again and having to start over yet again.

This time, I decided to write down the steps with the changes for ClockWorkOS_v2.1 (This should work with v3.0 as well…) Note that most of the instructions do not cover acquiring the Emulator files, ROMs & BIOS files since I already had those backed up. Each process included a link to the forum topic where the information was gleaned from.

Let’s start. The first topic covers setup of the ClockworkOS after initial install. I’m assuming you already know how to flash the image. If not, follow the process at How to reinstall the OS.


Initial Setup:
Create BIOS folder

mkdir ~/apps/emulators/bios

Configure RetroArch by launching it. Go to Settings -> Input -> Hotkey Binds
Change Quit RetroArch to (Key: backspace) (Shift-Menu)
This will exit RetroArch. Launch RetroArch again and go to Settings -> Directory
Change System/BIOS to /home/cpi/apps/emulators/bios
Connect to your GameShell with SSH. Paste the following to expand your filesystem & update lots of stuff!

bash <(curl -s https://raw.githubusercontent.com/hpcodecraft/gameshell-setup/master/run.sh)

Thanks @hpcodecraft!

Note: Answer N to the query for expanding your filesystem. The script has it backward.

Now were ready to reinstall our games!


4DO: 3DO core doesn't load
From SSH:

cd
git clone https://github.com/libretro/4do-libretro.git
cd 4do-libretro
make -j 4
cp 4do_libretro.so /home/cpi/apps/emulators
mkdir /home/cpi/games/4DO
mkdir /home/cpi/apps/Menu/20_Retro\ Games/4DO
cd /home/cpi/apps/Menu/20_Retro\ Games/4DO
echo "ROM=/home/cpi/games/4DO" > action.config
echo "ROM_SO=/home/cpi/apps/emulators/4do_libretro.so" >> action.config
echo "EXT=iso,bin,chd,cue" >> action.config
echo "LAUNCHER=retroarch -L" >> action.config
echo "TITLE=4DO Roms" >> action.config

Place one of the following in /home/cpi/apps/emulators/bios

  • goldstar.bin
  • panafz1.bin
  • panafz10.bin
  • sanyotry.bin

Cannonball: Lets play Cannonball (Outrun)
Open RetroArch on your GameShell
Select Load Cores
Select Download Core
Select Cannonball and download the core
Quit Retroarch

From SSH:

mv ~/.config/retroarch/cores/cannonball_libretro.so ~/apps/emulators
mkdir ~/games/Cannonball
touch ~/games/Cannonball/Cannonball.game
mkdir ~/apps/Menu/20_Retro\ Games/Cannonball
echo "retroarch -L /home/cpi/apps/emulators/cannonball_libretro.so /home/cpi/games/Cannonball/Cannonbal.game" > ~/apps/Menu/20_Retro\ Games/Cannonball/Cannonball.sh

Extract files from outrun.zip to ~/games/Cannonball/


CommanderGenius: Let's play Commander Keen
From SSH:

wget https://gitlab.com/Oet/Commander-Genius/uploads/edd704e814e9af202266068a05ff6be3/CommanderGenius.zip
unzip CommanderGenius.zip
mv CommanderGenius/ /home/cpi/games/
ln -s /home/cpi/games/CommanderGenius /home/cpi/.CommanderGenius/games
mkdir /home/cpi/apps/Menu/CommanderGenius
echo /home/cpi/games/CommanderGenius/CommanderGenius > /home/cpi/apps/Menu/CommanderGenius/CommanderGenius.sh
wget https://gitlab.com/Oet/Commander-Genius/uploads/4fef7d77bce50d5d141ff6a622ad8c52/CommanderGenius.png -P /home/cpi/apps/Menu/CommanderGenius

Daphne : Daphne / No Sound
Note: This game is not fully functional yet!
From SSH:

wget http://buildbot.libretro.com/nightly/linux/armv7-neon-hf/latest/
unzip daphne_libretro.so.zip
mv daphne_libretro.so ~/apps/emulators
mkdir ~/apps/Menu/20_Retro\ Games/DAPHNE
cd ~/apps/Menu/20_Retro\ Games/DAPHNE
echo "ROM=/home/cpi/games/DAPHNE/roms" > action.config
echo "ROM_SO=/home/cpi/apps/emulators/daphne_libretro.so" >> action.config
echo "EXT=zip" >> action.config
echo "LAUNCHER=retroarch -L" >> action.config
echo "TITLE=DAPHNE Roms" >> action.config
echo "SO_URL=http://buildbot.libretro.com/nightly/linux/armv7-neon-hf/latest/daphne_libretro.so.zip" >> action.config
mkdir /home/cpi/games/DAPHNE

Place files into games/DAPHNE:

/home/cpi/games/Daphne/
	framefile/
		lair.txt (change first line "../lair.daphne")
	roms/
		lair.zip
	lair.daphne/
		lair.m2v
		lair.ogg
		lair.txt
	pics/
		all from Daphne install
	sound/
		all from Daphne install

Duke Nukem 3D: Let's play Duke Nukem 3D!
From SSH:

cd
sudo apt update && sudo apt install libflac-dev libsdl2-mixer-dev libvorbis-dev libvpx-dev
wget -r --no-parent https://svn.eduke32.com/eduke32/
cd svn.eduke32.com/eduke32/
make
mkdir ~/games/Duke3D
cp eduke32 ~/games/Duke3D
Copy purchased DUKE3D.GRP to this folder also.
mkdir ~/apps/Menu/Duke\ Nukem\ 3D
cd ~/apps/Menu/Duke\ Nukem\ 3D
echo 'cd ~/games/Duke3D' > 'Duke Nukem 3D.sh'
echo './eduke32' >> 'Duke Nukem 3D.sh'

rm -r ~/svn.eduke32.com

FloppyBird: Lets play FloppyBird
Open RetroArch on your GameShell
Select Load Cores
Select Download Core
Select Chailove
Quit RetroArch

From SSH:

cd ~/.config/retroarch/cores
mv chailove_libretro.so /home/cpi/apps/emulators
cd ~/games/
git clone --depth=1 https://github.com/RobLoach/ChaiLove-FloppyBird.git FloppyBird
cd FloppyBird
rm -rf .git

mkdir ~/apps/Menu/20_Retro\ Games/FloppyBird
echo retroarch -L /home/cpi/apps/emulators/chailove_libretro.so /home/cpi/games/FloppyBird/main.chai > ~/apps/Menu/20_Retro\ Games/FloppyBird/FloppyBird.sh

Pcsx: PCSX ReARMed for GameShell
From SSH:

cd ~/launcher/Menu/GameShell/20_Retro\ Games
git clone https://github.com/cuu/Pcsx.git
mkdir -p Pcsx/bios
cp ~/apps/emulators/bios/SCPH1001.bin Pcsx/bios

Note: If you don’t have the SCPH1001.bin file in your bios folder, you’ll have to get it from elsewhere and install it as above.


QUAKE: How about some Quake!
From SSH:

sudo apt-get update && sudo apt-get -y install quakespasm
cd ~/ && mkdir -p /home/cpi/games/QUAKE/Quake1/id1

Copy the pak0.pak and pak1.pak files, from your CD, to /home/cpi/games/QUAKE/Quake1/id1

mkdir /home/cpi/apps/Menu/Quake/
echo "/usr/games/quakespasm -width 320 -height 240 -basedir /home/cpi/.quakespasm/" > /home/cpi/apps/Menu/Quake/Quake.sh
chmod 755 /home/cpi/apps/Menu/Quake/Quake.sh

mkdir -p ~/.quakespasm/
cd ~/.quakespasm/ && ln -s /home/cpi/games/QUAKE/Quake1/id1 .

Wolfenstein 3D: Let's play Wolfenstein-3D!
From SSH:

mkdir "~/apps/Menu/Wolfenstein 3D"
cd "~/apps/Menu/Wolfenstein 3D"
echo "sudo ln -s ~/games/Wolf3D /usr/share/games/wolf3d" > 'Wolfenstein 3D.sh'
echo "wolf4sdl --res 320 240" >> 'Wolfenstein 3D.sh'
echo "sudo unlink /usr/share/games/wolf3d" >> 'Wolfenstein 3D.sh'
wget http://icons.iconarchive.com/icons/3xhumed/mega-games-pack-28/128/Wolfenstein-3d-2-icon.png
mv Wolfenstein-3d-2-icon.png 'Wolfenstein 3D.png'

Spear of Destiny: Let's play Wolfenstein-3D!
From SSH:

mkdir '~/apps/Menu/Spear of Destiny'
cd '~/apps/Menu/Spear of Destiny'
echo "sudo ln -s ~/games/Spear /usr/share/games/wolf3d" > 'Spear of Destiny.sh'
echo "wolf4sdl-sod --res 320 240" >> 'Spear of Destiny.sh'
echo "sudo unlink /usr/share/games/wolf3d" >> 'Spear of Destiny.sh'
wget http://icons.iconarchive.com/icons/3xhumed/mega-games-pack-28/128/Wolfenstein-Spear-of-Destiny-2-icon.png
mv Wolfenstein-Spear-of-Destiny-2-icon.png 'Spear of Destiny.png'

That’s it for now! If there are games you’d like me to add, please post the details.

8 Likes

great post, thank a lot !

1 Like

Wow, this post is awesome! Thanks a lot for taking the time to write it all down, and double thanks for including my script :slight_smile:

With your tutorials here, I’ll definitely install some more games soon! And maybe extend my scripts a bit…

Thanks for the hint - I’ll try to have a look into that as soon as possible!

1 Like

Nice!Quite useful!!!

1 Like

I tried to reproduce this but no chance, it only starts the expansion script when I type ā€œyā€, everything else skips the step. The script code is also quite distinct, I’m a bit lost here:

printf "${GREEN}Resize the root partition? (y/N): ${NC}"
read MENU_CHOICE

if [ "${MENU_CHOICE}" == "y" ]
then
    ./system/resize_root.sh
else
    echo "Skipped"
fi

If anyone with more shell scripting knowledge (mine is quite limited) has an idea, please share :slight_smile:

Here’s a link to the full script for context: https://github.com/hpcodecraft/gameshell-setup/blob/master/setup_new_gameshell.sh#L28

The if-else block also is copied in all other steps, so I wonder why only the first one seems to behave different. :crazy_face:

It looks right to me too. All I can attest to is the results. If I type ā€˜y’, I get the message ā€œSkipped.ā€; Anything else results in the script executing correctly.

I totally believe you, and @Rene_Rosa reported the same in another thread. I just wonder how this is happening.

Just got this error now doing, yet, another rebuild since I can’t seem to get this damn system to work the way it should… ever:

CXX deps/glslang/glslang/glslang/MachineIndependent/intermOut.cpp
deps/glslang/glslang/glslang/MachineIndependent/intermOut.cpp: In function ā€˜void glslang::OutputDouble(TInfoSink&, double, glslang::TOutputTraverser::EExtraOutput)’:
deps/glslang/glslang/glslang/MachineIndependent/intermOut.cpp:1133:63: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
long long b = reinterpret_cast<long long>(&value);
^
CXX deps/glslang/glslang/glslang/MachineIndependent/Initialize.cpp