rk35xx: isolate ttyGS0 getty in a private device namespace - #10313
Conversation
On reComputer RK35xx boards the USB gadget serial console (ttyGS0) is provided by usbdevice.service and consumed by serial-getty@ttyGS0. Under heavy firstlogin / console traffic the getty has been observed to lock up: the unit shows active but the login prompt stops responding and only a reboot recovers it. Add PrivateDevices=yes plus an explicit DeviceAllow list (/dev/ttyGS0 and the char-tty class) to the existing serial-getty@ttyGS0 override, so the getty runs in a private /dev namespace exposing only the tty devices it actually needs. This makes restarts across gadget re-bind cycles reliable and resolves the observed hang. Tested on reComputer RK3588 DevKit. Signed-off-by: Mkirin <haohao.wang@seeed.cc>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe ChangesSerial device access
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Hey @Mkiring! 👋Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡 If you'd like to stay informed about project updates or collaborate more closely with the team, Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/sources/vendors/seeed-studio/recomputer-rk35xx-common.inc`:
- Around line 296-298: Update the service sandbox configuration around
PrivateDevices=yes so /dev/ttyGS0 is available to serial-getty@ttyGS0.service by
adding a BindPaths entry for /dev/ttyGS0, or disable private devices and apply
the exact device policy instead; preserve access for the existing tty device
rules.
- Line 298: Remove the broad DeviceAllow=char-tty rule and retain only
DeviceAllow=/dev/ttyGS0 rw in the relevant systemd service configuration; add
another specific device rule only if target-device inspection requires it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 45f37948-92ba-4caf-838e-9e17d2062d4c
📒 Files selected for processing (1)
config/sources/vendors/seeed-studio/recomputer-rk35xx-common.inc
Follow-up to d0da443 ("rk35xx: isolate ttyGS0 getty in a private device namespace"): the DeviceAllow list there included both /dev/ttyGS0 and the broader char-tty group. Since udev reports ttyGS0 as MAJOR=235 MINOR=0 SUBSYSTEM=tty, char-tty is a strict superset covering every SUBSYSTEM=tty device (tty0-tty63 virtual consoles, ttyUSB*, etc.) the getty never opens. Drop char-tty and keep only the explicit /dev/ttyGS0 entry, per least-privilege. Tested on reComputer RK3588 DevKit and RK3576 Dev Kit (kernel 6.1.115-vendor-seeed-rk35xx, systemd 257). Signed-off-by: Mkirin <haohao.wang@seeed.cc>
|
✅ This PR has been reviewed and approved — all set for merge! |
On reComputer RK35xx boards the USB gadget serial console (ttyGS0) is provided by usbdevice.service and consumed by serial-getty@ttyGS0. Under heavy firstlogin / console traffic the getty has been observed to lock up: the unit shows active but the login prompt stops responding and only a reboot recovers it.
Add PrivateDevices=yes plus an explicit DeviceAllow list (/dev/ttyGS0 and the char-tty class) to the existing serial-getty@ttyGS0 override, so the getty runs in a private /dev namespace exposing only the tty devices it actually needs. This makes restarts across gadget re-bind cycles reliable and resolves the observed hang.
Tested on reComputer RK3576 and RK3588 DevKit.
Summary by CodeRabbit