-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
helios64: fix fancontrol service on trixie #8540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
fancontrol.service was "hardened" in Debian trixie. See Debian bug #944808. fancontrol can't access fans in /dev after this. This change returns full access to /dev for fancontrol.service
WalkthroughAdds a new systemd drop-in override for fancontrol on Helios64 to disable PrivateDevices. Introduces packages/bsp/helios64/fancontrol.service.noprivdev-override with [Service] PrivateDevices=no. Updates config/boards/helios64.conf to install this override to /etc/systemd/system/fancontrol.service.d/noprivdev.conf (mode 0644) during post_family_tweaks_bsp__helios64, positioned after the existing fancontrol.service.pid-override installation. No other changes. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
packages/bsp/helios64/fancontrol.service.noprivdev-override (2)
1-2
: Retain hardening where possible: consider binding only the needed /dev nodes instead of full de-sandboxingPrivateDevices=no removes the /dev sandbox entirely. If the board only needs specific device nodes (e.g., /dev/i2c-0,/dev/i2c-1), a tighter alternative is to keep PrivateDevices=yes and bind just those nodes. That preserves most of the defense-in-depth.
Example alternative drop-in (adjust devices to what Helios64 actually uses):
[Service] PrivateDevices=yes BindPaths=/dev/i2c-0:/dev/i2c-0 BindPaths=/dev/i2c-1:/dev/i2c-1
If PWM is only via sysfs (/sys/class/hwmon or /sys/class/pwm), PrivateDevices should not matter; in that case, re-check what exactly requires /dev on Helios64 (e.g., an I²C fan controller).
Would you like me to open a follow-up to prototype a minimal-bind setup once we confirm the exact device nodes needed?
1-2
: Add a short rationale comment for future maintainersAdd context so this override isn’t “mysterious” a year from now. Suggestion:
-[Service] -PrivateDevices=no +# Helios64: Debian trixie fancontrol hardening (see Debian#944808) isolates /dev and breaks access +# to required device nodes on this board. Restore access here; consider minimal BindPaths in future. +[Service] +PrivateDevices=noI can amend the PR with this comment if you agree.
config/boards/helios64.conf (2)
43-43
: Install path is fine; consider quoting vars and deterministic drop-in ordering
- Quoting $SRC and $destination is a minor hardening against whitespace/expansion issues.
- Using a numeric prefix like 10-noprivdev.conf creates deterministic ordering if more drop-ins are added later (even though there’s no conflict today).
Proposed tweak:
-install -m 644 $SRC/packages/bsp/helios64/fancontrol.service.noprivdev-override $destination/etc/systemd/system/fancontrol.service.d/noprivdev.conf +install -m 0644 "$SRC/packages/bsp/helios64/fancontrol.service.noprivdev-override" "$destination/etc/systemd/system/fancontrol.service.d/10-noprivdev.conf"
43-43
: Ensure the drop-in is picked up on upgrades without requiring a rebootIf this file lands via a BSP package update on an already running system, systemd won’t notice new drop-ins until a daemon-reload (and fancontrol won’t pick it up until restart). Consider adding a daemon-reload + try-restart in the BSP postinst path.
Reference (from lib/functions/bsp/armbian-bsp-cli-deb.sh, board_side_bsp_cli_postinst_finish): it currently enables several services with --no-reload. You could append:
systemctl daemon-reload || true systemctl try-restart fancontrol.service || true
This can be a separate, tiny follow-up PR if you prefer to keep this one scoped.
I can draft that follow-up change against armbian-bsp-cli postinst if you want.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
config/boards/helios64.conf
(1 hunks)packages/bsp/helios64/fancontrol.service.noprivdev-override
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
config/boards/helios64.conf (1)
lib/functions/bsp/armbian-bsp-cli-deb.sh (2)
board_side_bsp_cli_postinst_finish
(448-471)board_side_bsp_cli_postrm
(417-423)
🔇 Additional comments (1)
packages/bsp/helios64/fancontrol.service.noprivdev-override (1)
1-2
: Functional fix: disabling PrivateDevices restores /dev access for fancontrol on trixieThis is a pragmatic drop-in that should immediately unblock Helios64 on Debian trixie where the hardened unit breaks access to device nodes. No syntax issues. Applies cleanly as a unit drop-in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
am I correct to think that you are overriding the hardening feature? that sounds like a bad idea.
PrivateDevices was specifically and explicitly set to yes in the bug ticket you mentioned
A more granular approach would be to allow access only to required devices. I.e.
Does that look better? |
Certainly better, but I am not sure it addresses the issue properly. I haven't had the chance to look into it deeply. You are circumventing an explicitly set security-policy. Just doesn't sound right. |
As far as i understand,
I guess those udev rules must be used to deal with devices inside /sys/devices changing paths sometimes. Also, helios4 bsp has similar udev rules, so it must be suffering from this issue as well. |
I see. I have a helios4 unit but won't have access to it for another 2 months. |
My reading of the PrivateDevices= section at https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html is that the correct thing to do is to set DeviceAllow= What we probably need is a /etc/systemd/system/fancontrol.service file
|
That was my initial thought as well. But it doesn't work. I guess it works for only device files, not directories. |
Description
fancontrol.service was "hardened" in Debian trixie. See Debian bug #944808.
fancontrol can't access fans in /dev after that.
This change returns full access to /dev for fancontrol.service
Checklist: