Building custom LTSP kernels
This page is where people can add their notes for how to go about building custom kernels for LTSP.
WARNING! Much of this information is for LTSP prior to version 4.2. For version 4.2, you can download the
ltsp_kernel_kit from the
Download page.
Building and using kernel 2.6.13 on ltsp 4.1
Environment
- debian
- ltsp 4.1
- kernel linux-2.6.13
- mknbi-1.4.3-2
Building a new kernel
- Get kernel from ftp.kernel.org or mirrors, and decompress it in your directory of choice.
KERNELSRC=/usr/src/linux-2.6.13
- in order not to deal with loading modules, and since I know exactly drivers we need for our ltsp clients, I chose to build the drivers directly into the kernel (choose Y instead of M for those drivers)
- choose the options which make sense for your hardware, such as processor type, power management, etc.
- devfs is obsolete in kernel 2.6.13, however, is used by the ltsp project. Luckily the source for devfs is still part of the kernel, but we must add configuration options for it.
- > patch -p0 < Kconfig.patch
- here are the options which, for the ltsp to work, MUST be set as follows:
Networking->Networking Options->IP: kernel level autoconfiguration
- setting this option to Y will open up three more options underneath it:
Networking->Networking Options->IP:
DHCP support
Networking->Networking Options->IP: BOOTP support
Networking->Networking Options->IP: RARP support
I set all three to Y.
Network File Systems->NFSv4 client support
Network File Systems->NFSv4 server support
Network File Systems->Root file system on
NFS
Set all three to Y.
File systems->Pseudo filesystems->/dev file system support
set it to Y.
Miscellaneous filesystems->Compressed ROM (cramfs)
set it to Y.
Block devices->RAM disk support
Block devices->Initial RAM disk (initrd) support
set these two to Y.
- I attached my .config file at the end of this doc (it seems that significant deviation from my .config causes a kernel oops early in the booting process; sadly, I don't have the time now to investigate which option(s) does it)
- save a copy of your .config file, in case you need to do this again
- > make bzImage modules_install
- if all went well there should be a directory /lib/modules/2.6.13 containing all modules
Preparing the new kernel for etherbooting
- NOTE: a word of caution. One should probably make sure that the new initrd.gz actually fits in the ram disk.
- find a copy of initrd-2.6.9-ltsp-3.gz (somewhere in /tftpboot/lts/2.6.9-ltsp-3)
- > cp /tftpboot/lts/2.6.9-ltsp-3/initrd-2.6.9-ltsp-3.gz .
- > mv initrd-2.6.9-ltsp-3.gz initrd-2.6.13.gz
- > gunzip initrd-2.6.13.gz
- > mkdir /mnt/initrd
- > mount -o loop initrd-2.6.13 /mnt/initrd
- > rm -rf /mnt/initrd/lib/modules/*
- > cp -r /lib/modules/2.6.13 /mnt/initrd/lib/modules
- > rm -f /lib/modules/2.6.13/modules.alias
- NOTE: the presence of modules.alias caused a kernel oops, so I deleted it
- > cp -r /lib/modules/2.6.13 $LTSP_ROOT_PATH/lib/modules
- > CURRDIR=`pwd`
- > cd /mnt/initrd/
- > patch -p0 < $PATH_TO_LINUXRC_PATCH/linuxrc.patch
- > cd $CURRDIR
- > umount /mnt/initrd/
- > gzip initrd-2.6.13
- > mkelf-linux --append="init=/linuxrc rw" --rootdir="/dev/ram0" $KERNELSRC/arch/i386/boot/bzImage initrd-2.6.13.gz > vmlinuz-2.6.13
- now you have a kernel (file vmlinuz-2.6.13) ready to be etherbooted, so copy it into /tftpboot, or /tftpboot/lts, depending what your setting is in /etc/dhpcd.conf
Loading any other modules in the kernel
The usual way, add to your lts.conf lines like
MODULE_1 = "modulename"
e.g.
MODULE_01 = "usbkbd"
MODULE_02 = "usbmouse"
The attachements don't work ... needs to be checked ...
--
TWikiGuest - 03 Oct 2005
I have just tried the attachments, and they work.
--
ReluPatrascu - 27 Jan 2006