About me

My name is Rich Jerrido and I am the person behind www.outsidaz.org I am a geek hailing from the city of brotherly love. I started this blog a couple of years back as a dumping place for a lot of working knowledge of mine that I could have available online regardless of where I was. Over time it has evolved into being a full-fledged blog, complete with RSS feeds, comments, and pictures.When I am not hacking on computers for profit, I hack on them for fun.Read more about me »

New Year….New Desktop

New Year….New Desktop Featured Work

Keep in touch

RSS Feed Twitter Facebook Delicious

Subscribe via Email

Spinning your own Live Media with Fedora’s LiveCD Tools

January 1st, 2010 by RichJ received No Comments »

Fedora LiveCD’s are one of the coolest features of modern operating systems today. In short, a LiveCD lets one take an entire OS and make it bootable, fully functional, and occasionally installable. As time passed, LiveCDs became LiveDVDs & LiveUSB. For the purpose of this article I will group them under the umbrella term of “Live Media”. Having a fully featured OS on removable media has some very tangible benefits. The two biggest ones by far are in the areas of system recovery and demos. The system recovery aspect is very important to me. Back when I used to consult for a particular “well-known” company that specialized in Disaster Recovery and Business Continuity Planning, a Knoppix CD was on me during all DR tests I supported. Being able to diagnose a non-booting system, either Linux or Windows saved my butt on many occasions. Also, being able to demonstrate Linux (or OpenSolaris or the BSDs) in a non-invasive manner lowers the barrier of entry to many people. In the past, creating Live Media was fairly hackish and frequently required an enchantment or two to get working properly. With the advent of Fedora’s LiveCD Tools, creating LiveCDs are a simple as creating Kickstart files.

Install the required packages:

#yum install livecd-tools spin-kickstarts

Take a look at the standard base kickstart file /usr/share/spin-kickstarts/fedora-live-base.ks. The contents of this file look like pretty much every other kickstart file. One of the things I like to do is update the “repo” stanzas to use a local yum repository. This way, I get two major benefits. Firstly, my LiveCD composes complete faster, and secondly, it allows me to be a good internet citizen and not beat up on the mirrors.

# fedora-live-base.ks
#
# Defines the basics for all kickstarts in the fedora-live branch
# Does not include package selection (other then mandatory)
# Does not include localization packages or configuration
#
# Does includes "default" language configuration (kickstarts including
# this template can override these settings)

lang en_US.UTF-8
keyboard us
timezone US/Eastern
auth --useshadow --enablemd5
selinux --enforcing
firewall --enabled --service=mdns
xconfig --startxonboot
part / --size 3072 --fstype ext4
services --enabled=NetworkManager --disabled=network,sshd

# To compose against the current release tree, use the following "repo" (enabled by default)
#repo --name=released --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-12&arch=$basearch
# To include updates, use the following "repo" (enabled by default)
#repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f12&arch=$basearch

# To compose against rawhide, use the following "repo" (disabled by default)
#repo --name=rawhide --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch

# To compose against local trees, (edit and) use:
#repo --name=f12 --baseurl=http://localrepo/fedora/releases/12/Everything/$basearch/os

%packages
@base-x
@base
@core
@fonts
@input-methods
@admin-tools
@dial-up
@hardware-support
@printing
kernel
memtest86+

Edit the kickstart file as necessary to suit your particular choice in packages. Next, build the LiveCD.

sudo livecd-creator --config=fedora-live-base.ks

Sample output would like similar to the following:

mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=fedora-live--x86
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
196608 inodes, 786432 blocks
7864 blocks (1.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=805306368
24 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912

Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
tune2fs 1.41.4 (27-Jan-2009)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds

--------

 Installing: filesystem                   ##################### [  2/640]
  Installing: kernel-headers               ##################### [  3/640]
  Installing: xml-common                   ##################### [  4/640]
  Installing: nodoka-filesystem            ##################### [  5/640]
  Installing: nodoka-metacity-theme        ##################### [  6/640]
  Installing: basesystem                   ##################### [  7/640]
  Installing: mobile-broadband-provider-in ##################### [  8/640]
  Installing: tzdata                       ##################### [  9/640]
  Installing: control-center-filesystem    ##################### [ 10/640]

---------

Total translation table size: 2048
Total rockridge attributes bytes: 2987
Total directory bytes: 8192
Path table size(bytes): 64
Max brk space used 1c000
285270 extents written (557 MB)
Inserting md5sum into iso image...
md5 = e7921fa175c3592629829a9e2a1d5ee0
Inserting fragment md5sums into iso image...
fragmd5 = 144b3356de1275c5d3291c1556ddd37f45b7652161988f973d15eeba7e8c
frags = 20

After the LiveCD is finished, there will be an ISO located in the current working directory named livecd-fedora-live-base-.iso (By default). You can burn this ISO to disk, boot a VM off of it.. In Fedora 12 (and later), a LiveCD ISO image can be directly written to a thumbdrive with the dd command. Assuming your thumbdrive is /dev/sdb, just run:

dd if=livecd-fedora-live-base-200912311702.iso of=/dev/sdb

No, really, it IS that simple.

Posted under: Linux, Linux - Fedora



Leave a Reply