kadischi/livecd_generator create-iso.sh, 1.2, 1.3 kadischi.py, 1.10, 1.11 livecd-mkinitrd.sh, 1.7, 1.8

Jasper O'neal Hartline (autopsy) fedora-extras-commits at redhat.com
Tue Apr 11 08:26:24 UTC 2006


Author: autopsy

Update of /cvs/devel/kadischi/livecd_generator
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27635/kadischi/livecd_generator

Modified Files:
	create-iso.sh kadischi.py livecd-mkinitrd.sh 
Log Message:
Use SquashFS exclusively, major tidying of kadischi.py


Index: create-iso.sh
===================================================================
RCS file: /cvs/devel/kadischi/livecd_generator/create-iso.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- create-iso.sh	30 Mar 2006 04:29:22 -0000	1.2
+++ create-iso.sh	11 Apr 2006 08:26:22 -0000	1.3
@@ -3,4 +3,4 @@
 sysdir=$1
 isoimage=$2
 
-mkisofs -quiet $MKISOFSOPTION -R -o $isoimage -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table $sysdir
+mkisofs -quiet -R -o $isoimage -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table $sysdir


Index: kadischi.py
===================================================================
RCS file: /cvs/devel/kadischi/livecd_generator/kadischi.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- kadischi.py	10 Apr 2006 22:53:32 -0000	1.10
+++ kadischi.py	11 Apr 2006 08:26:22 -0000	1.11
@@ -21,35 +21,27 @@
 product_path = ''
 kernel_version = ''
 
-# OK, we`re starting
 
+# OK, we`re starting
 flc_log ('Starting kadischi...')
 
-# setup dirs
 
+# setup dirs
 bindir = sys.path [0]
 confdir = normalize_path(['/etc/kadischi'])
 
-# process command line options
 
+# process command line options
 usage = 'usage: %prog [options] <path-to-the-repository> <destination-iso-image-file>\n\npath-to-the-repository can be a path on the local file system (without any prefixes) but can also be a path to a http, ftp or some other type of repository. For details, consult the documentation at http://fedoraproject.org/wiki/Kadischi/Documentation'
 version = '%prog ' + version
 parser = optparse.OptionParser (usage=usage, version=version)
-
 parser.add_option ("-f", "--force", dest="force", action="store_true", default=False, help="overwrite destination iso image file, if such exists.")
-
 parser.add_option ("-C", "--cmdline", dest="cmdline", action="store_true", default=False, help="run anaconda in command line mode (runs without interface, but requires complete kickstart file)")
-
 parser.add_option ("-T", "--text", dest="text", action="store_true", default=False, help="run anaconda in TUI mode")
-
 parser.add_option ("", "--graphical", dest="graphical", action="store_true", default=False, help="run anaconda in GUI mode")
-
 parser.add_option ("", "--kickstart", dest="ksfile", help="supply anaconda with kickstart file")
-
 parser.add_option ("", "--buildstamp", dest="buildstamp", help="buildstamp file (if not set, using the default buildstamp from the config directory)")
 
-parser.add_option ("", "--filesystem", dest="filesystem", help="set the filesystem to use on the iso to either zisofs[default] or squashfs.")
-
 flc_log ('Parsing command line arguments')
 (options, args) = parser.parse_args ()
 
@@ -63,8 +55,8 @@
 else:
     buildstamp = normalize_path ([confdir, 'buildstamp'])
 
-# set display mode
 
+# set display mode
 display_mode = ''
 
 if options.graphical:
@@ -76,10 +68,9 @@
 
 anaconda_args = display_mode + anaconda_args
 
-### check if everything looks OK
 
+### check if everything looks OK
 # checking arguments
-
 if len (args) < 2:
     flc_log ('Not enough arguments.\n')
     parser.parse_args (['-h'])
@@ -91,22 +82,22 @@
 method = args [0]
 isoimage = normalize_path ([args [1]])
 
-# checking UID - must be root
 
+# checking UID - must be root
 flc_log ('Checking UID')
 
 if os.getuid () != 0:
     flc_log ('You have to be root to run this application. Please restart with root permissions.\n')
     sys.exit (1)
 
-# check if we can open buildstamp file
 
+# check if we can open buildstamp file
 if not os.access(buildstamp, os.R_OK):
     flc_log ('Can`t open buildstamp file %s. ' % buildstamp)
     sys.exit (1)
 
-# loading productPath from buildstamp
 
+# loading productPath from buildstamp
 flc_log ('Using buildstamp file %s. ' % buildstamp)
 
 f = open(buildstamp, "r")
@@ -118,8 +109,8 @@
     flc_log ('Product path can`t be found in buildstamp file %s (Product path should be on the 4th line of the file)' % buildstamp)
     sys.exit (1)
 
-# validating the repository
 
+# validating the repository
 flc_log ('Now we are going to try to validate your repository (for now, only http, ftp and local repositories can be checked)')
 
 valid = True
@@ -137,13 +128,13 @@
     flc_log ('Repository validation failed. Aborting execution.')
     sys.exit (1)
 
-# format method string the way anaconda likes it
 
+# format method string the way anaconda likes it
 if method.find (':') == -1:
     method = 'nfs:/' + method
 
-# checking if everything is OK with destination (iso image) file
 
+# checking if everything is OK with destination (iso image) file
 if os.path.isfile (isoimage):
     flc_log ('File %s already exists. ' % isoimage)
     if force:
@@ -154,18 +145,10 @@
 elif not os.path.isdir (os.path.dirname (isoimage)):
     os.makedirs (os.path.dirname (isoimage))
 
-# check for installed rpms
 
+# check for installed rpms
 flc_log ('Checking required packages')
-
-# Set required filesystem_tools to something appropriate depending on what is chosen
-if options.filesystem == 'squashfs':
-   filesystem_tools = 'squashfs-tools'
-else:
-   filesystem_tools = 'zisofs-tools'
-
-required_rpms = ('anaconda', 'busybox-anaconda', 'mkisofs', 'syslinux', 'e2fsprogs', filesystem_tools)
-
+required_rpms = ('anaconda', 'busybox-anaconda', 'mkisofs', 'syslinux', 'e2fsprogs', 'squashfs-tools')
 missing_rpms = check_installed_rpms ('/', required_rpms, False)
 
 if len (missing_rpms) != 0:
@@ -175,16 +158,16 @@
     flc_log ('are missing. Aborting execution.')
     sys.exit (1)
 
-# check for the config file
 
+# check for the config file
 flc_log ('Looking for config file')
 
 if not os.path.isfile (normalize_path([confdir, 'kadischi.conf'])):
     flc_log ('Can`t find config file %s.' % normalize_path([confdir, 'kadischi.conf']))
     sys.exit (1)
 
-# load config file options
 
+# load config file options
 flc_log ('Loading config file options')
 
 buildconf = shvarFile (normalize_path([confdir, 'kadischi.conf']), True)
@@ -198,21 +181,18 @@
     flc_log ('No build dir defined. Please, edit config file option BUILDDIR.')
     sys.exit(1)
 
-# prepare dirs
 
+# prepare dirs
 buildsubdir = 'livecd-build_no' + buildnum
 builddir = normalize_path ([builddir, buildsubdir])
-
 sysdir = normalize_path([builddir, 'system'])
 csysdir = normalize_path([builddir, 'compressed'])
-
 os.makedirs (sysdir)
-
 # we shouldn`t create csysdir because mkzftree wants to create it by it self
 # os.makedirs (csysdir)
 
-# Moving the buildstamp file to /tmp/product/.buildstamp so anaconda can find it
 
+# Moving the buildstamp file to /tmp/product/.buildstamp so anaconda can find it
 if not os.path.exists ('/tmp/product'):
     os.makedirs ('/tmp/product')
 elif not os.path.isdir ('/tmp/product'):
@@ -225,22 +205,19 @@
 
 shutil.copy2 (buildstamp, '/tmp/product/.buildstamp')
 
-# run anaconda
 
+# run anaconda
 flc_log ('\n  ***  running anaconda  ***  \n')
-
 run ("anaconda %s --rootpath=%s --method=%s" % (anaconda_args, sysdir, method), builddir)
-
 flc_log ('\n  ***  anaconda has finished the job ***  \n')
 
-# now`s the time to pickup kernel version cause when we move files arround, it will be late
 
+# now`s the time to pickup kernel version cause when we move files arround, it will be late
 kernel_version = get_kernel_version (sysdir)
 
-# run post_install_scripts
 
+# run post_install_scripts
 flc_log ('running post installation scripts')
-
 scripts = []
 
 for root, dirs, files in os.walk (normalize_path([bindir, 'post_install_scripts'])):
@@ -255,70 +232,50 @@
     flc_log ('%s' % script)
     run ("%s %s %s" % (script, sysdir, anaconda_args), builddir)
 
-# make initrd image
 
+# make initrd image
 flc_log ('making initrd image')
+run ("%s %s %s" % (normalize_path([bindir, 'livecd-mkinitrd.sh']), sysdir, kernel_version), builddir)
 
-if options.filesystem == 'squashfs':
-    kmods = 'fs/squashfs drivers/block/loop.ko'
-else:
-    kmods = ''
-
-run ("KMODULES='%s' %s %s %s" % (kmods, normalize_path([bindir, 'livecd-mkinitrd.sh']), sysdir, kernel_version), builddir)
 
 # move files 
-
 flc_log ('moving files that should be on tmpfs')
-
 run ("%s %s" % (normalize_path([bindir, 'movefiles.py']), sysdir), builddir)
 
-# compress the tree
 
+# compress the tree
 flc_log ('compressing the tree (order a pizza `cause this will take a while)')
+# kadischi.sqsh is a file that we mount loopback. So we need to create supporting
+# files and directories outside of the compressed tree.
+os.makedirs (os.path.join(csysdir, 'boot/isolinux'))
+os.makedirs (normalize_path([csysdir, '/livecd']))
+touch = file(normalize_path([csysdir, '.livecd']), 'w')
+touch.close()
+# Make the SquashFS image
+run("mksquashfs %s %s" % (sysdir, normalize_path([csysdir, 'kadischi.sqsh'])))
 
-if options.filesystem == 'squashfs':
-    # zisofs has a tree which can be seen; squashfs is a file that we mount
-    # loopback.  So we need to create supporting files and directories
-    # separately.
-    os.makedirs (os.path.join(csysdir, 'boot/isolinux'))
-    os.makedirs(normalize_path([csysdir, '/livecd']))
-    touch = file(normalize_path([csysdir, '.livecd']), 'w')
-    touch.close()
-    # compress a squashfs tree
-    run("mksquashfs %s %s" % (sysdir, normalize_path([csysdir, 'kadischi.sqsh'])))
-else:
-    # compress a zisofs tree
-    run ("mkzftree -z 3 %s %s" % (sysdir, csysdir), builddir)
 
 # install boot & conf files in compressed tree (they shoudn`t be compressed)
-
 flc_log ('installing boot & config files in compressed tree')
-
 run ("%s %s %s %s" % (normalize_path([bindir, 'install-boot.sh']), sysdir, csysdir, kernel_version), builddir)
-
 run ("cp -f %s %s" % (normalize_path([sysdir, '/livecd/kadischi.tar.gz']), normalize_path([csysdir, '/livecd/kadischi.tar.gz'])), builddir)
 
-# delete sysdir - we don`t need it anymore
 
+# delete sysdir - we don`t need it anymore
 flc_log ('removing uncompressed tree')
-
 clean_directory (sysdir)
 
-# create iso image
 
+# create iso image
 flc_log ('creating iso image %s' % isoimage)
+run ("%s %s %s" % (normalize_path([bindir, 'create-iso.sh']), csysdir, isoimage), builddir)
 
-if options.filesystem == 'squashfs':
-    mkisoflags=''
-else:
-    mkisoflags='MKISOFSOPTION=-z '
-run ("%s%s %s %s" % (mkisoflags, normalize_path([bindir, 'create-iso.sh']), csysdir, isoimage), builddir)
 
 # delete builddir
-
 flc_log ('removing builddir')
-
 cleanup (builddir)
 
+
+# Done!
 flc_log ('Finished.')
 sys.exit (0)


Index: livecd-mkinitrd.sh
===================================================================
RCS file: /cvs/devel/kadischi/livecd_generator/livecd-mkinitrd.sh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- livecd-mkinitrd.sh	4 Apr 2006 13:43:13 -0000	1.7
+++ livecd-mkinitrd.sh	11 Apr 2006 08:26:22 -0000	1.8
@@ -23,7 +23,6 @@
 rc=0
 
 IMAGESIZE=10000
-KMODULES="drivers/parport $KMODULES"
 
  . /etc/kadischi/kadischi.conf
 
@@ -257,7 +256,7 @@
 inst $rootdir/etc/modprobe.d/modprobe.conf.dist "$MNTIMAGE/etc/modprobe.d/modprobe.conf.dist"
 inst $rootdir/lib/modules/$kernel/modules.dep "$MNTIMAGE/lib/modules/$kernel/modules.dep"
 
-MODULES=$(findmodules $KMODULES)
+MODULES=$(findmodules drivers/parport drivers/block/loop.ko fs/squashfs)
 for MODULE in $MODULES; do
     instmodule $MODULE
 done




More information about the fedora-extras-commits mailing list