It looks to me like this code is a complete replacement for the Linux version with approximately zero overlap. Would it make sense to just split it into a different file altogether, in the style of daemon/controllers/backlighthelper_{linux,freebsd}.*
? That would move the OS check to CMake instead.
Also, can we have a minimal (error-producing) implementation of getconservationmode
/setconservationmode
to match the latest 6.1 API?