[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

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:

git clone
cd 4do-libretro
make -j 4
cp /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/" >> 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/ ~/apps/emulators
mkdir ~/games/Cannonball
touch ~/games/Cannonball/
mkdir ~/apps/Menu/20_Retro\ Games/Cannonball
echo "retroarch -L /home/cpi/apps/emulators/ /home/cpi/games/Cannonball/" > ~/apps/Menu/20_Retro\ Games/Cannonball/

Extract files from to ~/games/Cannonball/

CommanderGenius: Let's play Commander Keen
From SSH:

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/
wget -P /home/cpi/apps/Menu/CommanderGenius

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

mv ~/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/" >> action.config
echo "EXT=zip" >> action.config
echo "LAUNCHER=retroarch -L" >> action.config
echo "TITLE=DAPHNE Roms" >> action.config
echo "SO_URL=" >> action.config
mkdir /home/cpi/games/DAPHNE

Place files into games/DAPHNE:

		lair.txt (change first line "../lair.daphne")
		all from Daphne install
		all from Daphne install

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

sudo apt update && sudo apt install libflac-dev libsdl2-mixer-dev libvorbis-dev libvpx-dev
wget -r --no-parent
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'
echo './eduke32' >> 'Duke Nukem'

rm -r ~/

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 /home/cpi/apps/emulators
cd ~/games/
git clone --depth=1 FloppyBird
cd FloppyBird
rm -rf .git

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

Pcsx: PCSX ReARMed for GameShell
From SSH:

cd ~/launcher/Menu/GameShell/20_Retro\ Games
git clone
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/
chmod 755 /home/cpi/apps/Menu/Quake/

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'
echo "wolf4sdl --res 320 240" >> 'Wolfenstein'
echo "sudo unlink /usr/share/games/wolf3d" >> 'Wolfenstein'
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'
echo "wolf4sdl-sod --res 320 240" >> 'Spear of'
echo "sudo unlink /usr/share/games/wolf3d" >> 'Spear of'
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.


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}"

if [ "${MENU_CHOICE}" == "y" ]
    echo "Skipped"

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:

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