pungi used to create CD that includes a kickstart file

Martin Steinmann msteinmann at vesbridge.com
Thu Jun 14 02:20:19 UTC 2007


>
>>
>AFAIK pungi does not do this and it seems a very interesting feature to 
>add.  If you have any patches just post them on the list.  I'm sure 
>you'll get some feedback.
>Regards.
>
>-- 
>Joel Andres Granados
>


The following is a simple patch to pungi that allows adding a kickstart file as well as customize the files in the isolinux directory.

The patch is against pungi-0.3.7-1.fc7

Two new parameters are introduced to the pungi.conf file in the [default] section:

kickstart = <path> allows specifying a path to a kickstart file that is copied into the root of the ISO
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.

The patch includes two additional fixes:

1) The error printout _doRunCommand was extended to print the whole command

2) There seems to be a bug in the composition of the mkisofs command. Quotation marks are missing around the volume ID (-V parameter)


Patch 1: /usr/lib/python2.5/site-packages/pypungi/pungy.py
----------------------------------------------------------

[xxx at fc7 pypungi]$ diff pungi.py pungi.py.orig
77c77
<             raise OSError, "Got an error from %s" % ' '.join(command)
---
>             raise OSError, "Got an error from %s" % command[0]
149,178d148
<     #---Added
<     def doGetKickstart(self):
<         """Get kickstart file and put in the topdir of the tree."""
<
<         if self.config.get('default', 'kickstart') == "":
<             return
<
<         kickstartinstall = ['/bin/cp']
<         kickstartinstall.append(self.config.get('default', 'kickstart'))
<         kickstartinstall.append(self.topdir)
<
<         # run the command
<         self._doRunCommand(kickstartinstall)
<
<     #--Added
<     def doGetIsolinuxdir(self):
<         """Copy files in the directory indicated by isolinuxdir path into the /isolinux directory."""
<
<         if self.config.get('default', 'isolinuxdir') == "":
<             return
<
<         # Some files in the isolinux directory are write-protected - use the force option
<         isolinuxpath = os.path.join(self.topdir, 'isolinux')
<         sourcepath = os.path.join(self.config.get('default', 'isolinuxdir'), '*')
<         if os.path.isdir(isolinuxpath):
<             os.system('ls -l ' + isolinuxpath)
<             os.system('cp --force ' + sourcepath + ' ' + isolinuxpath)
<             os.system('ls -l ' + isolinuxpath)
<
<
393c363
<                 extraargs.append('"%s %s %s Disc %s"' % (self.config.get('default', 'product_name'),
---
>                 extraargs.append('%s %s %s Disc %s' % (self.config.get('default', 'product_name'),
456c426
<             extraargs.append('"%s %s %s DVD"' % (self.config.get('default', 'product_name'),
---
>             extraargs.append('%s %s %s DVD' % (self.config.get('default', 'product_name'),

Patch 2: /usr/bin/pungi
-----------------------

[xxx at fc7 bin]$ diff pungi pungi.orig
35,37d34
<     #---Added
<     kickstart = ""
<     isolinuxdir = ""
75,81d71
<     #---Added
<     if not config.has_option('default', 'kickstart'):
<         config.set('default', 'kickstart', kickstart)
<
<     if not config.has_option('default', 'isolinuxdir'):
<         config.set('default', 'isolinuxdir', isolinuxdir)
<
127,129d116
<            #---Added
<            mypungi.doGetKickstart()
<            mypungi.doGetIsolinuxdir()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-buildsys-list/attachments/20070613/f0bba2a3/attachment.htm>


More information about the Fedora-buildsys-list mailing list