Posts Tagged ‘centos’

Enabling temperature sensor in CentOS on ALIX.2D2

July 10th, 2009 bk 3 comments

Now let’s make use of this temperature sensor on ALIX board. First we need lm_sensors package, so let’s install it:
# yum install lm_sensors

Now if you’ll run sensors-detect it won’t detect anything. We need the module called scx200_acb:
# grep -i scx200_acb /boot/config-`uname -r`
# CONFIG_SCx200_ACB is not set

Ok, it exists in kernel sources, but just not compiled in CentOS/RHEL kernel. Let’s compile it ourselves. It can be done on ALIX ifself (but will be slow and take time and space) or on any other CentOS machine.

Install  devepment packages:
# yum install rpm-build 
(will also install patch elfutils elfutils-libs)

# yum install gnupg redhat-rpm-config gcc
(will also install cpp glibc-devel glibc-headers kernel-headers libgomp libusb)

# yum install kernel-devel

Now we are ready to install kernel sources:
# rpm -ivh`uname -r`.src.rpm

Prepare kernel tree:
# rpmbuild -bp –target i686 /usr/src/redhat/SPECS/kernel-2.6.spec

And then:
# cd /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/drivers/i2c/busses
# make CONFIG_SCx200_ACB=m -C /lib/modules/`uname -r`/build M=`pwd` modules

It will also compile few other modules, but we need only scx200_acb.ko:
# cp scx200_acb.ko /lib/modules/`uname -r`/extra/
# depmod -A

And now:
# modprobe scx200_acb
# sensor-detect
# echo MODULE_1=scx200_acb >> /etc/sysconfig/lm_sensors
# /etc/init.d/lm_sensors start

Now run it:
# sensors

Adapter: CS5536 ACB0
M/B Temp: +43 C (low = +0 C, high = +70 C)
CPU Temp: +49.5 C (low = +0.0 C, high = +70.0 C)
M/B Crit: +85 C (hyst = +75 C)
CPU Crit: +85 C (hyst = +75 C)

Voila! It works.
(Don’t mind the temperature, summers are hot here, about 30 C in the room).

And when you’ll update the kernel you won’t need to recompile the module again, it will be linked via weak-updates directory.

Categories: linux Tags: , , , ,

Installing CentOS on ALIX.2D2

July 10th, 2009 bk 4 comments

First step for successful installation of CentOS (or RHEL/Fedora) on ALIX board is to use Microdrive instead of CompactFlash card, so you won’t have to worry about CF write cycles. Microdrives go now for $10-20 on eBay. Definitely worth it. I used 2.5GB Seagate ST625211CF Microdrive, but I believe any other will do too. 

Then you will need regular PC and IDE to CF adapder. Connect the adapter as first hard disk and install on it Linux distribution of your choice. And yes, you can create swap partition since it’s Microdrive and not CompactFlash.

Another option is to use USB card reader instead of IDE to CF adapter or VMware instead of real PC. Or connect Microdrive to another Linux machine and use yum –installroot same way it done with Xen domU images.

Any way, after Linux is installed don’t forget to enable serial console.

1. Edit /etc/grub.conf:

serial –speed=38400
terminal serial


title CentOS (2.6.18-128.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/hda3 console=ttyS0,38400n8
        initrd /initrd-2.6.18-128.el5.img

2. Add to /etc/inittab:

T0:23:respawn:/sbin/agetty 38400 ttyS0

3. Add to /etc/securetty:


Now Microdrive is ready to be plugged into ALIX and happily booted.

Despite Geode LX800 is i586 compatible CPU and CentOS/RHEL comes with i686 kernel it will boot. The only problem I’ve noticed so far is when you try to install kernel update it will complain “package kernel-2.6.18-128.1.16.el5.i686 is intended for a i686 architecture”. Fix it by:

# echo i686-redhat-linux > /etc/rpm/platform

By the way, we can also use Voyage Linux kernel. Just copy /boot/vmlinuz-2.6.26-486-voyage and /lib/modules/2.6.26-486-voyage and create initrd image:

# mkinitrd -v –without-dmraid /boot/vmlinuz-2.6.26-486-voyage 2.6.26-486-voyage

Voyage Linux kernel provides some support for such ALIX board features as temperature sensor and leds, but some of it can be also enabled in CentOS/RHEL kernel. About it later on.

Categories: linux Tags: , , , , ,