LIVELFS 5.1 mini-HOWTO

How to create LiveLFS 5.1 - a compressed bootable CD containing LFS 5.1

The lfs2livelfs.sh script builds an iso image, containing your Linux From Scratch 5.1 installation.

The process is divided in two steps:

LFS 5.1 preparation and LiveLFS iso image building


I - LFS 5.1 preparation

0) Build LFS 5.1 according to LFS book

FBBG :)

1) Build a new LFS kernel

Required built-in options:

  • loopback devices support
  • ramdisk support
  • initial ramdisk (initrd) support
  • transparent decompression extension
  • zlib decompression support
  • Be sure that your .config file defines CONFIG_ZLIB_INFLATE.

    Install bzimage under /boot/livelfskernel


    Alternatively, you can pick an already built kernel.

    An already built 2.4.26 kernel can be found here with related system map and .config file.

    Update your lilo configuration and *REBOOT* with your new kernel.


    2) Build Knoppix cloop kernel module + create_compressed_fs command

    Once again: check you have rebooted using your new kernel.

    Get latest cloop.o Knoppix kernel module sources and follow building instructions from the README file.

    After successful cloop.o building, you should be able to load it:

    # insmod -f /lib/modules/misc/cloop.o
    
    should work.

    And create_compressed_fs as well:

    # create_compressed_fs
    Usage: create_compressed_fs [-b|--best] filename blocksize(bytes).
    Use '-' as filename for stdin.
    #
    


    II - LiveLFS iso image building

    1) Tools and config files

    The lfs2livelfs.sh script relies on a dedicated tools directory ($MYLIVELFSTOOLSDIR).

    In this directory must be installed

  • Knopppix ash statically linked utility
  • syslinux package from H. Peter Anvin
  • LiveLFS boot config files package
  • a) Knopppix ash statically linked utility
    Get latest ash binary here and extract ash.static exec:
    # ar x ash-knoppix_0.2-4_i386.deb
    # tar zxvf data.tar.gz ./bin/ash.static
    # mv ./bin/ash.static $MYLIVELFSTOOLSDIR/ash
    
    b) syslinux package
    Get latest syslinux package (.tar.gz) in http://syslinux.zytor.com/download.php and store it in $MYLIVELFSTOOLSDIR.
    c) LiveLFS boot config files package
    Store livelfs_bootconfig.tar.gz in $MYLIVELFSTOOLSDIR.

    2) lfs2livelfs.sh script

    Since required mkisofs and cdrecord commands are not built in LFS 5.1, we have to use a standard distribution, like the one used to build LFS 5.1, for the last step :(.

    So, please *reboot* to your favorite Linux distro now, and be sure your LFS 5.1 partition and $MYLIVELFSTOOLSDIR are accessible thanks to appropriate mounts.

    Update your PATH variable to be able to run previously built create_compressed_fs command. If you encounter any problem, you can build and install now (on your host system) create_compressed_fs command from cloop sources.

    Edit then the lfs2livelfs.sh script to adjust all MY* variables to fit your configuration.

    You must pay particular attention to:

    MYLFSROOT: the mount point for LFS 5.1.

    MYLIVELFSTOOLSDIR: LiveLFS tools directory.

    MYLFSBUILDDIR: a temporary disk space, at least 300 MB free.

    MYISOTOCD: if set to "yes", the lfs2livelfs.sh script will burn the iso image.

    MYCDISRW: if set to "yes", the lfs2livelfs.sh script will blank the CDRW before burning.

    MYSELECTED_NET_MODULES: here specify the net modules you may need.


    Then, as root, run lfs2livelfs.sh, reboot and have fun!

    Any feedback welcome.

    Last modified 12/28/2004