Visit our website:


From LinutopWiki

Version 1.1.5


Custom boot scripts

The Linutop OS boot is handled by lrd (fork of casper), a set of scripts which customize a standard debian based OS to make it run as a live CD. Everything is done using the kernel initrd.

The last script run by lrd will run all the shell scripts found in the casper-local directory on the first partition of the system (This directory doesn't exist by default, you need top create it if you want to use custom scripts).

Those scripts act on what will become the "real" system. So when writing scripts, keep the following in mind:

  • the final system is mounted on /root, so you might need to chroot in this folder to perform certain actions (apt-get install'ing softwares for instance)
  • all the mounts have been performed already. If you boot in the default mode, /root/home/linutop already exists, so you can add/remove data in the user dir
  • the USB stick (or internal flash) is mounted on /root/cdrom

Simple examples

Install a package


chroot /root apt-get install gftp

exit 0

Load a kernel module


insmod /root/cdrom/mymodule.ko

exit 0

Modify a file


auto eth0
iface eth0 inet static

Use an external drive as /home

This will only work on Linutop 2 due to BIOS limitation on Linutop 1. Make sure to first boot from the internal drive (hdd0) in the BIOS settings.

Change the device ID and filesystem to fit your needs.


mount -t ext3 /dev/sda1 /root/home
if [ ! -d /root/home/linutop ]; then
  cp -R /root/etc/skel /root/home/linutop
  chown -R 1000:1000 /root/home/linutop

exit 0