m (Added QEMU screenshot) |
(Copied page from https://fedoraproject.org/wiki/User:Nicolassatragno/How_to_create_and_use_a_custom_Live_CD) |
||
Line 8: | Line 8: | ||
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. | 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. | {{admon/note | Note | 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.}} | ||
== Getting started == | |||
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 {{command | livecd-creator --help}} 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 '''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: | ||
Line 25: | Line 20: | ||
</pre> | </pre> | ||
If you are interested in localized live | If you are interested in localized (i.e. translated into other languages) live CD files, install also '''l10n-kickstarts'''. | ||
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. | |||
setenforce 0 | |||
{{admon/warning | Warning | Setting SELinux to ''permissive'' mode will leave your computer less protected against security threats. '''Remember to revert this option after having finished with''' <pre>setenforce 1</pre>}} | |||
== | == Configuring the image == | ||
The configuration of the live image is defined by a file | The configuration of the live image is defined by a file called ''kickstart''. It 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 | For the Fedora project, the two most important live image configurations files are: | ||
* '''[https://fedorahosted.org/spin-kickstarts/browser/fedora-live-minimization.ks fedora-live-minimization.ks]''' : The base live image system (included in the 'livecd-tools' package) | * '''[https://fedorahosted.org/spin-kickstarts/browser/fedora-live-minimization.ks fedora-live-minimization.ks]''' : The base live image system (included in the 'livecd-tools' package). | ||
* '''[https://fedorahosted.org/spin-kickstarts/browser/fedora-live-desktop.ks fedora-live-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) | * '''[https://fedorahosted.org/spin-kickstarts/browser/fedora-live-desktop.ks fedora-live-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 | ''kickstart'' files for other spins (e.g. Fedora Electronics Lab) can be found in ''/usr/share/spin-kickstarts/'' after installing the 'spin-kickstarts' package. These pre-made configuration files can be a great place to start, as they already have some useful pre and post-installation scripts. | ||
[[Image:system-config-kickstart.png|thumb|system-config-kickstart]] | |||
You can easily create a customized ''kickstart'' file by running {{command | system-config-kickstart}}. Note that you might have to install the package first: | |||
su -c "yum install system-config-kickstart" | |||
Remember to add the line: | |||
<pre> | |||
%include /usr/share/spin-kickstarts/fedora-live-base.ks | |||
</pre> | |||
at the beginning of your ''kickstart'' file to include the base live configuration. | |||
admon/tip || See [[Anaconda/Kickstart#Creating_the_Kickstart_File | Creating a ''kickstart'' file]] for advanced information regarding making your own custom ''kickstart'' file.}} | |||
== Making the image == | |||
To make the image, simply issue the following command: | |||
<pre> | |||
livecd-creator --verbose \ | |||
--config=/path/to/kickstart/file.ks \ | |||
--fslabel=Image-Label \ | |||
--cache =/var/cache/live | |||
</pre> | |||
The name given by ''--fs-label'' is used: | |||
* as a file system label on the ext3 and iso9660 file systems (As such, it's visible on the desktop as the CD name). | |||
* in the ''isolinux'' boot loader. | |||
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. | |||
If you have an x86_64 machine you're building on but you want a 32-bit happy iso image, add the following before your livecd-creator command: | {{admon/note | Making a 32-bit spin ISO on a 64-bit machine| If you have an x86_64 machine you're building on but you want a 32-bit happy iso image, add the following before your livecd-creator command: | ||
<pre>setarch i686 livecd-creator [...]</pre> | |||
}} | |||
== Examples == | |||
=== | === Spinning the fedora desktop === | ||
The following command: | |||
<pre> | <pre> | ||
Line 79: | Line 83: | ||
</pre> | </pre> | ||
will create a live CD called "Fedora-LiveCD" | will create a live CD called "Fedora-LiveCD" using the '''fedora-live-desktop.ks''' configuration file. | ||
=== | === A Barebones Live CD === | ||
The command | The command | ||
Line 103: | Line 98: | ||
{{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.}} | {{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.}} | ||
== Testing your Live CD using KVM or qemu == | |||
[[Image:Screenshot_qemu_gtk3.png|thumb|QEMU running Fedora 17]] | [[Image:Screenshot_qemu_gtk3.png|thumb|QEMU running Fedora 17]] | ||
Line 111: | Line 106: | ||
qemu-kvm -m 512 -cdrom filename.iso | qemu-kvm -m 512 -cdrom filename.iso | ||
If you do not have KVM support, you can use qemu instead | If you do not have [[Wikipedia:Kernel-based_Virtual_Machine | KVM]] support, you can use qemu instead | ||
qemu -m 512 --cdrom filename.iso | qemu -m 512 --cdrom filename.iso | ||
Line 119: | Line 114: | ||
{{Admon/tip || 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.}} | {{Admon/tip || 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.}} | ||
== | == Using your new live image == | ||
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 | You can [http://docs.fedoraproject.org/readme-burning-isos/ burn your image directly to a CD or a DVD] if it fits, or you can [[How_to_create_and_use_Live_USB | write it to a USB stick]]. | ||
{{admon/install | Installing the Live image to the hard drive | 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 | |||
<pre> | <pre> | ||
Line 127: | Line 124: | ||
</pre> | </pre> | ||
if you don't have such an icon. | if you don't have such an icon. However, because of the way {{command|livecd-creator}} works, it is not possible to choose a different set of packages or a different filesystem during installation.}} | ||
== Live Image Media Verification == | == Live Image Media Verification == | ||
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. | 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. | ||
== Other Resources == | == Other Resources == |
Revision as of 02:55, 3 January 2013
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.
Getting started
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 livecd-creator --help
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 (i.e. translated into other languages) live CD files, install also l10n-kickstarts.
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.
setenforce 0
Configuring the image
The configuration of the live image is defined by a file called kickstart. It 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:
- fedora-live-minimization.ks : The base live image system (included in the 'livecd-tools' package).
- fedora-live-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. These pre-made configuration files can be a great place to start, as they already have some useful pre and post-installation scripts.
You can easily create a customized kickstart file by running system-config-kickstart
. Note that you might have to install the package first:
su -c "yum install system-config-kickstart"
Remember to add the line:
%include /usr/share/spin-kickstarts/fedora-live-base.ks
at the beginning of your kickstart file to include the base live configuration.
admon/tip || See Creating a kickstart file for advanced information regarding making your own custom kickstart file.}}
Making the image
To make the image, simply issue the following command:
livecd-creator --verbose \ --config=/path/to/kickstart/file.ks \ --fslabel=Image-Label \ --cache =/var/cache/live
The name given by --fs-label is used:
- as a file system label on the ext3 and iso9660 file systems (As such, it's visible on the desktop as the CD name).
- in the isolinux boot loader.
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.
Examples
Spinning the fedora desktop
The following command:
livecd-creator --verbose \ --config=/usr/share/spin-kickstarts/fedora-livecd-desktop.ks \ --fslabel=Fedora-LiveCD \ --cache=/var/cache/live
will create a live CD called "Fedora-LiveCD" using the fedora-live-desktop.ks configuration file.
A Barebones Live CD
The command
livecd-creator --verbose \ --config=/usr/share/doc/livecd-tools-`rpm -q livecd-tools --qf "%{VERSION}"`/livecd-fedora-minimal.ks \ --cache=/var/cache/live
will create a live CD that will boot to a login prompt.
Testing your Live CD using KVM or qemu
As root:
qemu-kvm -m 512 -cdrom filename.iso
If you do not have KVM support, you can use qemu instead
qemu -m 512 --cdrom filename.iso
Replace filename.iso with the name of your created Live CD image.
Using your new live image
You can burn your image directly to a CD or a DVD if it fits, or you can write it to a USB stick.
Live Image Media Verification
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.
Other Resources
- A Fedora Classroom class covering creating Fedora remixes.
- If you are distributing your spin you need to be concerned about trademark usage and GPL responsibilities.