[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Fedora-livecd-list] yum in kickstart %post



Filip Tsachev wrote:
Hello,

2006/2/23, Brenton Rothchild <brentonr dorm org>:
I also added a "--nocompress" option to skip the whole mkzftree phase,
since most of the ISOs I generate are below CD-sizes before compression;
I run the ISOs in QEMU from a USB keychain, so speed was becoming an
issue with the compressed images...  Would anyone find this useful
as well?

where do you add this option? If I use DVDs I won't need the
compression and related performance drawback in some cases

Cheers,
Filip

--
Fedora-livecd-list mailing list
Fedora-livecd-list redhat com
https://www.redhat.com/mailman/listinfo/fedora-livecd-list

Filip,

I currently have Kadischi patched for FC5tX according to
  http://fedoraproject.org/wiki/Kadischi/Development
and BZ's #179071, #180152, #178623.

So, attached are a couple of sets of patches between a post-patched
FC5tX Kadischi and adding the --nocompress option, and between
the CVS version and adding the --nocompress option.

The patches starting with "FC5" are against a post-patched FC5tX
copy, and those starting with "CVS" are against a current CVS
checkout.  Those without a prefix are common to either case:

{FC5,CVS}-kadischi.py.patch - Moves the mkzftree and related commands
  into a conditional block such that "--nocompress" will skip them.

install-boot.sh.patch - Adds a check to skip the copying of
  the initrd if sysdir and csysdir are the same location.

create-iso.sh.patch - Adds the ability to skip using the "-z"
  option in the event you're not using compression.


If you have any problems, Filip, let me know - I'd be happy to look
into it.

Of course, if anyone else would like me change anything, let me know, too!

I know this isn't the best way to post patches, but I hope this helps,
Filip!

-Brenton Rothchild
--- /home/brentonr/downloads/kadischi.cvs/livecd_generator/create-iso.sh	2005-08-21 12:09:00.000000000 -0500
+++ create-iso.sh	2006-02-24 08:35:34.000000000 -0600
@@ -2,5 +2,9 @@
 
 sysdir=$1
 isoimage=$2
+compress=""
+if [ ! -z "$3" ]; then
+	compress="$3"
+fi
 
-mkisofs -quiet -z -R -o $isoimage -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table $sysdir
\ No newline at end of file
+mkisofs -quiet $compress -R -o $isoimage -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table $sysdir
--- /home/brentonr/downloads/kadischi.cvs/livecd_generator/kadischi.py	2005-10-12 20:05:48.000000000 -0500
+++ kadischi.py	2006-02-24 09:40:24.000000000 -0600
@@ -18,6 +18,7 @@
 method = ''
 anaconda_args = ''
 buildstamp = ''
+nocompress = False
 product_path = ''
 kernel_version = ''
 
@@ -48,6 +49,8 @@
 
 parser.add_option ("", "--buildstamp", dest="buildstamp", help="buildstamp file (if not set, using the default buildstamp from the config directory)")
 
+parser.add_option ("", "--nocompress", dest="nocompress", action="store_true", default=False, help="don't compress the resulting ISO image")
+
 flc_log ('Parsing command line arguments')
 (options, args) = parser.parse_args ()
 
@@ -61,6 +64,8 @@
 else:
 	buildstamp = normalize_path ([confdir, 'buildstamp'])
 
+nocompress = options.nocompress
+
 # set display mode
 
 display_mode = ''
@@ -260,30 +265,29 @@
 run ("%s %s" % (normalize_path([bindir, 'movefiles.py']), sysdir), builddir)
 
 # compress the tree
-
-flc_log ('compressing the tree (order a pizza `cause this will take a while)')
-
-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
-
-flc_log ('removing uncompressed tree')
-
-clean_directory (sysdir)
+if not nocompress:
+	flc_log ('compressing the tree (order a pizza `cause this will take a while)')
+	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
+	flc_log ('removing uncompressed tree')
+	clean_directory (sysdir)
+else:
+	flc_log ('skipping tree compression (just making a plain copy)')
+	run ("mv %s %s" % (sysdir, csysdir), builddir)
+	run ("%s %s %s %s" % (normalize_path([bindir, 'install-boot.sh']), csysdir, csysdir, kernel_version), builddir)
 
 # create iso image
 
 flc_log ('creating iso image %s' % isoimage)
 
-run ("%s %s %s" % (normalize_path([bindir, 'create-iso.sh']), csysdir, isoimage), builddir)
+if nocompress:
+	run ("%s %s %s" % (normalize_path([bindir, 'create-iso.sh']), csysdir, isoimage), builddir)
+else:
+	run ("%s %s %s -z" % (normalize_path([bindir, 'create-iso.sh']), csysdir, isoimage), builddir)
 
 # delete builddir
 
@@ -292,4 +296,4 @@
 cleanup (builddir)
 
 flc_log ('Finished.')
-sys.exit (0)
\ No newline at end of file
+sys.exit (0)
--- /home/brentonr/downloads/kadischi.fc5/livecd_generator/kadischi.py	2006-02-24 09:37:43.000000000 -0600
+++ kadischi.py	2006-02-24 09:40:24.000000000 -0600
@@ -18,6 +18,7 @@
 method = ''
 anaconda_args = ''
 buildstamp = ''
+nocompress = False
 product_path = ''
 kernel_version = ''
 
@@ -48,6 +49,8 @@
 
 parser.add_option ("", "--buildstamp", dest="buildstamp", help="buildstamp file (if not set, using the default buildstamp from the config directory)")
 
+parser.add_option ("", "--nocompress", dest="nocompress", action="store_true", default=False, help="don't compress the resulting ISO image")
+
 flc_log ('Parsing command line arguments')
 (options, args) = parser.parse_args ()
 
@@ -61,6 +64,8 @@
 else:
 	buildstamp = normalize_path ([confdir, 'buildstamp'])
 
+nocompress = options.nocompress
+
 # set display mode
 
 display_mode = ''
@@ -260,30 +265,29 @@
 run ("%s %s" % (normalize_path([bindir, 'movefiles.py']), sysdir), builddir)
 
 # compress the tree
-
-flc_log ('compressing the tree (order a pizza `cause this will take a while)')
-
-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
-
-flc_log ('removing uncompressed tree')
-
-clean_directory (sysdir)
+if not nocompress:
+	flc_log ('compressing the tree (order a pizza `cause this will take a while)')
+	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
+	flc_log ('removing uncompressed tree')
+	clean_directory (sysdir)
+else:
+	flc_log ('skipping tree compression (just making a plain copy)')
+	run ("mv %s %s" % (sysdir, csysdir), builddir)
+	run ("%s %s %s %s" % (normalize_path([bindir, 'install-boot.sh']), csysdir, csysdir, kernel_version), builddir)
 
 # create iso image
 
 flc_log ('creating iso image %s' % isoimage)
 
-run ("%s %s %s" % (normalize_path([bindir, 'create-iso.sh']), csysdir, isoimage), builddir)
+if nocompress:
+	run ("%s %s %s" % (normalize_path([bindir, 'create-iso.sh']), csysdir, isoimage), builddir)
+else:
+	run ("%s %s %s -z" % (normalize_path([bindir, 'create-iso.sh']), csysdir, isoimage), builddir)
 
 # delete builddir
 
--- /home/brentonr/downloads/kadischi.cvs/livecd_generator/install-boot.sh	2005-08-21 12:09:00.000000000 -0500
+++ install-boot.sh	2006-02-24 08:46:43.000000000 -0600
@@ -4,7 +4,9 @@
 csysdir=$2
 kernel=$3
 
-cp $sysdir/boot/isolinux/initrd.img $csysdir/boot/isolinux/initrd.img
+if [ "$sysdir" != "$csysdir" ]; then
+	cp $sysdir/boot/isolinux/initrd.img $csysdir/boot/isolinux/initrd.img
+fi
 cp $sysdir/boot/vmlinuz-$kernel $csysdir/boot/isolinux/vmlinuz
 cp /usr/lib/syslinux/isolinux.bin $csysdir/boot/isolinux/
 cat > $csysdir/boot/isolinux/isolinux.cfg <<_EOF_
@@ -17,4 +19,4 @@
 label test
   kernel vmlinuz
   append initrd=initrd.img INITRD_DBG=x ramdisk_size=10000
-_EOF_
\ No newline at end of file
+_EOF_

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]