[SOLVED]! How to add 'excluded' module to LTSP 5? 

I managed to solve the issue today, so I'll go over the steps I took in
detail, hoping they may help others stuck in similar perilous situations.

Note: These instructions are specific to LTSP running on Ubuntu 10.04. Side
effects may vary for alternate distributions.

Please note that I have started with a fresh i386 chroot, which is now
using kernel 2.6.32-30-generic
sudo ltsp-build-client --arch i386

# Copy over the LTSP server source list:
sudo cp /etc/apt/sources.list /opt/ltsp/i386/etc/apt/sources.list

I have decided to compile the module from within the chroot, which is not
really necessary. Nonetheless it's the method I used.

#Prevent server from restarting its own daemons when upgrading the chroot
export LTSP_HANDLE_DAEMONS=false

# Enter LTSP chroot environment
sudo chroot /opt/ltsp/i386

# Make sure /proc is mounted
mount -t proc proc /proc

# And update the package list
apt-get update

# Install required build packages, tools, and dependencies.
apt-get install fakeroot build-essential crash kexec-tools makedumpfile
kernel-wedge
apt-get build-dep linux
apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc
binutils-dev

# Setup kernel build dependencies to match the version running on LTSP, in
my case this was 2.6.32-30-generic.
apt-get build-dep --no-install-recommends linux-image-2.6.32-30-generic
# Change to the directory where you would like the kernel source to be
placed (Eg. /usr/local/src), and retrieve the kernel source.
apt-get source linux-image-2.6.32-30-generic

# Now it's time to create/modify the kernel config. I started by creating
my own 'flavour' called 'vortex', based on the generic i386 flavour.
# Make sure you are in the directory that you just downloaded the source
into.
cp debian.master/config/i386/config.flavour.generic
debian.master/config/i386/config.flavour.vortex
fakeroot debian/rules clean
debian/rules updateconfigs

# Now, to edit the kernel configuration use the following command. Only
edit the flavour you require (i386-vortex in my case), and answer "No" to
modifying other configurations.
debian/rules editconfigs

# The previous command will bring up the menuconfig window. I needed to
change the following for my device:
Device Drivers-->Network device support-->Ethernet (10 or 100Mbit)-->RDC
R6040 Fast Ethernet Adapter support (as module)
Processor type and features-->Processor family-->586/K5/5x86/6x86/6x86MX
# Exit out of menuconfig and make sure you choose to save the kernel
configuration.

# We need to customise some files based on the newly created 'vortex'
flavour.
vi debian.master/etc/getabis
# Search for the line starting with:
getall i386 generic generic-pae 386
# And change it to:
getall i386 generic generic-pae 386 vortex

# And another file...
vi debian.master/rules.d/i386.mk
# Search for the line starting with:
flavours        = generic generic-pae 386
# And change it to:
flavours        = generic generic-pae 386 vortex

# Now we need to make the compilation process aware of the new 'vortex'
flavour. I modified the description in this file, too.
cp debian.master/control.d/vars.generic debian.master/control.d/vars.vortex

# Cross compile, compile, compile... the flavour dependent files.
skipabi=true fakeroot debian/rules binary-vortex

# The module is now built and can be copied into the appropriate area on
the LTSP chroot
cp ./debian/build/build-vortex/drivers/net/r6040.ko
/lib/modules/2.6.32-30-generic/kernel/drivers/net/

# Run depmod
depmod 2.6.32-30-generic

# ...and verify the module is now present in the modules.dep file:
$ cat /lib/modules/2.6.32-30-generic/modules.dep | grep r6040
kernel/drivers/net/r6040.ko: kernel/drivers/net/mii.ko

# Make sure this module is placed in the initramfs by adding the name of
the module and dependencies ('r6040' and 'mii') on two separate lines in
the following files.
# This is probably only required to be entered in one file, but I haven't
bothered isolating which one.
vi /usr/share/initramfs-tools/modules.d/r6040 
vi /etc/initramfs-tools/modules

# Now it's time to update the initramfs
update-initramfs -c -k 2.6.32-30-generic

# ..and exit the chroot
exit

#...and unmount /proc
sudo umount /opt/ltsp/i386/proc

# Now we need to move the new chroot initramfs to the tftp folder
sudo ltsp-update-kernels

# ...And regenerate the LTSP image
sudo ltsp-update-image -a i386

And hey presto, the fresh compiled 'excluded' module is now present in the
initramfs, and more importantly, will now load without giving any errors.
Now why couldn't somebody have just told me the required commands to do
that in the first place? :^) 

Thank you to everyone who has given their advice, and all the very best, 
Tomas.














------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to