Debian User Forums • View topic – live-build basics: Make your own live-cd or usb-hdd

live-build basics: Make your own live-cd or usb-hdd

Postby fsmithred » February 17th, 2011, 5:04 am

Discussion: viewtopic.php?f=24&t=190

You can build your own live-cd or usb-hdd in debian with live-build, which used to be called live-helper. If you’ve done this before, this will be easy, but note that some of the commands and options have changed. If you’ve never done this before, it’ll be easy, and you won’t have to un-learn anything.

A lot of this howto is a rewrite and/or direct lift from previous howtos written by meandean at another forum.

Build it

# Install live-build by your favorite method. (aptitude, apt-get or synaptic are good choices)

# Create a directory for building the live image, change to that directory, and become root.

Code: Select all

mkdir live

cd live

su

The simplist build you can do is to issue the command, ‘lb config’ with no options, followed by ‘lb build’. If you do that, you’ll get a very minimal system in iso-hybrid format. The iso-hybrid is cool, because you can burn it to a cd or image it directly to a usb flash drive using the dd command, but it’ll be a boring build. Use some config options to make it more interesting. Here are some examples.

(pick one of the following configuration examples or create your own)

Code: Select all

# example – sid with kde-core

lb config -d sid -p kde-core

# example – squeeze with gnome-core with the debian live installer

lb config -d squeeze -p gnome-core –debian-installer live

# example – sid with lxde and some extra packages

lb config -d sid -p lxde –packages « audacious geany xfe »

# example – very minimal wheezy with the debian live installer,

# and without the 486 kernel

lb config -d wheezy -p minimal –debian-installer live –linux-flavours 686

# example – squeeze with xfce, with contib and non-free repos enabled,

# and with some extra packages

lb config -d squeeze -p xfce –archive-areas « main contrib non-free » –packages « openssh-server iceweasel flashplugin-nonfree »

# Build the image.

Code: Select all

lb build

Test it and use it

You’ll end up with an iso-hybrid image file. You can test it by booting it with qemu.

Code: Select all

qemu -cdrom binary-hybrid.iso

or

qemu -cdrom binary.iso (if you made a standard iso image)

qemu -drive file=binary.img (if you made a usb-hdd image)

If you’re familiar with virtualbox or vmware, you can test with those instead.

If you decide that you want to build it differently, or if it didn’t work, you can start over with

Code: Select all

lb clean

lb config –whatever-config-options

lb build

Burn the image to cd using your favorite burning software or image it directly to a usb flash drive with the dd command:

Code: Select all

dd if=binary-hybrid.iso of=/dev/sdX

where X is replaced with the correct letter for your usb stick. Note that there’s no partition number on that. You’ll be destroying any information on the usb stick and replacing it with the new image. Take care to name the correct drive. (dmesg and ‘fdisk -l’ are your friends here.)

viaDebian User Forums • View topic – live-build basics: Make your own live-cd or usb-hdd.

Retour en haut