Skip to content

Instantly share code, notes, and snippets.

@meshula
Created March 23, 2025 00:58
Show Gist options
  • Save meshula/b96228435ef506404bec18d6d2926670 to your computer and use it in GitHub Desktop.
Save meshula/b96228435ef506404bec18d6d2926670 to your computer and use it in GitHub Desktop.
bring up RPi with vk and no x11

Install development tools and SDL2

apt-get update apt-get install -y zsh git build-essential cmake
libsdl2-dev libsdl2-2.0-0
libvulkan-dev vulkan-tools
libsdl2-mixer-dev # For audio

Create our game user and directories

useradd -m -s /usr/bin/zsh game mkdir -p /opt/game/{assets,config} chown -R game:game /opt/game

Create our mode config file

echo "terminal" > /opt/game/config/mode chmod 644 /opt/game/config/mode

Set up auto-login service

mkdir -p /etc/systemd/system/[email protected]/ cat > /etc/systemd/system/[email protected]/override.conf << EOF [Service] ExecStart= ExecStart=-/sbin/agetty --autologin game --noclear %I $TERM Type=idle EOF

Create startup script

cat > /opt/game/startup.sh << EOF #!/bin/bash GAME_MODE_FILE="/opt/game/config/mode" if [ -f "$GAME_MODE_FILE" ] && [ "$(cat $GAME_MODE_FILE)" == "terminal" ]; then exec /usr/bin/zsh else # This will be where the game goes - for now just another terminal exec /usr/bin/zsh fi EOF chmod +x /opt/game/startup.sh

Configure game user profile

cat > /home/game/.zprofile << EOF if [ "$(tty)" = "/dev/tty1" ]; then exec /opt/game/startup.sh fi EOF chown game:game /home/game/.zprofile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment