From 3d1ad6e2782afae6ae57524171eabc60dfa51698 Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Thu, 25 Jun 2026 22:10:57 -0300 Subject: [PATCH] fix four minor gaps: rtl8188eus udev rule, bfq scope, hostname, tsadc Found during the live multi-device SSH sweep; none break a single device but each is a real defect: - linux-drivers/RTL8188EUS 99-rtl8188eus.rules: the RUN line used single `$` for its shell vars, which udev parses as its own specifier ("invalid substitution type") and rejects the whole rule, so the rtl8xxxu->8188eu rebind never ran (the dongle stayed on the better driver only by probe-order luck). Double them to `$$`. - linux 10-bfq-sched.rules: `KERNEL=="mmcblk[0-9]*"` matched partitions too, whose queue/* knobs do not exist, spamming the boot log with ~15 ENOENT write failures. Gate on SUBSYSTEM=="block", DEVTYPE=="disk". - hostname: system.cfg shipped `system.hostname=@DEVICENAME@` -> "RK3326" (the SoC name, identical on every unit), so two ArchR consoles on one LAN collide on NetBIOS/mDNS registration (nmbd "Failed to register my name"). Set the base name to "archr" and append a short per-device machine-id suffix in network-base-setup so each device is unique. - tsadc: r3xs.dtsi and eeclone.dts enabled tsadc without rockchip,hw-tshut-mode/-polarity, so the driver logged "Missing tshut ... using default" on every boot. Spell out the defaults (CRU reset, active-low); behaviour unchanged. DTS compiles clean (eeclone + soysauce). The "GO-Super Gamepad" joypad name on the Soysauce was investigated and is intentional (soysauce.dts sets joypad-name with a matching retroarch config), so it is left as-is. Co-Authored-By: Claude Opus 4.8 --- .../dts/rockchip/rk3326-gameconsole-eeclone.dts | 8 ++++++++ .../dts/rockchip/rk3326-gameconsole-r3xs.dtsi | 9 +++++++++ .../archr/config/system/configs/system.cfg | 2 +- .../RTL8188EUS/udev.d/99-rtl8188eus.rules | 6 +++++- .../ArchR/packages/linux/udev.d/10-bfq-sched.rules | 14 +++++++++----- .../sysutils/systemd/scripts/network-base-setup | 8 ++++++++ 6 files changed, 40 insertions(+), 7 deletions(-) diff --git a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-eeclone.dts b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-eeclone.dts index a69ee04e52..f3e5abb5ea 100644 --- a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-eeclone.dts +++ b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-eeclone.dts @@ -798,6 +798,14 @@ &tsadc { status = "okay"; + /* + * Explicit hardware thermal-shutdown config (CRU self-reset on + * over-temp, active-low) matching the driver defaults, to silence the + * "Missing tshut mode/polarity property" boot warning. No behaviour + * change. + */ + rockchip,hw-tshut-mode = <0>; + rockchip,hw-tshut-polarity = <0>; }; &u2phy { diff --git a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r3xs.dtsi b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r3xs.dtsi index 5e95dab3ab..6cf3125ae6 100644 --- a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r3xs.dtsi +++ b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r3xs.dtsi @@ -471,6 +471,15 @@ &tsadc { status = "okay"; + /* + * Spell out the hardware thermal-shutdown config the driver otherwise + * warns about ("Missing tshut mode/polarity property, using default"): + * CRU self-reset on over-temp, active-low. These match the driver + * defaults already in use, so behaviour is unchanged; this just makes + * the config explicit and silences the boot warning. + */ + rockchip,hw-tshut-mode = <0>; + rockchip,hw-tshut-polarity = <0>; }; &u2phy { diff --git a/projects/ArchR/packages/archr/config/system/configs/system.cfg b/projects/ArchR/packages/archr/config/system/configs/system.cfg index 4d4c829983..afd4992251 100644 --- a/projects/ArchR/packages/archr/config/system/configs/system.cfg +++ b/projects/ArchR/packages/archr/config/system/configs/system.cfg @@ -179,7 +179,7 @@ system.autohotkeys=1 system.automount=1 system.battery.warning=0 system.battery.warning_threshold=25 -system.hostname=@DEVICENAME@ +system.hostname=archr system.language=en_US enable.turbo-mode=1 system.cpugovernor=ondemand diff --git a/projects/ArchR/packages/linux-drivers/RTL8188EUS/udev.d/99-rtl8188eus.rules b/projects/ArchR/packages/linux-drivers/RTL8188EUS/udev.d/99-rtl8188eus.rules index b1ffa5715d..6be61e8de3 100644 --- a/projects/ArchR/packages/linux-drivers/RTL8188EUS/udev.d/99-rtl8188eus.rules +++ b/projects/ArchR/packages/linux-drivers/RTL8188EUS/udev.d/99-rtl8188eus.rules @@ -31,6 +31,10 @@ LABEL="rtl8188eus_swap" # mesmo tempo); depois carrega 8188eu, que vai bindar pela alias # table. ${BUSNUM} e ${DEVNUM} são fornecidos por udev e identificam # o device USB sem ambiguidade. -RUN+="/usr/bin/sh -c 'busid=$(basename %p); for drv in /sys/bus/usb/drivers/rtl8xxxu; do [ -e \"$drv/$busid\" ] && echo \"$busid\" > \"$drv/unbind\" 2>/dev/null; done; modprobe 8188eu 2>/dev/null'" +# udev parses `$` in RUN as its own specifier prefix, so shell variables +# must be doubled (`$$` -> literal `$`). The previous single-`$` form made +# udev reject the whole rule ("invalid substitution type"), so the rebind +# never ran and the dongle was left on rtl8xxxu by luck of probe order. +RUN+="/usr/bin/sh -c 'busid=$$(basename %p); for drv in /sys/bus/usb/drivers/rtl8xxxu; do [ -e \"$$drv/$$busid\" ] && echo \"$$busid\" > \"$$drv/unbind\" 2>/dev/null; done; modprobe 8188eu 2>/dev/null'" LABEL="rtl8188eus_end" diff --git a/projects/ArchR/packages/linux/udev.d/10-bfq-sched.rules b/projects/ArchR/packages/linux/udev.d/10-bfq-sched.rules index 11060205dc..32efb67b84 100644 --- a/projects/ArchR/packages/linux/udev.d/10-bfq-sched.rules +++ b/projects/ArchR/packages/linux/udev.d/10-bfq-sched.rules @@ -1,5 +1,9 @@ -ACTION=="add|change", KERNEL=="mmcblk[0-9]*", ATTR{queue/scheduler}="bfq" -ACTION=="add|change", KERNEL=="mmcblk[0-9]*", ATTR{queue/iosched/low_latency}="1" -ACTION=="add|change", KERNEL=="mmcblk[0-9]*", ATTR{queue/read_ahead_kb}="2048" -ACTION=="add|change", KERNEL=="mmcblk[0-9]*", ATTR{queue/nr_requests}="128" -ACTION=="add|change", KERNEL=="mmcblk[0-9]*", ATTR{queue/rq_affinity}="2" +# Tune the I/O scheduler on the whole SD/eMMC disks. The queue/* knobs live +# on the disk, not its partitions, so we gate on DEVTYPE=="disk": matching +# `mmcblk[0-9]*` alone also hit mmcblk1p1/p2/p3 and spammed the boot log with +# "Failed to write ATTR{.../queue/scheduler}: No such file or directory". +ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="mmcblk[0-9]*", ATTR{queue/scheduler}="bfq" +ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="mmcblk[0-9]*", ATTR{queue/iosched/low_latency}="1" +ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="mmcblk[0-9]*", ATTR{queue/read_ahead_kb}="2048" +ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="mmcblk[0-9]*", ATTR{queue/nr_requests}="128" +ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="mmcblk[0-9]*", ATTR{queue/rq_affinity}="2" diff --git a/projects/ArchR/packages/sysutils/systemd/scripts/network-base-setup b/projects/ArchR/packages/sysutils/systemd/scripts/network-base-setup index 0c8cc35a51..a21a6a4edb 100755 --- a/projects/ArchR/packages/sysutils/systemd/scripts/network-base-setup +++ b/projects/ArchR/packages/sysutils/systemd/scripts/network-base-setup @@ -1,6 +1,14 @@ #!/bin/sh . /etc/profile HOSTNAME=$(get_setting system.hostname) +# Make the hostname unique per device. Multiple ArchR consoles on one LAN +# otherwise share a name and collide on NetBIOS / mDNS registration (nmbd +# "Failed to register my name ..."). Append a short, stable suffix derived +# from the per-device machine-id (the same id the gadget uses for its +# serial). Skip if no machine-id is available yet. +MID="$(cat /storage/.cache/systemd-machine-id 2>/dev/null)" +[ -z "${MID}" ] && MID="$(cat /etc/machine-id 2>/dev/null)" +[ -n "${MID}" ] && HOSTNAME="${HOSTNAME}-$(echo "${MID}" | cut -c1-4)" echo ${HOSTNAME} >/proc/sys/kernel/hostname hostnamectl --transient hostname ${HOSTNAME} avahi-set-host-name ${HOSTNAME}