From Mageia wiki
Jump to: navigation, search
draklive is a mastering tool that builds a live distribution according to a configuration file, creates a master image, and optionally installs it on a device. It used to be used for building the distribution Live media, but has now been replaced by draklive2 for that purpose.

Advantages

draklive's philosophy is to keep the live distribution as close as possible to a normal Mageia Linux distribution. All live-specific tweaks are done in a tiny initrd script. Since the Draklive initrd script is generated on-the-fly, it is very small, and is quite easy to debug should there be any problems.

The list of drivers included in the initrd is adjusted during the live distribution creation, according to the medium type. draklive uses the DrakX libraries to ensure an up-to-date drivers list is used.

Once the initrd script has finished booting, the system's root device will be used transparently by the distribution, and no additional tricks are required.

Hardware detection is done with harddrake, providing reliable integration with the host system.

Features

  • live CD
  • live distribution on USB key
  • easy to test over NFS
  • uses the Mageia installer to create the live system
  • fully read-write live system (using unionfs)
  • automatic hardware configuration (using harddrake)
  • generic code structure to make new technical choices quickly usable

Quickstart

Before continuing: The following packages must be installed on your system: x11-server-xnest squashfs-tools syslinux mkisofs rsync curl mtools.
For a better compression squashfs3-tools is required.

Getting the tool

Normally this is done by simply installing the draklive package. If you want to make any changes to the draklive tool itself, you can instead get the source code by

git clone git://git.mageia.org/software/build-system/draklive/

and then in subsequent instructions replace the draklive command by perl -I../draklive/lib ../draklive/draklive (this assumes you check out draklive in the same directory as draklive-config).

Getting the config files

git clone git://git.mageia.org/software/build-system/draklive-config/
cd draklive-config

Then, edit the repository address (and other local settings) in config/settings.cfg. Note that the repository address can be a URL to a remote server or a simple path to a local file system. If you are intending to create your own "remixed" Live ISO (and hence likely take a few attempts to get it just right), it is worth setting up your own local repository mirror to save repeatedly downloading the files.

Building a live CD or live USB

Konsole.png
[root@computer ~]# draklive --clean --all
[root@computer ~]# _


See the output of draklive --help for more details.

Recording a live USB

Konsole.png
[root@computer ~]# draklive --record --device /dev/sdX
[root@computer ~]# _


Where /dev/sdX is your USB key disk device (not partition)

Configuration

Example

  {
    system => {
        root => '/chroot/live/4',
        repository => '/mnt/BIG/dis/4/i586',
        auto_install => 'config/auto_inst.cfg.pl',
        rpmsrate => 'config/rpmsrate',
        vga_mode => 788,
        install_env => {
		},
    },
    media => {
        storage => 'cdrom',
    },
    mount => $predefined{mounts}{volatile_squash_union},
  };

Example: Creating a bootable cdrom for old computers unable to boot from a USB key

Modify the file config/live.cfg media hash as follows:

media => { storage => 'usb', boot => 'cdrom' },

And then run the command:

perl -I../draklive/lib ../draklive/draklive --config config/live.cfg --boot-only --boot --master

This will create the iso file: /your_workdir/images/boot.iso (your_workdir is /var/lib/draklive by default)

Choosing Desktop Environnement

To change the target desktop, pass

--desktop=PLASMA5|GNOME|xfce4|LXDE|Enlightenment

Package selection

If you need to adjust packages selection, edit 'rpmsrate_flags_chosen' for rpmsrate categories, 'default_packages' for additional packages, 'skipped_packages' to save space.

Exhaustive description

The configuration file should contain a hash of settings. Some settings have to be filled in the top-level, others have to be grouped in sub-hashes.

system sub-hash

This hash describes the installed distribution.

  • root: path of the installed distribution
  • repository: path to the installer repository
  • auto_install: installer auto_inst.cfg.pl file
  • patch_install: installer patch file (actually defcfg file)
  • postInstall: commands to be run (using bash -c after all the additional_media/rpm/patches steps are done)
  • install_env: hash reference of variables that should be passed to install (they will be usable in the auto_inst.cfg.pl as well)
  • additional_modules: array reference of .ko modules to be copied and loaded in the initrd
  • rpmsrate: local rpmsrate path (useful to add/modify/remove packages rate)
  • patches: array reference of patches to be applied directly in system root
  • rpms: array reference of rpms to be installed after installation
  • vga_mode: graphical mode which the live distribution should use
  • splash: set to no if you don't want to use a splash (default is yes)
  • kernel: default kernel release (optional)

media sub-hash

This hash describes which medium access should be used.

  • storage: medium type (cdrom or usb)

Optional fields:

  • boot: boot medium type to be used with --boot-only option, if any (cdrom or usb)

Or customised settings:

  • $custom{media}{nfs}->(module name, live system IP address, NFS source)

extra_media sub-array

This array should contain all extra media (see media sub-hash description) that the live system should support. This allows to make live systems using different boot types, using the copy wizard. For example, if the default media is of the cdrom type, and the extra media array contains a media using the usb type, the running live CD will allow to duplicate itself to both USB keys and CDs.

mount sub-hash

This hash describes how the live components have to be mounted together.

Some basic setups are predefined:

  • $predefined{mounts}{simple_union} : use the media contents as raw root, and mount it with a tmpfs using unionfs, to get a RW system
  • $predefined{mounts}{volatile_squash_union} : compress the distribution in a distrib.sqfs file, uses a tmpfs, and mounts them together using unionfs
  • $predefined{mounts}{squash_union} : compress the distribution in a distrib.sqfs file, a system.loop ext2 read-writable loopback file, and mounts them together using unionfs
  • $predefined{mounts}{multi_squash_union} : compress the distribution in a distrib.sqfs file, optionally uses a read-only system.sqfs "patch", a tmpfs, and mounts them together using unionfs

Or build your own mount type:

top-level settings

Live settings:

  • post: array of commands to be run at end of initrd
  • copy_initrd: copy the initrd to this location at the end of the initrd step (e.g. to /var/lib/tftpboot/live.rdz)
  • debug: include some debug tools in initrd (busybox, strace, ping) and run a debug shell at beginning of initrd

Directory settings (all optional):

  • workdir: draklive working directory (defaults to /tmp/draklive)
  • mnt: temporary mount point for draklive


References

draklive tools and One configuration files

Other live tools


Overlay filesystems

UnionFS

Other


Debug

If you need to debug the draklive you need to search for the file ddebug.log in the build directory of the live installation.

FAQ

  • Missing squashfs and lzma files?

In case you get an error "missing squashfs" and "missing lzma" you should uninstall the dkms-lzma and dkms-squashfs and install kernel-lzma and kernel-squashfs. You have to reboot the system after this and before starting draklive, modprobe squashfs. Also you can add in live.cfg in the section "rpms": "media/main/squashfs-lzma-kernel-2.6.31.5-desktop-1mnb-3.3-11mdv2010.0.i586.rpm" and "media/main/lzma-kernel-2.6.31.5-desktop-1mnb-4.43-28mdv2010.0.i586.rpm".


This was imported from Mandriva wiki licensed under CC-By-SA 2.5




fr:Draklive