Archive for category Tutorials

Kernel

Posted by on Tuesday, 7 April, 2009

To make a new kernel you will need to know a few basic commands.

Firstly go to your local kernel.org with an ftp client and grab a kernel.
There are a lot of choices so heres a simple run down of them.

2.2.xx is the 2.2 series and stable and usually gets the job done
2.3.xx is the development one and probably if this is your first time best to leave
2.4.xx is stable again and good for obscure hardware or other drivers you may need.
2.5.xx is unstable/testing/development (as are all the odd ones – even numbers are stable) 2.6.xx is stable again, and generally is the more used one currently.

I use 2.4 so I will use this as a demonstration.

Once you have saved your kernel put it in /usr/src .
This doesnt have to be the set directory this is just the USUAL place one would use.

So now apon ls you will see something like this

wishes@chary:/usr/src$ ls
linux-2.4.20.tar.bz2
wishes@chary:/usr/src$

(You may have the suffix .tar.gz which is fine)
Now you need to decompress this use tar jvxf linux-2.4.20.tar.bz This varies system to system – I use debian. If j doesnt work try I.
If you have a .tar.gz use tar zvxf linux-2.4.20.tar.gz .

Now you should have a directory called either linux or linux-2.xx.xx (x meaning some number version of your kernel)
If it is linux use mv linux linux-2.xx.xx so you know which kernel is which later on should you change.
then link ‘linux’ to linux-2.xx.xx with the command

ln -s linux-2.4.20 linux

Okay now you have decompressed your kernel. Follow these commands.


cd linux
make menuconfig

(Often debian comes without libncurses so you will need to ‘apt-get install libncurses5-dev’)
If you are not sure what to do here just leave it as default as possible as most of the defaults are good.
Use the space key for an [M] or [*]
[M] Means its built in as a module so you can load it on the fly once running the new kernel
[*] Means its built into the kernel.

Each person does their own thing. If I’m using it all the time like a network card i build it in. If i only use it sometimes I will load it as needed as a module.

Use the arrow keys to move your away around and if not sure click on the Help.

Once you have configured your kernel you need to exit and save your config.

There are numerous ways of compiling the kernel I find this is the fastest and easier to recall than running them all at once.

make dep clean modules modules_install bzImage
(for 2.6.x kernels you can drop the ‘dep’ off it)

Some people prefer

make dep && make clean && make modules && make modules_install && make bzImage
(for 2.6.x kernels you can drop the ‘dep’ off it again)

If this errors out check the error message properly and see if you can work out what caused it and perhaps change that in the kernel config.

If this finishes cleanly then do a

make install

This should install the kernel to /boot

What Should be in boot?

Check that /boot/vmlinuz is a link to vmlinuz-2.4.20 (or whatever kernel name you have)
and /boot/vmlinuz.old is a link to vmlinuz-2.xx.xx (some older version that worked as a backup)

Double check your /etc/lilo.conf to make sure that this points to the correct place. If using grub check the /boot/grub/menu.lst
If running Lilo, just rerun it (typing lilo at the prompt)

Happy Compiling!

Liz


CPU frequency scaling

Posted by on Tuesday, 7 April, 2009

Want to do your bit to help save the world?

No real need to have the CPU in your home Linux box burning away flat out! This will idle the CPU at its lowest supported speed, and adjust the clock rate as needed depending on the load. This example is for an P4 based CPU (in my case a Celeron D 2.8GHz) using p4_clockmod

Some of the other common drivers (or modules) are :

AMD K6 processors : powernow_k6
AMD K7 processors (Athlon, Duron, Sempron 32 bits) : powernow_k7
AMD K8 processors (Athlon 64, Turion 64, Sempron 64, Opteron 64) : powernow_k8

Pentium 4, Celeron D, Pentium D, Celeron M : p4_clockmod
Pentium M, Core Duo, Core 2 Duo : speedstep_centrino

There are of course other CPU frequency drivers. In doubt, you can use the generic driver : acpi_cpufreq

Right, down to business (replace p4_clockmod with the driver for your CPU):

apt-get install cpufrequtils sysfsutils
modprobe p4_clockmod
modprobe cpufreq_ondemand
echo ondemand | tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Verify whats happening:

cpufreq-info

cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
driver: p4-clockmod
CPUs which need to switch frequency at the same time: 0
hardware limits: 350 MHz – 2.80 GHz
available frequency steps: 350 MHz, 700 MHz, 1.05 GHz, 1.40 GHz, 1.75 GHz, 2.10 GHz, 2.45 GHz, 2.80 GHz
available cpufreq governors: ondemand, performance
current policy: frequency should be within 350 MHz and 2.80 GHz.
The governor “ondemand” may decide which speed to use
within this range.
current CPU frequency is 350 MHz.

Save config/apply at startup:

echo p4_clockmod | tee -a /etc/modules
echo cpufreq_ondemand | tee -a /etc/modules
echo devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand | tee -a /etc/sysfs.conf

Reboot and run cpufreq-info again to verify. All done! Last-Modified: 2008-12-11 21:19:35


Linux User Group

Posted by on Tuesday, 7 April, 2009

Linux User Group’s are great places to get support, meet like minded people, and get free internet and hardware (sometimes :p)
New Zealand has a national LUG – the NZ Linux Usergroup – which is based in Auckland but has members from all around the country.

NZLUG Website

The NZLUG’s webpage has links to the other groups around the country – in Waikato Hawkes Bay, Wellington, Canterbury, Kapiti, Christchurch, Wairarapa and Duneden.
If you don’t have a LUG close to where you live, it might be a good idea to seek out some other pengiunheads and start one.

LUG’s tend to have a primary way of contact: electornic mailing lists.
These are special e-mail adresses that members “subscribe” to.
Then anyone who is subscribed can send an e-mail or reply to that address and it is sent to all the members. Kinda of like BCC’s but only better, because most have onlinen archives that are indexed by your favourite search engine (IE google).

Mailing List Ettiquite

When posting to a mailing list, please type in full, correct English (no MSN speak :p) and keep your message brief, polite and to the point (include more details if asked).
We also ask that you send e-mails in plain text rather than formatted HTML as HTML messages are likely to go straight into the trash without being read. Last-Modified: 2007-03-07 19:38:50