Skip to content

Instantly share code, notes, and snippets.

@Daft-Freak
Last active July 11, 2024 14:59
Show Gist options
  • Save Daft-Freak/96e254b768e91533783e3f115f1da6ea to your computer and use it in GitHub Desktop.
Save Daft-Freak/96e254b768e91533783e3f115f1da6ea to your computer and use it in GitHub Desktop.
RG35XX H Adventures

V1.1.4-240626

Setup

OS based on Ubuntu 22.04 with kernel 4.9. Maybe a little old...

Linux rootfs has a copy of qemu-user-static, seems they want me to chroot into it.

sudo mkdir /mnt/rg35xx

sudo mount /dev/sdd5 /mnt/rg35xx/
cd /mnt/rg35xx/
sudo mount -t proc /proc proc/
sudo mount -t sysfs /sys sys/
sudo mount -o bind /dev dev/
sudo mount -o bind /run run/

sudo chroot . qemu-aarch64-static /bin/bash

This version seems to have an SSH server installed, but no user accounts.

Create a user:

/sbin/adduser username
/sbin/usermod -a -G sudo username

... and fix sudo permissions (it's less broken this time!)

chmod 4755 /usr/bin/sudo
chmod 4755 /usr/libexec/polkit-agent-helper-1

Time to leave and reunite the console with it's SD card:

exit

cd ..
sudo umount --recursive /mnt/rg35xx

Can now connect over SSH using the new user account

Language

Default language is set to Chinese, let's change that as I don't even have the fonts installed...

sudo update-locale LANG=en_GB.UTF-8 LANGUAGE

Some Permissions

Useful for running things as non-root. (Unlike the default launcher)

sudo usermod -a -G video username
sudo usermod -a -G audio username
sudo usermod -a -G input username

Additional Hackery

Need to stop the launcher to run anything manually:

sudo /etc/init.d/launcher.sh stop

SDL2 game controller mapping:

SDL_GAMECONTROLLERCONFIG="19000000010000000100000000010000,ANBERNIC-keys,platform:Linux,a:b1,b:b0,x:b2,y:b3,back:b6,start:b7,leftstick:b9,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b10,righttrigger:b11,"

Setup

OS based on Ubuntu 18.04 with kernel 4.9. Maybe a little old...

Linux rootfs has a copy of qemu-user-static, seems they want me to chroot into it.

sudo mkdir /mnt/rg35xx

sudo mount /dev/sdd5 /mnt/rg35xx/
cd /mnt/rg35xx/
sudo mount -t proc /proc proc/
sudo mount -t sysfs /sys sys/
sudo mount -o bind /dev dev/
sudo mount -o bind /run run/

sudo chroot . qemu-arm-static /bin/bash

# host has merged /usr, environment probably broken in many other ways
export PATH=/bin:/sbin:/usr/sbin:$PATH

Now to make it so that I don't have to do that again:

apt install openssh-server

... and fix some of the entirely broken permissions so that sudo actually works ...

chown -R root:root /usr/bin  

chown root:root /usr/lib/sudo/sudoers.so
chown root:root /etc/sudoers /etc/sudoers.d
chmod 644 /usr/lib/sudo/sudoers.so
chmod 4755 /usr/bin/sudo

Time to leave and reunite the console with it's SD card:

exit

cd ..
sudo umount --recursive /mnt/rg35xx

Can now connect over SSH using these super-secure details:

Username: game
Password: game

Language

Default language is set to Chinese, let's change that as I don't even have the fonts installed...

sudo locale-gen en_GB
sudo locale-gen en_GB.UTF-8
sudo update-locale LANG=en_GB.UTF-8 LANGUAGE

Some Permissions

Useful for running things as non-root. (Unlike the default launcher)

sudo usermod -a -G video game
sudo usermod -a -G audio game
sudo usermod -a -G input game

Additional Hackery

There are multiple copies of SDL2, one in /usr/lib (which seems to work) and one in /usr/lib/arm-linux-gnueabihf (which does not). Let's just move that out of the way...

mv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.8.0 .

Need to stop the launcher to run anything manually:

sudo /etc/init.d/launcher.sh stop

SDL2 game controller mapping:

SDL_GAMECONTROLLERCONFIG="19000000010000000100000000010000,Deeplay-keys,platform:Linux,a:b1,b:b0,x:b2,y:b3,back:b6,start:b7,leftstick:b9,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b10,righttrigger:b11,"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment