From c90240d4239fbcaba6df62c4865c3c5b243e1fa1 Mon Sep 17 00:00:00 2001 From: cloudwithax Date: Tue, 17 Feb 2026 17:54:12 -0500 Subject: [PATCH] feat: add config overlay for auto-login, mounts, X11, and RetroArch - Add autologin config for getty@tty1.service to auto-login as emulation user - Add udev rule for auto-detecting second SD card (mmcblk1p1) - Add systemd mount units for /roms (primary SD) and /roms2 (second SD) - Add .bash_profile to auto-start X on tty1 - Add .xinitrc to configure X11 and launch EmulationStation-DE - Add retroarch.cfg with H700 optimized settings Co-Authored-By: Claude Opus 4.6 --- .../getty@tty1.service.d/autologin.conf | 3 +++ config/etc/systemd/system/roms.mount | 12 ++++++++++ config/etc/systemd/system/roms2.mount | 11 ++++++++++ config/etc/udev/rules.d/99-sdcard2.rules | 2 ++ config/home/emulation/.bash_profile | 4 ++++ .../emulation/.config/retroarch/retroarch.cfg | 22 +++++++++++++++++++ config/home/emulation/.xinitrc | 8 +++++++ 7 files changed, 62 insertions(+) create mode 100644 config/etc/systemd/system/getty@tty1.service.d/autologin.conf create mode 100644 config/etc/systemd/system/roms.mount create mode 100644 config/etc/systemd/system/roms2.mount create mode 100644 config/etc/udev/rules.d/99-sdcard2.rules create mode 100644 config/home/emulation/.bash_profile create mode 100644 config/home/emulation/.config/retroarch/retroarch.cfg create mode 100644 config/home/emulation/.xinitrc diff --git a/config/etc/systemd/system/getty@tty1.service.d/autologin.conf b/config/etc/systemd/system/getty@tty1.service.d/autologin.conf new file mode 100644 index 0000000..4cc4de1 --- /dev/null +++ b/config/etc/systemd/system/getty@tty1.service.d/autologin.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin emulation --noclear %I $TERM diff --git a/config/etc/systemd/system/roms.mount b/config/etc/systemd/system/roms.mount new file mode 100644 index 0000000..72f109b --- /dev/null +++ b/config/etc/systemd/system/roms.mount @@ -0,0 +1,12 @@ +[Unit] +Description=ROM Storage (Primary SD) +After=local-fs.target + +[Mount] +What=/dev/mmcblk0p5 +Where=/roms +Type=auto +Options=defaults,noatime + +[Install] +WantedBy=multi-user.target diff --git a/config/etc/systemd/system/roms2.mount b/config/etc/systemd/system/roms2.mount new file mode 100644 index 0000000..0fa9380 --- /dev/null +++ b/config/etc/systemd/system/roms2.mount @@ -0,0 +1,11 @@ +[Unit] +Description=ROM Storage (Second SD Card) + +[Mount] +What=/dev/mmcblk1p1 +Where=/roms2 +Type=auto +Options=defaults,noatime,nofail + +[Install] +WantedBy=multi-user.target diff --git a/config/etc/udev/rules.d/99-sdcard2.rules b/config/etc/udev/rules.d/99-sdcard2.rules new file mode 100644 index 0000000..c344ad7 --- /dev/null +++ b/config/etc/udev/rules.d/99-sdcard2.rules @@ -0,0 +1,2 @@ +# Auto-detect second SD card (mmcblk1p1) and trigger mount +ACTION=="add", KERNEL=="mmcblk1p1", TAG+="systemd", ENV{SYSTEMD_WANTS}="roms2.mount" diff --git a/config/home/emulation/.bash_profile b/config/home/emulation/.bash_profile new file mode 100644 index 0000000..1c6cbfb --- /dev/null +++ b/config/home/emulation/.bash_profile @@ -0,0 +1,4 @@ +# Auto-start X on tty1 +if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then + exec startx +fi diff --git a/config/home/emulation/.config/retroarch/retroarch.cfg b/config/home/emulation/.config/retroarch/retroarch.cfg new file mode 100644 index 0000000..23a27a2 --- /dev/null +++ b/config/home/emulation/.config/retroarch/retroarch.cfg @@ -0,0 +1,22 @@ +# RetroArch configuration for H700 +video_driver = "gl" +video_fullscreen = "true" +video_vsync = "true" + +# Input +input_autodetect_enable = "true" +input_joypad_driver = "udev" + +# Directories +system_directory = "/roms/bios" +savefile_directory = "/roms/saves" +savestate_directory = "/roms/saves" +screenshot_directory = "/roms/screenshots" +libretro_directory = "/home/emulation/.config/retroarch/cores" +libretro_info_path = "/usr/share/libretro/info" + +# Audio +audio_driver = "alsa" + +# Menu +menu_driver = "ozone" diff --git a/config/home/emulation/.xinitrc b/config/home/emulation/.xinitrc new file mode 100644 index 0000000..2a9c0ef --- /dev/null +++ b/config/home/emulation/.xinitrc @@ -0,0 +1,8 @@ +#!/bin/bash +# Disable screen blanking +xset s off +xset -dpms +xset s noblank + +# Launch EmulationStation-DE +exec /usr/local/bin/EmulationStation-DE.AppImage --no-sandbox