HowToSetupLTSPDevelEnvironment
Introduction
This page is about the procedure to setup a developement environment for LTSP under Ubuntu.
Getting the software
Install the latest release of Ubuntu. Change the file /etc/apt/sources.list to use the development version.
Install software for general developement in Ubuntu :
sudo apt-get install dpkg-dev build-essential patch dh-make debhelper devscripts fakeroot gnupg lintian linda pbuilder debian-policy developers-reference
Then, install build dependencies for ltsp-server :
sudo apt-get build-dep ltsp-server
Build the base client root with the following command :
ltsp-build-client
Manage dev and test environment
To work efficiently, then you can keep two (or more) copies of the client root. The first for the development, and the other for testing purpose.
cp -a /opt/ltsp/i386 /opt/ltsp/i386-dev cp -a /opt/ltsp/i386 /opt/ltsp/i386-test
Edit the file /etc/ltsp/ltsp-update-image to define the current used root :
CHROOT=i386-dev
Each time something is changed in the client root, squashfs image must be rebuilt. To do it, use the ltsp-update-image command.
Regenerate the initramfs
The initramfs is built from inside the client root. You can build the initramfs with the standard command. Then, initramfs have to be updated on the server.
chroot /opt/ltsp/i386-dev mkinitramfs -o /boot/initrd.img-2.6.22-8-386 2.6.22-8-386 exit ltsp-update-kernels
In order to use the dev and test environment when thin-client are booted, the root-path option must be changed, and the dhcp server restarted.
# from /etc/ltsp/dhcpd.conf filename "/ltsp/i386-dev/pxelinux.0"; option root-path "/opt/ltsp/i386-dev";
If you are using vmware under Linux, options are the same, then change the following file (depending on the vmnet number) : /etc/vmware/vmnet8/dhcpd/dhcpd.conf and restart vmware.
Also, notice that a new port is reserved for each client root available in the file /etc/inetd.conf . The port number should be specified manualy in the file pxelinux.cfg/default with the option NBDPORT. Here is an example of the whole line :
DEFAULT vmlinuz ro initrd=initrd.img quiet splash NBDPORT=2001
Using NFS in replacement of NBD
With NBD, every time you change the client root, the squashfs image must be rebuild to apply changes, and the thin-client needs to be rebooted. To speed up development, you can enable NFS root, then changes will be applied immediately. Follow the instructions at the bottom of this page : https://help.ubuntu.com/community/UbuntuLTSP/LTSPWithoutNFS
As of this writing, the configuration file for the boot parameter for nbd is held in the file /usr/share/initramfs-tools/conf.d/ltsp which is not flagged as a conffile. It will be overwritten at the next update. There is a bug opened about it : https://bugs.launchpad.net/ubuntu/+source/ltsp/+bug/131641
The order of variable sourcing is as follow :
- - /etc/initramfs-tools/initramfs.conf
- - /etc/initramfs-tools/conf.d
- - /proc/cmdline
Also, by default "most" modules are added into the initramfs. "Most" includes all other categories, including network card drivers, nfs, nbd, unionfs, squashfs, usb and many others.
See the content of the initramfs
To debug initramfs, you may want to see files that it contains. First, copy the initrd.img file to a temp directory. Then, run this command :
zcat initrd.img | cpio -div
Getting the source
Branches are hosted in launchpad : https://code.launchpad.net/ltsp/
In order to create a new branch, create an account on launchpad and upload your ssh public key. Then, you will be able to connect to the bazaar server and create your new branch.