Skip to content

Convert sysutils/fand into a 1st class citizen#2070

Open
stephane-rochoy-stormshield wants to merge 2 commits intofreebsd:mainfrom
stephane-rochoy-stormshield:fand
Open

Convert sysutils/fand into a 1st class citizen#2070
stephane-rochoy-stormshield wants to merge 2 commits intofreebsd:mainfrom
stephane-rochoy-stormshield:fand

Conversation

@stephane-rochoy-stormshield
Copy link
Contributor

Integrate Corey Hinshaw's fand (68647f7), which is actually available as sysutils/fand, into base system with the following changes:

  • handle multiple instances via the rc(8) script
  • add capsicum(4) support (disabled for now)
  • add cooling profiles support
  • and some minor changes

Here is a sample cooling profile:

lo_duty      = 532  # nanoseconds, 1%
step.0.temp = 25.0  # °C
step.0.duty = 532   # nanoseconds, 1%
step.1.temp = 30.0  # °C
step.1.duty = 10649 # nanoseconds, 20%
step.2.temp = 35.0  # °C
step.2.duty = 25026 # nanoseconds, 47%
step.3.temp = 40.0  # °C
step.3.duty = 41533 # nanoseconds, 78%
step.4.temp = 45.0  # °C
step.4.duty = 52183 # nanoseconds, 98%

and here is a sample rc(8) config to start two instances:

fand_enable="YES"
fand_list="foo bar"

fand_foo_device="fan3"
fand_foo_sensor="hw.acpi.thermal.tz0.temperature"
fand_foo_hi_temp=70
fand_foo_hi_duty=97%

fand_bar_device="fan4"
fand_bar_sensor="hw.acpi.thermal.tz1.temperature"
fand_bar_profile="PLATFORM/fan4/default.conf"
fand_bar_multiplier=0.01
fand_bar_invpol=NO
fand_bar_kelvin=NO
fand_bar_pollint=5

(Note fand_*_profile is a path relative to /etc/fand)

There's some limitations:

  • cooling profiles don't support modifying the period
  • and the capsicum(4) support is working but currently disabled as it will require to give CTLFLAG_CAPRD to the various sysctl exposing temperatures (e.g., hw.acpi.thermal.tz0.temperature).

Oh and any pointer to help me implement some tests would be more than welcome :)

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

Thank you for taking the time to contribute to FreeBSD!

Some of files have special handling:

Important

@concussious wants to review changes to share/man/

Integrate Corey Hinshaw's fand [1][2] (68647f7) into base system with the
following changes:

- add capsicum(4) support (disabled for now)
- add cooling profiles support
- and some minor changes

[1] https://github.com/electrickite/fand
[2] https://www.freshports.org/sysutils/fand/

Sponsored by:  Stormshield
Signed-off-by: Stéphane Rochoy <stephane.rochoy@stormshield.eu>
Sponsored by:  Stormshield
Signed-off-by: Stéphane Rochoy <stephane.rochoy@stormshield.eu>
@spmzt
Copy link
Member

spmzt commented Mar 11, 2026

Why do you want this to be in base?
I would appreciate it if you could explain.

@stephane-rochoy-stormshield
Copy link
Contributor Author

stephane-rochoy-stormshield commented Mar 11, 2026

Why do you want this to be in base? I would appreciate it if you could explain.

Well, I would say the reasoning should be the same as the one that led to have powerd(8) in the base system. Also, we already have pwm(8) and as PWM is mostly used to drive fans having fand seems like a logical move.

From a more concrete (and maybe egocentric ;)) perspective, having a software solution to drive fans is currently required on some platforms I work with, were, e.g., the Super I/O cannot drive fans based on sensors exposed via SMBus.

BTW, sysutils/fand, despite being a port, is a tool dedicated to FreeBSD, this is not some alien software patched for FreeBSD. It was designed from the beginning to target FreeBSD.

What problem do you anticipate with integrating something like fand into the base system? What are your criteria to think about integrating something into base system?

@electrickite
Copy link

For what it’s worth, as the original author of fand, I have no issues with the project being merged into the base system. If it were, I would likely archive the original GitHub project.

@concussious
Copy link
Contributor

What problem do you anticipate with integrating something like fand into the base system? What are your criteria to think about integrating something into base system?

Importing things into FreeBSD base means that FreeBSD maintainers need to support it and consider it, so this is always a valid question we would ask anyone, including our own people :)

@stephane-rochoy-stormshield
Copy link
Contributor Author

stephane-rochoy-stormshield commented Mar 11, 2026

What problem do you anticipate with integrating something like fand into the base system? What are your criteria to think about integrating something into base system?

Importing things into FreeBSD base means that FreeBSD maintainers need to support it and consider it, so this is always a valid question we would ask anyone, including our own people :)

I didn't intend to, sort of, attack the validity of @spmtz's questions. I just try to gain some knowledge along the way on how I should reason before submitting such a request :)

For example, is the fact that PWM is not part of GENERIC a problem? I would intuitively say no because pwm(8) is already there. OTOH maybe having something you can configure with rc(8) but not with the GENERIC kernel is a problem?

@stephane-rochoy-stormshield
Copy link
Contributor Author

@spmzt @concussious Is there anything I can do to help this topic move forward?

@spmzt
Copy link
Member

spmzt commented Mar 17, 2026

@spmzt @concussious Is there anything I can do to help this topic move forward?

I'm not familiar with the fand and the pwm in general,
let me find you someone who can actually review your PR.
Thank you for the ping.

@spmzt spmzt added the needs-review Someone should look at this before proceeding label Mar 17, 2026
@spmzt spmzt requested a review from evadot March 17, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Someone should look at this before proceeding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants