http://www.linux-live.org/?howtos

Linux Live is a set of shell scripts which allows you to create your own Live Linux from an already installed Linux distribution. The Live system you create will be bootable from CD-ROM or a disk device, for example USB Flash Drive, USB Pen Drive, Camera connected to USB port, and so on. People use Linux Live scripts to boot Linux from iPod as well.

 

How to build a Live distro:

1)

Install your favourite distro to disk partition, or into a folder on your existing system.

   

Slackware is recommended but not required.

2)

Build aufs kernel module and squashfs kernel module (optionally patched to support LZMA)

   

The step above is not required if you use precompiled Linux Kernel from this website

   

Install kernel modules to the newly installed distro to /lib/modules/`uname -r`/fs/.

   

Make sure you are running the same kernel you used to compile modules

3)

Remove all unnecessary files (for example man pages and all other files you don't need),

   

to make your Live Linux system as small as possible (this step is optional).

4)

Download Linux Live scripts from this website and unpack it in /tmp

   

Read ./DOC/requirements.txt to find out what linux-live scripts need

   

Edit .config file if you need to modify some variables

5)

Finally login as root and run ./build

   

Live distribution's 'directory tree' will be created in /tmp/live_data_1234

   

where 1234 is a random number

6)

To make ISO image, run make_iso.sh

   

To make a bootable (usb) disk, run bootinst.sh

 

Working example

If you're just looking for a working Linux Live system, visit www.slax.org

 

Interesting features of Linux Live scripts

1)

persistent changes

Use 'changes=...' boot parameter to specify persistent changes directory or file. If a directory is used, eg. changes=/some_dir/ and the /some_dir/ is found on some partition on your disk, then all the changes made to the root filesystem will be saved to that directory. This works even if /some_dir/ is on NTFS or VFAT, thanks to posixovl overlay (an userspace filesystem, already included). Important note: if you plan to save changes on VFAT, make sure to modify your distribution's shutdown scripts. It must not execute killall, else posixovl is killed and everything is wrong. Instead, call the cleanup script from /mnt/live/cleanup. If a file is specified for the changes boot parameter, eg. changes=/path/file.dat, and the file has a valid filesystem inside, then the file will be loop-mounted and changes written to it. You may also use changes=/dev/sda1/path/ and changes=/dev/sda1/path/file.dat ... to specify particular device where to look for. Other devices will be skipped (will not be even mounted).

2)

adding modules on the fly

In the ./tools/ directory of Linux Live, you will find 'activate' and 'deactivate' scripts. You may use these two to add and remove additional LZM modules to the root filesystem on the fly, while your Live OS is running.

3)

installable system to disk

As mentioned in the previous section, there exists a script called bootinst.sh (and bootinst.bat) to setup a boot sector to boot Live Linux from disk. If you combine that with persistent changes, your Live distro will behave like INSTALLED, all changes are transparently stored to the boot media (even to USB), and you can still use 'activate' and 'deactivate' commands to manipulate the root filesystem.

 

(c) 2009 Tomas M. (www.slax.org) - I will be happy for all feedback, mail me!

Reply via email to