Add support for --installpkgs

This allows the user to add specific packages, or package globs, to the
installer's root via lorax. For example, to build a server product with
the correct product.img you would pass --installpkgs
fedora-productimg-server

This removes the need for the kickstart to use --exclude on the repo
lines and makes it more explicit as to what is being built. This command
mirrors the same command in lorax.
This commit is contained in:
Brian C. Lane 2014-12-08 15:04:12 -08:00 committed by Dennis Gilmore
parent 2221f66ff5
commit c4dd0e75ed
3 changed files with 12 additions and 2 deletions

View File

@ -11,7 +11,7 @@ URL: https://fedorahosted.org/pungi
Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2
Requires: createrepo >= 0.4.11 Requires: createrepo >= 0.4.11
Requires: yum => 3.4.3-28 Requires: yum => 3.4.3-28
Requires: lorax Requires: lorax >= 22.1
Requires: repoview Requires: repoview
Requires: python-lockfile Requires: python-lockfile

View File

@ -115,6 +115,8 @@ def main():
if opts.lorax_conf: if opts.lorax_conf:
config.set("lorax", "conf_file", opts.lorax_conf) config.set("lorax", "conf_file", opts.lorax_conf)
if opts.installpkgs:
config.set("lorax", "installpkgs", " ".join(opts.installpkgs))
# Actually do work. # Actually do work.
mypungi = pypungi.Pungi(config, ksparser) mypungi = pypungi.Pungi(config, ksparser)
@ -265,6 +267,9 @@ if __name__ == '__main__':
help='Do not make a install DVD/CD only the netinstall image and the tree') help='Do not make a install DVD/CD only the netinstall image and the tree')
parser.add_option("--lorax-conf", type="string", parser.add_option("--lorax-conf", type="string",
help='Path to lorax.conf file (optional)') help='Path to lorax.conf file (optional)')
parser.add_option("-i", "--installpkgs", default=[],
action="append", metavar="STRING",
help="Package glob for lorax to install before runtime-install.tmpl runs. (may be listed multiple times)")
parser.add_option("-c", "--config", dest="config", parser.add_option("-c", "--config", dest="config",
help='Path to kickstart config file') help='Path to kickstart config file')

View File

@ -1413,9 +1413,14 @@ class Pungi(pypungi.PungiBase):
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError): except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
lorax.configure() lorax.configure()
try:
installpkgs = self.config.get('lorax', 'installpkgs').split(" ")
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
installpkgs = None
lorax.run(self.ayum, product=product, version=version, release=release, lorax.run(self.ayum, product=product, version=version, release=release,
variant=variant, bugurl=bugurl, isfinal=isfinal, domacboot=domacboot, variant=variant, bugurl=bugurl, isfinal=isfinal, domacboot=domacboot,
workdir=workdir, outputdir=outputdir, volid=volid) workdir=workdir, outputdir=outputdir, volid=volid, installpkgs=installpkgs)
# write out the tree data for snake # write out the tree data for snake
self.writeinfo('tree: %s' % self.mkrelative(self.topdir)) self.writeinfo('tree: %s' % self.mkrelative(self.topdir))