From Fedora Project Wiki

(Starting a rewrite of this page here)
 
mNo edit summary
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The following worked for me for using livemedia-creator: livemedia-creator --make-iso --no-virt --ks /usr/share/spin-kickstarts/fedora-live-xfce.ks I didn't need to flatten the ks files. I didn't need to install any dependencies, but that might be because I typically have the kitchen sink installed on my machines. If you have a local copy of the repos, you want to edit the repo commands in the ks files so that you don't download stuff again and use a bunch of extra disk space.
I'm not sure why there is a copy of the page in the talk section.
New Page: https://fedoraproject.org/wiki/Livemedia-creator-_How_to_create_and_use_a_Live_CD
{{autolang|base=yes}}
<noinclude>
<noinclude>
[[Category:Spins]]
[[Category:Spins]]
Line 4: Line 12:
</noinclude>
</noinclude>


This page explains how to make a custom-content Live CD or DVD on Fedora-based systems including derived distributions such as RHEL, CentOS and others.  
== Introduction ==
 
This page explains how to make a custom-content Live CD or DVD on Fedora-based systems including derived distributions such as RHEL, CentOS and others.
 
If you simply want to burn a pre-made  ISO to a disc, visit http://fedoraproject.org/en/get-fedora to download a LiveCD or LiveDVD,  then see the [http://docs.fedoraproject.org/install-guide/ install guide] or [http://docs.fedoraproject.org/readme-burning-isos/ burning how-to] for further  instructions.
 
See  the [[FedoraLiveCD | project wiki]] for more details. Discussion of this  project takes places at http://admin.fedoraproject.org/mailman/listinfo/livecd.


If you simply want to burn a pre-made ISO to a disc, visit http://fedoraproject.org/en/get-fedora to download a LiveCD or LiveDVD, then see the [http://docs.fedoraproject.org/install-guide/ install guide] or [http://docs.fedoraproject.org/readme-burning-isos/ burning how-to] for further instructions.
== Instructions ==


See the [[FedoraLiveCD | project wiki]] for more details. Discussion of this project takes places at http://admin.fedoraproject.org/mailman/listinfo/livecd.
The basic workflow for creating a  remix is:


#  Create a kickstart file that specifies the packages you want installed  on your remix, along with special settings you want to tweak.
#  Run that  kickstart file through livecd-creator, which will pull in the  packages  and compose an .iso, which you can then burn to CD.


This project and its source files are licensed under the GPLv2 license. See the file COPYING for details.
...that's it! We will walk you through these steps  below.


== Creating a Live image ==
=== Install the necessary software ===


To create a live image, the '''livecd-creator''' tool is used. Super user privileges are needed. The tool is more or less self-documenting, use the ''--help'' option to see options.
To create a live image, the '''livecd-creator''' tool is used. Super user privileges are needed. The tool is more or less self-documenting, use the ''--help'' option to see options.
Line 19: Line 35:
The '''livecd-creator''' tool is part of the <code>livecd-tools</code> package.  If it is not installed on your system, add it with:
The '''livecd-creator''' tool is part of the <code>livecd-tools</code> package.  If it is not installed on your system, add it with:


<pre>
su -c 'yum install livecd-tools spin-kickstarts'
su -c 'yum install livecd-tools spin-kickstarts'
</pre>


If you are interested in localized live cd files, install also '''l10n-kickstarts'''.
If you are interested in localized live cd files, install also '''l10n-kickstarts'''.


=== How the livecd-creator Works ===
su -c 'yum install l10n-kickstarts'
 
In a nutshell, the '''livecd-creator''' program
 
* Sets up a file for the ''ext3'' file system that will contain all the data comprising the live CD
* Loopback mounts that file into the file system so there is an installation root
* Bind mounts certain kernel file systems (/dev, /dev/pts, /proc, /sys, /selinux) inside the installation root
* Uses a configuration file to define the requested packages and default configuration options.  The format of this file is the same as is used for installing a system via ''kickstart''.
* Installs, using ''yum'', the requested packages into the installation using the given repositories in the kickstart file
* Optionally runs scripts as specified by the live CD configuration file.
* Relabels the entire installation root (for SELinux)
* Creates a live CD specific ''initramfs'' that matches the installed kernel
* Unmounts the kernel file systems mounted inside the installation root
* Unmounts the installation root
* Creates a ''squashfs'' file system containing only the default ''ext3/4'' file (compression)
* Configures the boot loader
* Creates an iso9660 bootable CD/DVD
 
=== Live image Configuration Files ===
 
The configuration of the live image is defined by a file that uses the same format as installing a system via ''kickstart''.  They can include some basic system configuration items, the package manifest and a script to be run at the end of the build process.
 
For the Fedora project, the two most important live image configurations files are
{|
|-
| livecd-fedora-minimal.ks || The base live image system (included in the 'livecd-tools' package)
|-
| livecd-fedora-desktop.ks || Complete desktop with applications and input/output support for all supported locales in Fedora (this one is part of the 'spin-kickstarts' package)
|}
 
kickstart files for other spins (e.g. Fedora Electronics Lab) can be found in /usr/share/spin-kickstarts/ after installing the 'spin-kickstarts' package
 
 
=== Set SELinux to permissive mode ===
 
SELinux should be in permissive mode for livecd-creator to work. Run the following as root user first before attempting to create a live cd or dvd.
 
<pre>
 
setenforce 0
 
</pre>
 
=== Example: Spinning the Fedora Desktop Live CD ===
 
Note that because of the way livecd-creator works, it is not possible to choose a different set of packages or a different filesystem during installation.  Assuming that you use the '''livecd-fedora-desktop.ks''' configuration file, then the following command
 
 
<pre>livecd-creator \
--config=/usr/share/doc/livecd-tools-<version>/livecd-fedora-desktop.ks \
--fslabel=Fedora-LiveCD --cache=/var/cache/live


or
===  Choose a kickstart file as a base for your remix ===


livecd-creator \
Kickstart files are configuration files. They contain settings for tools, such as:
--config=/usr/share/spin-kickstarts/fedora-livecd-desktop.ks \
--fslabel=Fedora-LiveCD --cache=/var/cache/live
</pre>


will create a live CD called "Fedora-LiveCD".
* [https://fedorahosted.org/pungi/ pungi] (for the creation of install disks),
* [http://git.fedorahosted.org/cgit/livecd/ livecd-creator] (for the creation of  live images)
* [[Anaconda|anaconda]] (the built-in installer)


The name given by ''--fs-label'' is used:
You can see examples of kickstart  files in the [http://git.fedorahosted.org/cgit/spin-kickstarts.git spin-kickstart repository]. These are the kickstart files for the  spins displayed at http://spins.fedoraproject.org.


* as a file system label on the ext3 and iso9660 file systems (As such, it's visible on the desktop as the CD name)
Since we are creating a LiveCD, we  want a kickstart file for livecd-creator. Chances are good that an  existing LiveCD kickstart already contains most of the things we need,  like a graphical dekstop environment, drivers, and the ability to make live images  persistent (for installation on a liveUSB rather than a liveCD).  Therefore, in order to avoid reinventing the wheel, we're going to start  by picking an existing kickstart for a LiveCD to base our remix's kickstart from.


* in the ''isolinux'' boot loader.
There  are currently two kickstart files that provide the main configuration  to setup the live images. Pick one of these two:


If you have the repositories available locally and don't want to wait for the download of packages, just substitute the URLs listed in the configuration file to point to your local repositories.
* [http://git.fedorahosted.org/cgit/spin-kickstarts.git/plain/fedora-live-base.ks fedora-live-base.ks]: The file used for most composes. If you don't know where to start,  this is a good default choice.
* [http://git.fedorahosted.org/cgit/spin-kickstarts.git/plain/fedora-live-mini.ks fedora-live-mini.ks]: A trimmed-down edition of the first  file, mostly used by the Mini SIG for size-sensitive purposes. If space-saving is a primary  concern, choose this one.


{{Admon/tip | You can use setarch command to create a x86 live cd/dvd on a x86_64 system. Ex: setarch i386 livecd-creator <..> .}}
=== Set up your environment ===


Now we'll set up the place you'll be building your remix's image file in. We assume you're running a recent version of Fedora.


=== Example: A Barebones Live CD ===
First, make a 'remix' folder in your home directory.


The command
cd
mkdir remix
cd remix


<pre>livecd-creator \
Now, download the kickstart files for the Fedora Spins:
--config=/usr/share/doc/livecd-tools-<version>/livecd-fedora-minimal.ks --cache=/var/cache/live </pre>


will create a live CD that will boot to a login prompt.
su -c ‘yum install fedora-kickstarts’


{{Admon/tip | Barebones Live CD does not support login capability. | Since no configuration is done, the user will not be able to login to the system as the root password is not set/cleared.}}
Set SELinux in permissive mode.


su -c ‘setenforce 0’


=== Testing your Live CD using KVM or qemu ===
Copy the kickstart file you've chosen to the current directory.


As root:
cp /usr/share/spin-kickstarts/fedora-live-base.ks .
<code>qemu-kvm -m 512 -cdrom filename.iso</code>
or
  cp  /usr/share/spin-kickstarts/fedora-live-mini.ks .
 
(depending on the one you've chosen).


If you do not have KVM support, you can use qemu instead
=== Create a kickstart file ===


<code>qemu -m 512 --cdrom filename.iso></code>
# Create an empty text document in  the editor of your choice.
# Import the base kickstart file you  chose above:


Replace filename.iso with the name of your created Live CD image. NOTE: be sure to "yum install kvm qemu" as root for releases before Fedora 11. Fedora 11 has merged kvm and qemu into a single package. Just installing qemu package is enough.
<code>%include fedora-live-base.ks</code>


== Live image Installs ==
# Create the package manifest section  and add your favorite packages:


As of Fedora 7, anaconda has support for doing an installation from a live image.  To use this, double click on the ''Install to Hard Drive'' item on the desktop or run
<code>
%packages
foo
baz
bar
%end
</code>


<pre>
# Congrats -- you're done!
/usr/bin/liveinst
</pre>


if you don't have such an icon.
=== Build the image ===


== Live Image Media Verification ==
You'll need the livecd-creator tool. Go and install it as root:


The live image can incorporate functionality to verify itself.  To do so, you need to have '''isomd5sum''' installed both on the system used for creating the image and installed into the image.  This is so that the '''implantisomd5''' and '''checkisomd5''' utilities can be used.  These utilities take advantage of embedding an md5sum into the application area of the iso9660 image.  This then gets verified before mounting the real root filesystem.
* yum install livecd-creator


== Using Live Images from USB Media ==
The build process will take some  time, as well as space and bandwidth.


USB sticks are becoming increasingly prevalent and are a nice way to use live images.  You can take a live CD or DVD iso image and transform it so that it can be used on a USB stick.  To do so, use the '''livecd-iso-to-disk''' script:
=== Adjust the image ===


<pre>
ZOMG it's too big! How to cut stuff.  See [[#Release management]] for more notes. (make that section)
/usr/bin/livecd-iso-to-disk /path/to/live.iso /dev/sdb1
</pre>


Replace /dev/sdb1 with the (unmounted) partition where you wish to put the live image.  This is not a destructive process; any data you currently have on your USB stick will be preserved.
=== Distribute the image ===


Additional information available at [[How to create and use Live USB]].
Now you have an .iso. What do you do  with it?


== Other Resources ==
== Resources ==


* A [[Classroom | Fedora Classroom]] class covering [[Classroom/Creating_Fedora_Remix | creating Fedora remixes]].
Parts of this page were based on Rahul Sundaram's article [http://www.linuxforu.com/how-to/roll-out-a-fedora-remix/ Roll Out A Fedora Remix].
* If you are distributing your spin you need to be concerned about [[JeroenVanMeeuwen/Revisor/FedoraRebrandRemixGuidelines | trademark usage and GPL responsibilities]].

Latest revision as of 02:04, 28 June 2016

The following worked for me for using livemedia-creator: livemedia-creator --make-iso --no-virt --ks /usr/share/spin-kickstarts/fedora-live-xfce.ks I didn't need to flatten the ks files. I didn't need to install any dependencies, but that might be because I typically have the kitchen sink installed on my machines. If you have a local copy of the repos, you want to edit the repo commands in the ks files so that you don't download stuff again and use a bunch of extra disk space.

I'm not sure why there is a copy of the page in the talk section.

New Page: https://fedoraproject.org/wiki/Livemedia-creator-_How_to_create_and_use_a_Live_CD


Introduction

This page explains how to make a custom-content Live CD or DVD on Fedora-based systems including derived distributions such as RHEL, CentOS and others.

If you simply want to burn a pre-made ISO to a disc, visit http://fedoraproject.org/en/get-fedora to download a LiveCD or LiveDVD, then see the install guide or burning how-to for further instructions.

See the project wiki for more details. Discussion of this project takes places at http://admin.fedoraproject.org/mailman/listinfo/livecd.

Instructions

The basic workflow for creating a remix is:

  1. Create a kickstart file that specifies the packages you want installed on your remix, along with special settings you want to tweak.
  2. Run that kickstart file through livecd-creator, which will pull in the packages and compose an .iso, which you can then burn to CD.

...that's it! We will walk you through these steps below.

Install the necessary software

To create a live image, the livecd-creator tool is used. Super user privileges are needed. The tool is more or less self-documenting, use the --help option to see options.

The livecd-creator tool is part of the livecd-tools package. If it is not installed on your system, add it with:

su -c 'yum install livecd-tools spin-kickstarts'

If you are interested in localized live cd files, install also l10n-kickstarts.

su -c 'yum install l10n-kickstarts'

Choose a kickstart file as a base for your remix

Kickstart files are configuration files. They contain settings for tools, such as:

You can see examples of kickstart files in the spin-kickstart repository. These are the kickstart files for the spins displayed at http://spins.fedoraproject.org.

Since we are creating a LiveCD, we want a kickstart file for livecd-creator. Chances are good that an existing LiveCD kickstart already contains most of the things we need, like a graphical dekstop environment, drivers, and the ability to make live images persistent (for installation on a liveUSB rather than a liveCD). Therefore, in order to avoid reinventing the wheel, we're going to start by picking an existing kickstart for a LiveCD to base our remix's kickstart from.

There are currently two kickstart files that provide the main configuration to setup the live images. Pick one of these two:

  • fedora-live-base.ks: The file used for most composes. If you don't know where to start, this is a good default choice.
  • fedora-live-mini.ks: A trimmed-down edition of the first file, mostly used by the Mini SIG for size-sensitive purposes. If space-saving is a primary concern, choose this one.

Set up your environment

Now we'll set up the place you'll be building your remix's image file in. We assume you're running a recent version of Fedora.

First, make a 'remix' folder in your home directory.

cd
mkdir remix
cd remix

Now, download the kickstart files for the Fedora Spins:

su -c ‘yum install fedora-kickstarts’

Set SELinux in permissive mode.

su -c ‘setenforce 0’

Copy the kickstart file you've chosen to the current directory.

cp /usr/share/spin-kickstarts/fedora-live-base.ks .

or 

 cp  /usr/share/spin-kickstarts/fedora-live-mini.ks .
 

(depending on the one you've chosen).

Create a kickstart file

  1. Create an empty text document in the editor of your choice.
  2. Import the base kickstart file you chose above:

%include fedora-live-base.ks

  1. Create the package manifest section and add your favorite packages:

%packages foo baz bar %end

  1. Congrats -- you're done!

Build the image

You'll need the livecd-creator tool. Go and install it as root:

  • yum install livecd-creator

The build process will take some time, as well as space and bandwidth.

Adjust the image

ZOMG it's too big! How to cut stuff. See #Release management for more notes. (make that section)

Distribute the image

Now you have an .iso. What do you do with it?

Resources

Parts of this page were based on Rahul Sundaram's article Roll Out A Fedora Remix.