<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.14">
<TITLE>RE: pungi used to create CD that includes a kickstart file</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>><BR>
>><BR>
>AFAIK pungi does not do this and it seems a very interesting feature to<BR>
>add.  If you have any patches just post them on the list.  I'm sure<BR>
>you'll get some feedback.<BR>
>Regards.<BR>
><BR>
>--<BR>
>Joel Andres Granados<BR>
><BR>
<BR>
<BR>
The following is a simple patch to pungi that allows adding a kickstart file as well as customize the files in the isolinux directory.<BR>
<BR>
The patch is against pungi-0.3.7-1.fc7<BR>
<BR>
Two new parameters are introduced to the pungi.conf file in the [default] section:<BR>
<BR>
kickstart = <path> allows specifying a path to a kickstart file that is copied into the root of the ISO<BR>
isolinuxdir = <path> allows specifying a directory that contains files that should be copied into the isolinux directory. This can be used to add a new splash image or to modify the file isolinux.cfg to add the kickstart kernel parameter. Existing files are overwritten.<BR>
<BR>
The patch includes two additional fixes:<BR>
<BR>
1) The error printout _doRunCommand was extended to print the whole command<BR>
<BR>
2) There seems to be a bug in the composition of the mkisofs command. Quotation marks are missing around the volume ID (-V parameter)<BR>
<BR>
<BR>
Patch 1: /usr/lib/python2.5/site-packages/pypungi/pungy.py<BR>
----------------------------------------------------------<BR>
<BR>
[xxx@fc7 pypungi]$ diff pungi.py pungi.py.orig<BR>
77c77<BR>
<             raise OSError, "Got an error from %s" % ' '.join(command)<BR>
---<BR>
>             raise OSError, "Got an error from %s" % command[0]<BR>
149,178d148<BR>
<     #---Added<BR>
<     def doGetKickstart(self):<BR>
<         """Get kickstart file and put in the topdir of the tree."""<BR>
<<BR>
<         if self.config.get('default', 'kickstart') == "":<BR>
<             return<BR>
<<BR>
<         kickstartinstall = ['/bin/cp']<BR>
<         kickstartinstall.append(self.config.get('default', 'kickstart'))<BR>
<         kickstartinstall.append(self.topdir)<BR>
<<BR>
<         # run the command<BR>
<         self._doRunCommand(kickstartinstall)<BR>
<<BR>
<     #--Added<BR>
<     def doGetIsolinuxdir(self):<BR>
<         """Copy files in the directory indicated by isolinuxdir path into the /isolinux directory."""<BR>
<<BR>
<         if self.config.get('default', 'isolinuxdir') == "":<BR>
<             return<BR>
<<BR>
<         # Some files in the isolinux directory are write-protected - use the force option<BR>
<         isolinuxpath = os.path.join(self.topdir, 'isolinux')<BR>
<         sourcepath = os.path.join(self.config.get('default', 'isolinuxdir'), '*')<BR>
<         if os.path.isdir(isolinuxpath):<BR>
<             os.system('ls -l ' + isolinuxpath)<BR>
<             os.system('cp --force ' + sourcepath + ' ' + isolinuxpath)<BR>
<             os.system('ls -l ' + isolinuxpath)<BR>
<<BR>
<<BR>
393c363<BR>
<                 extraargs.append('"%s %s %s Disc %s"' % (self.config.get('default', 'product_name'),<BR>
---<BR>
>                 extraargs.append('%s %s %s Disc %s' % (self.config.get('default', 'product_name'),<BR>
456c426<BR>
<             extraargs.append('"%s %s %s DVD"' % (self.config.get('default', 'product_name'),<BR>
---<BR>
>             extraargs.append('%s %s %s DVD' % (self.config.get('default', 'product_name'),<BR>
<BR>
Patch 2: /usr/bin/pungi<BR>
-----------------------<BR>
<BR>
[xxx@fc7 bin]$ diff pungi pungi.orig<BR>
35,37d34<BR>
<     #---Added<BR>
<     kickstart = ""<BR>
<     isolinuxdir = ""<BR>
75,81d71<BR>
<     #---Added<BR>
<     if not config.has_option('default', 'kickstart'):<BR>
<         config.set('default', 'kickstart', kickstart)<BR>
<<BR>
<     if not config.has_option('default', 'isolinuxdir'):<BR>
<         config.set('default', 'isolinuxdir', isolinuxdir)<BR>
<<BR>
127,129d116<BR>
<            #---Added<BR>
<            mypungi.doGetKickstart()<BR>
<            mypungi.doGetIsolinuxdir()<BR>
</FONT>
</P>

</BODY>
</HTML>