KadischiDoc

What is Kadischi
Kadischi is an application for Fedora-based Live CD generation. It takes Fedora repository as an input and outputs a livecd iso image.

Kadischi is still in the early stage of development, but has basic functionality and can be run successfully.

How does Kadischi work
Basically, Kadischi uses anaconda to install the system in a temporary directory (specified in the configuration file) on user. It will configure package for building. If you would like to pass some options to, you can pass them to  and it will forward them to.

After that, you have to run  in order to build the application.

Run  to install the application (default location is /usr/local/share/kadischi for application files and /etc/kadischi for configuration files).

Yet another thing you would have to do in order to run the application is to patch anaconda. Files that should be patched are /usr/sbin/anaconda and /usr/lib/anaconda/flags.py. Patches are in /usr/local/share/kadischi/patches dir, and are made against anaconda-10.2.1.5-2 (fc4 default).

For patching instructions, consult "How to apply a patch" section of Appendix.

Configuration
Edit /etc/kadischi/build.conf and set BUILDDIR variable. BUILDDIR is a directory that will be used for storing temporary files (temporary installation will be performed in that directory). You will need approximately 1.5x size of desired installation available on that device. 3GB works fine for me.

Uninstallation
Go to the root directory of the source tree and run. Make sure there are no extra files added to the application directories (for example /etc/kadischi/build.conf~).

Basic instructions
The basic way to run Kadischi is to type the following in a terminal

kadischi path-to-the-repository path-to-the-iso-image

where path to the repository can be a path on the local file system, but can also be a path to ftp, http or some other type of repository.

Example:

kadischi /tmp/fc4 /tmp/fedora-live.iso

where /tmp/fc4 is a directory holding a Fedora repository (which means rpms are in /tmp/fc4/Fedora/RPMS and comps.xml, hdlist and some other files are in /tmp/fc4/Fedora/base). For instructions on creating a local repository, colsult "How to build a repository" section from Appendix.

Example 2:

kadischi http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os /tmp/fedora-live.iso

Example 3: (using mirror site)

kadischi http://mirrors.kernel.org/fedora/core/4/i386/os/ /tmp/fedora-live.iso

for installing from http repository. For details on available installation methods, consult "Anaconda installation methods" in Appendix.

If you are not using Fedora repository, you would have to edit /etc/kadischi/buildstamp or to use a custom buildstamp file. For details, consult "buildstamp file" in Appendix.

Command line options
Type  for list of Kadischi command line options.

Running Kadischi automatically
Since Kadischi itself doesn command line option:

kadischi /tmp/fc4 /tmp/fedora-live.iso --kickstart=/path/to/kickstart.cfg

Some examples of kickstart files that can be used are included in the package and can be found in /usr/local/share/kadischi/ks_examples.

Another thing that matters is bringing up the user interface. Even if supplied with complete ks file, anaconda will bring up the interface (GUI or TUI) which is something we don stands for command line. You can also use  instead of.

Please note that in command line mode, no interaction with anaconda is possible, so if you have an incomplete kickstart file, anaconda will just print an error message to stdout and stop (it will not abort execution).

Using this two command line options you could, for example, create a cron job that will create fresh ISOs from rawhide repository every day.

Customizing Live CD system
I'll give you here some ideas on how to perform the customization of the live CD. Please note that there are probably many cleaver ways that I don't know about :)


 * Using kickstart file, and all the options it provides, including %pre and %post install scripts.
 * Adding scripts to /usr/local/share/kadischi/post_install_scripts/ or editing some of them that are already there. Those scripts are executed right after the system is installed to chroot environment, but they are NOT executed in the chroot environment, they are executed from the parent system. Kadischi sorts all executables from post_install_scripts directory by the name, and executes them passing them the path to the freshly installed system as an argument.
 * Creating rpms with modifications, and adding them to the repository.

Tip: If you would like to customize your live CD, take a look at the Under the bonnet section of this document. Pay special attention to the scripts in post_install_scripts directory, and to the /usr/local/share/kadischi/movefiles.py. Those files are well documented, and reading just the first couple of lines would be helpful.

Tips and tricks

 * Get your self a rewritable CD, you're gonna need it :) (but don't forget the system will work slower when run from RW disc)
 * If you are using kickstart file, add --excludedocs to %packages (like this: %packages --excludedocs) in order to skip installing docs to /usr/local/doc (this can save you some space, depending on the number of packages)
 * include as many packages as you want (well, not more that 10GB), and write iso image to a DVD disc

How does Kadischi work (in details)
In this section, I'll describe what happens from the moment you run kadischi from the command line, to the moment it writes "Finished" in it's log. If you just want to use Kadischi, you probably don or checkout Merging with patch

How to build a repository
If you have Fedora installation CDs it s a good idea to copy them to your hard drive and to perform installation from a harddrive repository since it s much faster (and you will probably end up with several livecd builds before the right one). Here s the procedure:


 * create the root directory for your repository (for example /tmp/fc4)
 * create subdirectories /tmp/fc4/Fedora, /tmp/fc4/Fedora/RPMS, /tmp/fc4/Fedora/base
 * copy the contents of cdrom:/Fedora/base directory (from disc1) to the /tmp/fc4/Fedora/base
 * copy the contents of cdrom:/Fedora/RPMS directory (from all 4 discs) to the /tmp/fc4/Fedora/RPMS

And that s it. You can use this repository with Kadischi (path to the repository is /tmp/fc4).

Please note that this is not a regular repository, and you can t, for example, use it with yum. If you would like to create a regular repository, please consult some other document.

Anaconda installation methods

 * method=nfs: -- Use for an NFS installation.
 * method=http:// -- Use for an HTTP installation
 * method=ftp:// -- Use for an FTP installation
 * method=hd:// / -- Use on for a hard drive installation
 * method=cdrom -- Do a CDROM based installation.

(taken from )

You can checkout /usr/share/doc/anaconda-${version}/install-methods.txt for further information.

buildstamp file
Anaconda uses buildstamp file to gather some information related to the distribution. Here s the example of the buildstamp file (from FC 4):

200506062237.i386 Fedora Core 4 Fedora http://bugzilla.redhat.com/bugzilla/

As you can see, there are 5 lines. The first line is something like the build ID, the second is product name, the third is product version, the forth is product path and the fifth is URL for bug reports.

The one that is very important to us is product path (the 4th one) because it is used in accessing the repository. If your repository is, for example, http://mirrors.kernel.org/fedora/core/4/i386/os/, anaconda will look for rpms in http://mirrors.kernel.org/fedora/core/4/i386/os/${productPath}/RPMS, so for the Fedora repository, the 4th line of the buildstamp should be "Fedora".

If you get an endless loop of "Reading package information... Unable to read header list. This may be due to a missing file or bad media.  Press to try again"  from anaconda, it is very likely that there is something wrong with product path.

Anaconda looks for buildstamp file at /tmp/product/.buildstamp and /.buildstamp (in that order), so Kadischi puts it's buildstamp file to /tmp/product/.buildstamp so anaconda could find it. If the file /tmp/product/.buildstamp already exists, Kadischi will move it to a temporary location, put it's file to /tmp/product/.buildstamp, run anaconda, and when anaconda finishes the job, it will restore the original file.