Date: Wed, 17 May 2006 00:32:18 +0200 Subject: vt1211 guide for Mandriva 2006 / PD6000E Hi! I just finished building and configuring the vt1211 module with lm_sensors (for Mandriva 2006 and my Epia PD6000E board) and decided that I might as well share my experiences with the world. If you think the scribblings below are of any use, you are therefore more than welcome to publish them on your website. Kind regards, (name) **************************************************** Installation guide for the vt1211 on a Mandriva 2006 box **************************************************** You can choose to follow the Application Notes from www.viaarena.com (search for something about "Linux patches and tools" and "Hardware Monitor"). If you do not want to recompile your entire kernel, however, you can follow the guide below to just compile the necessary driver module. Necessary prerequisites: ----------------------------------------------- - This guide assumes that you are running kernel 2.6.12-12mdk-i586-up-1GB. Use the command "uname -a" to verify this. Other versions may work given enough modifications to the instructions below. - The kernel source for your currently running kernel. Issue the command "urpmi kernel-source-2.6-2.6.12-12mdk" - Relevant development tools like gcc etc. - Do a "urpmi lm_sensors" and "urpmi liblm_sensors". Refer to their user manual for configuration instructions (short version: run "sensors-detect" and follow instructions). - Download a proper sensors.conf file from http://hem.bredband.net/ekmlar/vt1211.html. I recommend "sensors2.conf.txt" for the Epia PD6000E board with some slight modifications based on miscellaneous data sheet looking: ***************************************** #Customized for an EPIA PD6000E chip "vt1211-*" ignore config ignore in0 ignore in1 ignore temp1 ignore temp2 ignore temp4 ignore temp5 ignore temp6 ignore temp7 ignore fan1 ignore fan2 label in2 "VCore" label in3 "+5V" label in4 "+12V" label in5 "+3.3V" label temp3 "CPU Temp" #label fan1 "System" #label fan2 "CPU" compute in2 ((@ * 100) - 3) / (1 * 95.8), (@ * 1 * .958) + .03 compute in3 ((@ * 100) - 3) / (0.38 * 95.8), (@ * 0.38 * .958) + .03 compute in4 ((@ * 100) - 3) / (0.1754 * 95.8), (@ * 0.1754 * .958) + .03 compute in5 ((@ * 100) - 3) / (0.6296 * 95.8), (@ * 0.6296 * .958) + .03 set vrm 9.1 set in2_min 1.20 * 0.95 set in2_max 1.20 * 1.05 set in3_min 5.0 * 0.92 set in3_max 5.0 * 1.05 set in4_min 12.0 * 0.90 set in4_max 12.0 * 1.10 set in5_min 3.3 * 0.95 set in5_max 3.3 * 1.05 compute temp3 (@*@*0.0046)-(@*0.088)-0.748, (@*0.9686)+65 set temp3_hyst 75 set temp3_over 80 ***************************************** Construct a vt1211.c file: ----------------------------------------------- - Download the vt1211-2.6.11.4.patch file. - Use your favorite text editor to remove the first two diff groups, that is the first 33 lines in this case. - Issue the command "patch vt1211.c vt1211-2.6.11.4.patch" and you will now have the "vt1211.c" file Fix the kernel source: ----------------------------------------------- Since Mandrake has the annoying habit of having the typical kernel have a version number like "2.6.12-12mdk-i586-up-1GB", the version number embedded in eg. the "kernel-source-2.6-2.6.12-12mdk" kernel source package that we installed above is "2.6.12-12mdkcustom". This of course creates some conflicts that we need to hack: - Create a proper path to the kernel source by issuing the command "ln -s /usr/src/linux-2.6.12-12mdk /usr/src/linux-2.6.12-12mdk-i586-up-1GB" - In the kernel source tree (/usr/src/linux-2.6.12-12mdk-i586-up-1GB), issue a "gmake modules_prepare" to prepare the building of kernel modules (I'm not exactly sure if this is necessary, but it probably does not hurt). - Edit the /usr/src/linux/include/linux/version.h file and change the version number from "2.6.12-12mdkcustom" to "2.6.12-12mdk-i586-up-1GB". Build the module: ----------------------------------------------- - Create the file "Makefile" and put the following two lines into it: KERNEL_SOURCE = /usr/src/linux-`uname -r` obj-m := vt1211.o - Compile the module: "gmake -C /usr/src/linux-2.6.12-12mdk-i586-up-1GB/ SUBDIRS=$PWD modules" - You should now have a "vt1211.ko" file that you can insert using "insmod vt1211.ko". Test this. Test that you can remove the module again using "rmmod vt1211.ko". Automagicify the module loading: ----------------------------------------------- - Copy the module to a proper place: "mv vt1211.ko /lib/modules/2.6.12-12mdk-i586-up-1GB/kernel/drivers/i2c/chips/" - Run "depmod" - You should now be able to insert your module using "modprobe vt1211". Test this. - Use your favorite editor to edit "/etc/rc.local" to at the modprobe command. Together with the output in this file created by "sensors-detect" (see the lm_sensors user to find out what this means) my rc.local contains: # I2C bus drivers modprobe i2c-viapro modprobe i2c-isa # I2C chip drivers modprobe eeprom modprobe vt1211 # sleep 2 # optional /usr/bin/sensors -s