Updated 14 March 2014
Updated Ubuntu and the Debian distros have made patching and recompiling un-necessary. I have not had to recompile a kernel for the last two years. The Ubuntu Server 12.04 appears to be my best choice right now.
Before you recompile your kernel you may want to look at the Ubuntu notes on compiling a new kernel. Go to Ubuntu's Community page. You don't have to go to the latest kernel, but if you are re-compiling you might as well use the latest source.
Start by using a browser like Conqueror or Mozilla Firefox and goto
http://www.kernel.org.
Look for the The latest stable version of the Linux kernel and download the file under F, the full
source.
Switch to a root session. Move this file into the /usr/src/ directory and go into this directory
tar xvf linux-2.6.28.tar.bz2
This will create linux-2.6.28 directory.
Create a symbolic link to linux . This points the compiler to the proper source files.
ln -s linux-2.6.28 linux
We usually patch the kernel source files to include the latest changes in AX25 and ROSE modules, but you may add patches for other functions. Often the patches have been tested, but may not have yet been included in the latest kernel. These are called Release Candidates or RCs. Download the patches into /usr/src/ :
Now create these two symbolic links to linux. Symbolic links are like Windows short cuts. They will be used by the patch file to point to linux directory where your kernel source code is filed. The patch file will read from a and write the updated (patched) source to b.
ln -s linux a
ln -s linux b
Unpack and apply one patch at a time. Example :
patch -p0 < kernel-2.6.28.ax25.patch
Enter the linux directory :
cd linux
Copy your old kernel configuration into the /usr/src/linux folder.
cp -vi /boot/config-`uname -r` linux/.config
Change Dir to the linux-source Dir.
cd /usr/src/linux
Edit the kernel's configuration.
make menuconfig
A menu will pop-up and you will be able to select or deselect the different items, Some items are selected by default.
This is the tricky part. Most of the time the Old config is good. I remove the SPM (multi CPU support), set the processor type to match my processor and add the DAMA Slave to ax25. The DAMA Slave support is important. Without this option you will experience a problem with the generation of the /proc/sys/net/ax25/ directory.
For a Linux an Packet server you may want to select the timer frequency 250 Hz option under the processor type and features menu. This speeds up the interrupt frequency.
To configure your kernel's AX.25 modules, you need to select the sub menu Networking and then the Amateur Radio Support sub menu.
Enabled modules are indicated by a letter M (menuconfig) . To disable an item, type N (menuconfig) .
In the sub menu Amateur Radio Support enable all of the protocols.
Select the AX25 Network Device Drivers menu and enable all of the items.
That includes - serial port KISS driver, serial port 6PACK driver, BPQ Ethernet driver, Highspeed (DMA) SCC driver for AX.25, Z8530 SCC driver, all the BAYCOMs, YAM driver for AX.25.
Now to compile the kernel
Debian systems use a Perl script to compile and package a kernel into one or two files.
These files are transportable to another Debian system so that if you are doing more than one system you don't have to keep recompiling. This requires a package named kernel-package.
Use the command
apt-get install kernel-package.
Compiling the kernel plus all modules can take a lot of time on a slow computer. For example, it takes about two and a half hours on a 500 MHz Pentium III. Start the script for building a kernel with the command
make-kpkg --initrd kernel-image kernel-headers
Till now you have just bee n burning cycles and filling up file space. Now we are going to install the kernel that we just build.
First change back to the /usr/src/ directory.
cd /usr/src/
List the contents of the directory . There will be two .deb files, one for the OS image (linux-image) and the other for rebuilding modules (linuxheaders). They are Debian install packages.
They will look something like this:
linux-image-2.6.24-3_2.6.24-3_i386.deb
linux-headers-2.6.24-3_2.6.24-3_i386.deb
To install the image use the command.
dpkg -i linux-image-2.6.23-3_2.6.23-3_i386.deb
This takes awhile. Disreguard the messages about files Not found.
Now install the headers.
dpkg -i linux-headers-2.6.23-3_2.6.23-3_i386.deb
If everything went well you can now reboot your system. The choice for the new kernel will appear on the
GRUB boot menu on a line showing Linux with 2.6.24 kernel ( if
you compiled 2.6.24 kernel). If the system reboots correctly you will
have now a Linux system with AX25 and ROSE modules up to date. You
can verify the availability of AX25 modules by loading some of the
modules.