12 Commits
Author SHA1 Message Date
opencode.siil.arti.ee 8c6a3825ed system: preload Mali EGL for 351Files
SDL_Init failed with 'kmsdrm not available' because SDL2's KMSDRM backend
cannot resolve the vendor Mali EGL by itself. Export
LD_PRELOAD=/usr/lib/libmali.so in the Setup file_manager.sh and patch it from
the build script. Verified on the device: 351Files starts and runs instead of
returning to ES.
2026-11-18 17:13:31 +00:00
opencode.siil.arti.ee 78e59dc651 system: drive the gamepad LED via led_ctrl, not LED-class
On the device /sys/class/leds is empty; the vendor micro,gamepad driver exposes
the LED as /sys/devices/platform/gamepad/led_ctrl with values off/on/loop/
breath/red/green/blue. Replace the inert udev rule with a sysinit unit that
writes 'loop' as soon as the attribute exists (~0.5s instead of ~11s when ES
opens the input device).

Also restore the WiFi menu section that was lost when the SSH section was
rewritten.
2026-11-18 17:01:46 +00:00
opencode.siil.arti.ee 40339e4adf system: point wg0.service at the real config path
'wg-quick up wg0' resolves to /etc/wireguard/wg0.conf, which is read-only in
this image, so the unit could never start. Pass the full path to
/storage/.config/wireguard/wg0.conf in ExecStart/ExecStop (wg-quick accepts a
path and derives the interface name from it).
2026-11-18 16:44:16 +00:00
opencode.siil.arti.ee 39b862e78a system: light the power LED at driver probe instead of ES startup
The G90 has no gpio-leds node; the micro,gamepad driver registers red_led,
green_led and blue_led from the DT red/green/blue-gpio properties. It probes at
~0.5s but only lights the LED when userspace opens the input device, which is
EmulationStation at ~11s.

Add a udev rule that writes brightness=1 when blue_led appears, plus a
sysinit.target unit as a fallback. Change the LED name in both files if the
unit uses another colour.
2026-11-18 16:20:41 +00:00
opencode.siil.arti.ee be2aa3e54b system: generate dropbear host keys in /storage, drop -R
Journal from the device showed the real cause of the KEX failure:

  Couldn't create new file /etc/dropbear/dropbear_ed25519_host_key.tmp3204:
  Read-only file system
  Exit before auth: Couldn't read or generate hostkey
  /etc/dropbear/dropbear_ed25519_host_key

-R generates missing host keys under the compiled default /etc/dropbear and
ignores the -r /storage paths, so no host key ever existed and every session
died when the server had to sign the exchange hash. Generate the three keys
with dropbearkey in ExecStartPre and start without -R.

Also correct the docs: the post-quantum KEX was not at fault.
2026-11-18 15:22:36 +00:00
opencode.siil.arti.ee d3017f3c9b system: make dropbear log to /storage/.cache/dropbear.log
The journal is volatile on this image (no /var/log, Storage=auto), so the
dropbear failure during KEX left no trace after a reboot. Run dropbear with -E
and StandardError=append:/storage/.cache/dropbear.log; the file survives
reboots and is readable through dufs.
2026-11-18 15:17:47 +00:00
opencode.siil.arti.ee 998abc7031 system: add dufs web file manager on port 8080
Single static ARMv7 musl binary (3.2 MB), HTTP basic auth, serving / read-write
with upload, delete, search, folder archives, and WebDAV on the same URL.
Enabled at boot via multi-user.target.wants; also useful as a fallback while
SSH key exchange is being debugged.

Pinned to v0.47.0 with the release tarball sha256 checked by the build script.
2026-11-18 14:48:53 +00:00
opencode.siil.arti.ee 004ee08b02 system: drop the post-quantum KEX that crashed dropbear on the G90
An OpenSSH 10.6 client died at 'expecting SSH2_MSG_KEX_ECDH_REPLY' when
mlkem768x25519-sha256 was negotiated, before authentication. The same build
completes that KEX under qemu with an OpenSSH 10.6p2 client, so the fault is
specific to the ARMv7 hardware in the PQ path.

Build dropbear with DROPBEAR_MLKEM768=0 and DROPBEAR_SNTRUP761=0; it now
advertises curve25519-sha256 and clients pick it automatically. Rebuilt image
and p1; verified the binary extracted from the image matches the build and
negotiates curve25519 with ssh 10.6p2.
2026-11-18 14:20:06 +00:00
opencode.siil.arti.ee bcbe31c1d2 system: fix the WiFi UI stalls and the no-op enable path
EmulationStation's WiFi screens are blocking calls on the UI thread and the
helper script made it worse:

- batocera-wifi list ran 'connmanctl services <id>' once per AP just to read
  Interface=wlan0; 20-40 APs meant 20-40 D-Bus calls while the SSID menu was
  built. Now one 'connmanctl services' listing is parsed locally, skipping P2P
  and hidden entries.
- No call had a timeout. Every connmanctl invocation is now wrapped in
  'timeout 5'; enable/disable are bounded by 25s/10s.
- ES calls 'batocera-wifi enable <ssid> <key>' but only list/scanlist were
  implemented, so saving WiFi settings reported success without configuring
  anything. enable/disable now delegate to 'batocera-config wifi'.

The remaining stall (ApiSystem::ping() on opening Network Settings, up to 3x2s)
lives in the ES binary and is documented, not patched.

Verified against a stub connmanctl and inside the repacked image.
2026-11-18 13:36:43 +00:00
opencode.siil.arti.ee 740c6350fc system: restore the Setup menu with the 351Files file manager
The stock image ships /usr/bin/351Files, its gptokeyb mapping and
scripts/setup/file_manager.sh, but removes the setup system from
es_systems.cfg and deletes 13 of the 15 scripts its gamelist referenced.

- re-add the setup system (upstream definition, before ports)
- trim the setup gamelist to the two scripts that still exist:
  File Manager (351Files) and Copy USB roms to device
- add scripts/enable-setup-menu.sh for cards already flashed, since
  /storage/.config/emulationstation/es_systems.cfg overrides the image default
- build script installs system/es/{es_systems.cfg,gamelist.xml}
2026-11-18 08:52:50 +00:00
opencode.siil.arti.ee d994fe7f6a docs: note the sv6160-rk915 mirror on git.wut.ee 2026-11-18 08:46:25 +00:00
opencode.siil.arti.ee 8dc2c663d4 G90 (RK3128) handheld: dump analysis, patched EmuELEC, upstream notes
- hardware decoded from the stock DTB (panel, keys, battery, gamepad, WiFi,
  power, storage layout) and the 16 MiB boot area
- EmuELEC 4.7 / Linux 5.10.160 inventory, partition map, extlinux boot chain
- patched SYSTEM with dropbear SSH, userspace WireGuard, jq, dtach, iperf3,
  tcpdump; build script, units, authorized keys, install/rollback docs
- EmuELEC OTA tar format and the initramfs apply logic, incl. the FAT32
  EEROMS:/.update bind mount
- upstream EmuELEC vs rk3128-cfw vs mainline 6.6 assessment and driver gaps
- SV6160/RK915 WiFi: vendor module metadata, firmware hashes, clean-room
  mainline driver requirements, Codeberg DNS workaround
- tools: dump/partition extractors, FDT dumper, Kagi share exporter
2026-11-18 08:44:38 +00:00