From Fedora Project Wiki


Cette page explique comment créer un Live CD ou DVD à contenu personnalisé sur des systèmes basés sur Fedora en y incluant des distribution telles que RHEL, CentOS et autres.

Note.png
Note
Si vous voulez seulement graver une image ISO pré-fabriquée sur un disque optique, visitez la page http://fedoraproject.org/en/get-fedora/fr pour télécharger u CD Live ou un DVD Live, puis reportez-vous guide d'installation ou au how-to sur le gravage pour les instructions nécessaires.

Pour commencer

Pou créer une image live, il faut utiliser l'outil livecd-creator avec les privilèges du super utilisateur. L'outil est plus ou moins bien documenté – utilisez livecd-creator --help pour connaître les options.

L'outil livecd-creator fait partie du paquet livecd-tools. S'il n'est pas installé sur votre système, ajoutez le avec DNF ou YUM:

su -c 'yum install livecd-tools spin-kickstarts' #Versions prior to Fedora 22
                                 ou
su -c 'dnf install livecd-tools spin-kickstarts' #Fedora 22 and beyond            

Si vous êtes intéressé(e) par des versions localisées (c.-à-d. traduites dans d'autres langues), installez également l10n-kickstarts.

Configuration de l'image

La configuration de l'image live est définie dans un fichier appelé kickstart. Il peut comprendre quelques items de base, le manifeste du paquet et un script a exécuter à la fin du processus de compilation.

Pour le projet Fedora, les fichiers de configuration les plus importants d'une image live sont :

  • fedora-live-base.ks : le système de base de l'image live (inclus dans le paquet 'livecd-tools').
  • Pour la version Fedora 20 et antérieures : fedora-livecd-desktop.ks : complète l'environnement de bureau avec des applications et la prise en charge des entrées/sorties dans toutes les locales prises en charge par Fedora (celle-ci fait partie du paquet 'spin-kickstart') – malgré le nom, c'est le kickstart qui génère l'image d'environ 1 Go des versions récentes.
  • Pour la version Fedora 21 et postérieures : fedora-live-workstation.ks: c'est la configuration du produit Workstation.

Des fichiers kickstart pour d'autres spins (p. ex. Fedora Electronics Lab) sont disponibles dans le dossier /usr/share/spin-kickstarts/ après l'installation du paquet 'spin-kickstarts'. Ces fichiers de configuration pré-fabriqués sont un point de départ formidable car ils disposent déjà de quelques scripts pré et post installation utiles.

system-config-kickstart

Vous pouvez créer un fichier kickstart personnalisé en exécutant la commande system-config-kickstart. Notez qu'il peut être nécessaire d'installer le paquet avec la commande su -c "dnf install system-config-kickstart" dans Fedora 22 et au-delà ou su -c "yum install system-config-kickstart" dans des versions antérieures de Fedora. Cet outil est essentiellement conçu pour générer des fichiers kickstart pour des intallations automatisées, pas des images live, c'est pourquoi le résultat produit ne sera probablement pas utilisable sans quelques éditions manuelles, mais cela peut vous aider à générer certaines directives kickstart particulières. Pensez à ajouter la ligne :

%include /usr/share/spin-kickstarts/fedora-live-base.ks

au début de votre fichier kickstart pour inclure le configuration live de base.

Idea.png
Voir Création d'un fichier kickstart pour une information avancée concernant la manière de créer votre propre fichier kickstart personnalisé.

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.

Note.png
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:
setarch i686 livecd-creator [...]

Examples

Spinning the fedora desktop

The following command:

livecd-creator --verbose \
--config=/usr/share/spin-kickstarts/fedora-live-workstation.ks \
--fslabel=Fedora-LiveCD \
--cache=/var/cache/live

will create a live CD called "Fedora-LiveCD" using the fedora-live-workstation.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.

Idea.png
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

QEMU running Fedora 17

As root:

qemu-kvm -m 2048 -vga qxl -cdrom filename.iso

If you do not have KVM support, you have to use qemu instead

qemu-system-x86_64 -m 2048 -vga qxl -cdrom filename.iso

Replace filename.iso with the name of your created Live CD image and qemu-system-x86_64 with an appropriate qemu binary for the target system, e.g qemu-system-i386.

Idea.png
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

You can burn your image directly to a CD or a DVD if it fits, or you can write it to a USB stick.

Install icon.jpg
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
/usr/bin/liveinst
if you don't have such an icon. However, because of the way livecd-creator works, it is not possible to choose a different set of packages or a different filesystem during installation.

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