| Constantine A. Murenin ( @ 2007-09-13 18:50:00 |
| Current music: | DJ Jim — Electro Speed 2006 |
| Entry tags: | gsoc2007, gsoc2007.en |
GSoC2007.cnst-sensors.2007-09-13.patch
Google Summer of Code 2007 @ The FreeBSD Project Porting OpenBSD's sysctl Hardware Sensors framework to FreeBSD (2007-256, a 23-y.-o. edition) Description: On this 256th day of 2007, it is my great pleasure to present a feature-complete port of the hardware sensors framework from OpenBSD to FreeBSD. Below is a complete `cvs diff` of cnst-sensors GSoC2007 project as of 2007-256. It includes the following components, listed below in the very same order as they are appearing in this diff: * sample configuration file for sensorsd * rc(8) script and glue code for sensorsd(8) * sysctl(3) doc fixes for CTL_HW tree * sysctl(3) documentation for hardware sensors * sysctl(8) documentation for hardware sensors * assorted KNF and bug-fixes for sysctl(8) * support for the sensor structure for sysctl(8) * coretemp(4) documentation * it(4) documentation * lm(4) documentation * rc.conf(5) documentation for starting sensorsd(8) * sensor_attach(9) et al documentation * coretemp(4) conversion to the hw.sensors framework * it(4) isa driver ported from OpenBSD * lm(4) isa driver ported from OpenBSD * /sys/kern/kern_sensors.c o sensor_attach(9) API for drivers to register ksensors o sensor_task_register(9) API for the update task o sysctl(3) glue code o hw.sensors shadow tree for sysctl(8) internal magic * assorted KNF and bug-fixes for /sys/kern/kern_sysctl.c * it(4) module for testing sensor_attach/detach et al * lm(4) module for testing sensor_attach/detach et al * <sys/sensors.h> * assorted bug-fixes and HW_SENSORS definition for <sys/sysctl.h> * sensors display for systat(1), including all documentation * sensorsd(8) and all applicable documentation The userland part of the framework is entirely source-code compatible with OpenBSD 4.1, 4.2 and -current as of today. All sensor readings can be viewed with `sysctl hw.sensors`, monitored in semi-realtime with `systat -sensors` and also logged with `sensorsd`. Third-party tools, for example a plug-in for nagios, are also available. A separate patch for ports/sysutils/symon will be provided upon request.
Exact directions on applying and testing:
cd /usr/src
fetch http://mojo.ru/us/GSoC2007.cnst-sensors.2007-09-13.patch.gz
gunzip GSoC2007.cnst-sensors.2007-09-13.patch.gz
mkdir sys/dev/{it,lm} sys/modules/{it,lm} usr.sbin/sensorsd
patch < GSoC2007.cnst-sensors.2007-09-13.patch
make -j128 buildkernel KERNCONF=GENERIC MODULES_OVERRIDE="acpi it lm coretemp"
make installkernel KERNCONF=GENERIC MODULES_OVERRIDE="acpi it lm coretemp"
make includes
cd share/man/man4 && make && make install && make clean && cd ../../../
cd share/man/man5 && make && make install && make clean && cd ../../../
cd share/man/man9 && make && make install && make clean && cd ../../../
cd sbin/sysctl && make && make install && make clean && cd ../../
cd usr.bin/systat && make && make install && make clean && cd ../../
cd usr.sbin/sensorsd && make && make install && make clean && cd ../../
diff -u /boot/device.hints sys/`uname -m`/conf/GENERIC.hints
cat sys/`uname -m`/conf/GENERIC.hints >/boot/device.hints
cp etc/sensorsd.conf /etc/
shutdown -r now ; exit
...
OK load it
OK load lm
OK load coretemp
OK boot
...
sensorsd
sysctl hw.sensors
systat -sensors 1