Table of Contents
- Basic Setup
- Add usb0 setup in /etc/network/interfaces
- Modify /home/cpi/.bashrc
- Modify apt-get source (/etc/apt/sources.list) [ optional]
- Install awesome desktop environment
- Kernel
- Update Launcher
- Third-party opensource games
- Download 21_Indie Games.tar.gz
- Extract 21_Indie Games into designated folder
- Install nodejs,GSPLauncher
- Clone games under GSPLauncher
- Bluetooth Setup
- Install Love2D
- RetroArch fullscreen mode modification
- Reboot
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This tutorial showes how to manually upgrade Clockworkpi OS V0.1 to V0.2. All instrutctions done by ssh login to GameShell. It's recommended to download into /tmp folder, and use cpi account with sudo to avoid user permission problems.
Basic Setup
Add usb0 setup in /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
allow-hotplug usb0
auto usb0
iface usb0 inet static
address 192.168.10.1
netmask 255.255.255
Modify /home/cpi/.bashrc
Modify startx part at the end of /home/cpi/.bashrc
Original content:
if [ -f /tmp/autologin ]
then
rm -f /tmp/autologin
mpd ~/.mpd.conf
startx -- -nocursor > /dev/null 2>&1
fi
Change to
if [ -f /tmp/autologin ]
then
rm -f /tmp/autologin
mpd ~/.mpd.conf
startx /home/cpi/launcher/.xinitrc -- -nocursor > /dev/null 2>&1
fi
Modify apt-get source (/etc/apt/sources.list) [ optional]
# deb http://cdn-fastly.deb.debian.org/debian/ stable main
deb http://cdn-fastly.deb.debian.org/debian/ stable main contrib
deb-src http://cdn-fastly.deb.debian.org/debian/ stable main
deb http://security.debian.org/debian-security stable/updates main
deb-src http://security.debian.org/debian-security stable/updates main
# stable-updates, previously known as 'volatile'
deb http://cdn-fastly.deb.debian.org/debian/ stable-updates main
deb-src http://cdn-fastly.deb.debian.org/debian/ stable-updates main
sudo apt-get update
Install awesome desktop environment
sudo apt-get -y install awesome
Kernel
Download all files from https://github.com/clockworkpi/Kernel/tree/master/v0.2 into your GameShell
Links to download:
wget https://github.com/clockworkpi/Kernel/raw/master/v0.2/sun8i-r16-clockworkpi-cpi3-hdmi.dtb
wget https://github.com/clockworkpi/Kernel/raw/master/v0.2/sun8i-r16-clockworkpi-cpi3.dtb
wget https://github.com/clockworkpi/Kernel/raw/master/v0.2/u-boot-sunxi-with-spl.bin
wget https://github.com/clockworkpi/Kernel/raw/master/v0.2/uImage
Write bootloader
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
Update new kernel and .dtb file
sudo mount /dev/mmcblk0p1 /media
sudo cp -rf sun8i-r16* /media
sudo cp -rf uImage /media
sudo umount /dev/mmcblk0p1
Update Launcher
launcher
cd ~/
git clone https://github.com/clockworkpi/launcher.git
cd ~/launcher
git pull; git reset --hard e3ffcf3
launchergo
cd ~/
git clone https://github.com/clockworkpi/launchergo.git
cd ~/launchergo
git pull; git reset --hard d23e15f
Third-party opensource games
From https://mega.nz/#!dRMRkIoS!A6SuJR5NlM5-QOPWyAx34DRNsmMpkoKS56ReIgUARc4
Download 21_Indie Games.tar.gz
21_Indie Games.tar.gz (2dcaba42296be547435175a71082cb4d)
Extract 21_Indie Games into designated folder
mkdir ~/apps/Menu
tar zxvf 21_Indie\ Games.tar.gz -C ~/apps/Menu
Install nodejs,GSPLauncher
cd ~/apps
wget https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/v0.27.6/nwjs-sdk-v0.27.6-linux-arm.tar.gz
tar zxvf nwjs-sdk-v0.27.6-linux-arm.tar.gz
sudo apt-get -y install libnss3-dev
Clone games under GSPLauncher
cd ~/games
git clone https://github.com/cuu/GSP.git
Bluetooth Setup
Download files
From https://github.com/clockworkpi/bluetooth download two files, skip others
Links to download
-
wget https://github.com/clockworkpi/bluetooth/raw/master/bcm43438a0.hcd
-
wget https://github.com/clockworkpi/bluetooth/raw/master/brcm_patchram_plus
Copy Bluetooth firmware bcm43438a0.hcd into /lib/firmware/brcm/
sudo cp bcm43438a0.hcd /lib/firmware/brcm/
Copy bluetooth firmware writer from brcm_patchram_plus into /usr/bin/ , and add executable right
sudo cp brcm_patchram_plus /usr/bin/
sudo chmod +x /usr/bin/brcm_patchram_plus
Install Linux bluetooth support
sudo apt-get install bluez
Configurate startup script, for auto prepare bluetooth when system boots
sudo su
cat <<EOF >/etc/rc.local
#!/bin/sh -e
sleep 15
brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a0.hcd --enable_hci --bd_addr B0:F1:EC:2D:07:5B --no2bytes --tosleep 5000 /dev/ttyS1 &
EOF
chmod +x /etc/rc.local
systemctl daemon-reload
systemctl start rc-local
systemctl status rc-local
systemctl enable bluetooth
Add two lines in /etc/systemd/system/dbus-org.bluez.service , to restart bluetooth service from unexpected stops
Restart=always
RestartSec=3
At [Service] part,
ProtectSystem=full
Add two lines here
Install Love2D
Download love2d deb package
wget http://ppa.launchpad.net/bartbes/love-stable/ubuntu/pool/main/l/love/love_11.1ppa1_armhf.deb
wget http://ppa.launchpad.net/bartbes/love-stable/ubuntu/pool/main/l/love/liblove0_11.1ppa1_armhf.deb
Install
sudo apt-get install -y libluajit-5.1-2 libluajit-5.1-common
sudo dpkg -i liblove0_11.1ppa1_armhf.deb
sudo dpkg -i love_11.1ppa1_armhf.deb
mkdir ~/games/Love2D
RetroArch fullscreen mode modification
~/.config/retroarch/retroarch.cfg
sed -i '/video_fullscreen =/c\video_fullscreen = "true"' ~/.config/retroarch/retroarch.cfg
sed -i '/video_windowed_fullscreen/c\video_windowed_fullscreen = "true"' ~/.config/retroarch/retroarch.cfg
Reboot
sudo reboot