Tutorials

Friday, October 26, 2012

Fedora 17 - Custom Spins

If you have multiple computers that you install Fedora on, custom live CD's or DVD's can be a wonderful time saver for multiple installations.  You can build upon an existing spin, or start from scratch and build your own Fedora spin from the ground up.

If you build upon an existing Fedora spin, when the next version of Fedora is released you'll be armed with a kickstart file from the old release.  The benefit here is that the list software you've installed into your live media can be easily transferred to the next Fedora release.

Note that you will need plenty of space in /var for this to complete.  For a CD, you'll need about 700MB for the install packages, 5.5 gigs for the install target, and 700mb for the ISO image.

Let's get going!


Install Software

As root,

yum -y install livecd-tools spin-kickstarts


livecd-tools contains the necessary software to create the images.

spin-kickstarts contains the official Fedora spins kickstart files.  This will be a big time saver, and give you a foundation with which to build your live CD from.  It can also be used as a reference for building your own independant kickstart files from scratch

Overview

Now that everything, including reference materials, has been installed, let's start looking at what we have

/usr/share/spin-kickstarts is where the kickstart files for Fedora spins are located.  Let's take a look at a few of the lines in the fedora-livecd-kde.ks file, which is used to build the Fedora Live KDE CD that is downloaded from the Fedora website.

fedora-livecd-kde.ks

%include fedora-live-kde-base.ks
%include fedora-live-minimization.ks

%packages

-desktop-backgrounds-basic
-scribus

calligra-words
fuse
%end

%post
%end


The first thing this kickstart file does is load two other kickstart files, using %include.  This is how I will be building my own KDE spin, by reading in the official kickstart file, and adding on from there.

Then follows the packages section located within the %packages and subsequent %end lines.  Adding packages is as simple as specifying the package name.  Remove a package my preceding the name with a dash.

The post section, located within the %post and subsequent %end lines, is for issuing commands after "installation" to the live media image is complete. 

Setup Your Build Environment, and Test

Create a directory in which to build your live media, and copy the kickstart files to this directory


mkdir ~/spin
cp /usr/share/spin-kickstarts/*ks ~/fedora_spin



Next, create your kickstart file.  I'll call mine test-livedvd-kde.ks

~/spin/test-livedvd-kde.ks

# test-livedvd.ks
#
# Description:
# - Giltner Fedora Remix
#
# Maintainer(s):
# - Giltner Tech <giltnertech@gmail.com>


%include fedora-livecd-kde.ks

clearpart --all
part / --size=4096 # Sets filesystem limit to a DVD, instead of CD

%packages
-calligra            #Remove Calligra
-calligra-words
-calligra-sheets
-calligra-stage

libreoffice
libreoffice-kde
kate                 # Include text editor


%end

%post
%end


Let's take a look at the above example.
  • The first several lines beginning with a hash (#) are comments.  They are there for reference.
  • Under that, is the clearpart and part lines. This clears any partitions setup inside any included file (and must come after all include lines) and sets the filesystem to a single layer DVD
  • Next is the packages section.  Here, we remove all of Calligra, and include Kate.
  • Nothing exists in the post section for this example.
Let's build the media!  (Note that SELinux must be turned off.)

As root, do

setenforce 0
livecd-creator --config=/home/giltner/spin/test-livecd-kde.ks --fslabel=Test --cache=/var/cache/live 


This process, depending on the speed of your Internet connection, can take some time.  The build process, minus download time, on my system is about an hour.  The first time I ran a small test, I didn't expect it to take as long as it did.  To that point, here is an unofficial rundown of the build process, based on my watching of the filesystem.

When the terminal is blank, or a few error lines
  1. All necessary RPM packages are downloaded to /var/cache/live.
  2. /var/tmp/imgcreate-*/install_root is prepared 
The terminal appears to be installing software
  1. The packages are installed to /var/tmp/imgcreate*/install_root.
  2. Install_root is cleaned, and moved to /var/tmp/imgcreate*/tmp-*
When the terminal pauses at 99%
  1. Contents of the ISO image are created in /var/tmp/imgcreate*/iso-*
When  percentages scroll on the screen, with estimated finish time
  1. The ISO image is created in /var/tmp/imgcreate-*/out
 And finally, when a summary is output to the terminal
  1. The ISO image is moved and renamed to /home/giltner/spin/Test.iso
  2. The /var/tmp/imgcreate* directory is removed
Note that the downloaded RPM packages are not deleted from /var/cache/live, so they can be used for the next build.

If you either burn and boot the ISO image, or boot it up in a virtual machine, you will have a Fedora KDE desktop, without Calligra, and with Kate.

Using the above, you can easily customize the installed software that resides on the live media, and thus gets installed from that media.  If you take a look at the existing kickstart files, you'll see that there's lots more that can be done!

And I'll be addressing a slightly more advanced kickstart file in my next post!



3 comments:

  1. Twitch TV channel activation on Roku
    If you are new to the Roku streaming platform, select the best device among Roku Express, Express Plus, Premiere, and Premiere plus. Complete the setup and then navigate to the store. Add the channel to find the activation code. This code must be provided on the page, Twitch.tv/activate. Sign with the Twitch TV channel account, if required. If you are expecting any help to complete Twitch TV channel activation, talk to our network support team by dialing our number +1-855-718-4111 and visit our site twitch.tv/activate

    ReplyDelete
  2. How to Activate the USTV on Roku?
    USTV offers a brilliant collection of TV shows and movies directly to your home via your Roku streaming devices. If you wish to activate the USTV on Roku, you cannot directly download the app from the Roku Channels Store. Instead, you can follow the subsequent steps to activate the USTV channel app as a private channel on your Roku. Head to the USTVNow.com/Roku portal from your Roku web browser and click on the Add Channel button. Once added, you can launch the app from the Roku Channels list and activate it by entering the code on the portal again.If you want more information about USTV on Roku please visit our siteUSTVNow.com/Roku and Contact our helpline for further questions +1-805-436-1200?

    ReplyDelete
  3. How to Activate TCM on Roku?.
    Select your Roku device and complete the setup, if it’s brand new. Now sign in to the Roku account and check if your device is linked to the roku account.
    If yes, visit the appropriate channel store. Search typing the channel name. As soon as you receive the channel search results,
    provide the code navigating to the page, tcm.com/activate. For help and support to execute TCM channel activation,
    contact our team of network support team by dialing our number +1-855-626-1730 and
    visit our site www.tcm.com/activate

    ReplyDelete