|
楼主 |
发表于 2006-10-27 14:13:39
|
显示全部楼层
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`t need to read this, but if you want to customize your build system or you want to understand how Kadischi works for any other reason, you should continue reading.
When you type kadischi in your command line, /usr/bin/kadischi is executed. It is just a simple bash script which sets PYTHONPATH variable to include Kadischi libraries, and executes /usr/local/share/kadischi/kadischi.py.
kadischi.py is top-level script as such is in charge of coordination between all other elements. It
*
processes command line options and arguments
*
checks if everything looks OK (the number of given arguments, presence of destination file, UID, presence of required RPMs, config file)
*
sets values to variables (from the information it gets from the command line and from the config file)
*
creates subdirectory named 'livecd_build_no${number}' under the specified build directory; all temporary files for that build will be stored there
*
invokes anaconda; anaconda is run with --rootpath option and all other options specified on the command line (like --kickstart, --cmdline etc.). This is actually the most important part of the process. Anaconda installs the whole system in a directory on the local hard drive.
*
invokes scripts from /usr/local/share/kadischi/post_install_scripts passing them as an argument the path to the build tree. Those scripts are used to modify the system in order to work properly from the live CD
*
invokes /usr/local/share/kadischi/livecd-mkinitrd.sh which makes initrd image that will be used on the live CD system
*
invokes /usr/local/share/kadischi/movefiles.py which moves all the files and directories that should be writable once the live CD is booted to a single directory. That directory is then compressed in kadischi.tar.gz. During the booting of live CD, this archive is unpacked on tmpfs drive, and extracted files and directories are mounted (with mount --bind) to their original locations.
*
creates a compressed copy of the whole system (SquashFS (mksquashfs) is used for compression)
*
copies some files that shouldn't be compressed (kernel, initrd etc.) from the uncompressed tree to the compressed one
*
removes the uncompressed tree
*
invokes /usr/local/share/kadischi/create-iso.sh which creates iso image out of the compressed system tree
*
cleans up the build directory |
|