pungi-legacy: expose lorax's --rootfs-size argument

Merges: https://pagure.io/pungi/pull-request/1112
Fixes: https://pagure.io/pungi/issue/1107
Signed-off-by: Frédéric Pierret (fepitre) <frederic.pierret@qubes-os.org>
This commit is contained in:
Frédéric Pierret (fepitre) 2019-01-12 11:26:18 +01:00 committed by Lubomír Sedlář
parent 3fe4beb20c
commit 86314fdc83
3 changed files with 12 additions and 2 deletions

View File

@ -331,6 +331,11 @@ if __name__ == '__main__':
help='Which files are the release notes -- GPL EULA')
parser.add_argument("--nomacboot", action="store_true", dest="nomacboot",
help='disable setting up macboot as no hfs support ')
parser.add_argument(
"--rootfs-size", dest="rootfs_size", action=SetConfig, default=False,
help='Size of root filesystem in GiB. If not specified, use lorax default value')
parser.add_argument(
"--pungirc", dest="pungirc", default='~/.pungirc', action=SetConfig,
help='Read pungi options from config file ')

View File

@ -65,6 +65,7 @@ class Config(SafeConfigParser):
self.set('pungi', 'resolve_deps', "True")
self.set('pungi', 'no_dvd', "False")
self.set('pungi', 'nomacboot', "False")
self.set('pungi', 'rootfs_size', "False")
# if missing, self.read() is a noop, else change 'defaults'
if pungirc:

View File

@ -138,8 +138,6 @@ class PungiBase(object):
self.config.get('pungi', 'variant'),
self.tree_arch)
def doLoggerSetup(self):
"""Setup our logger"""
@ -302,6 +300,9 @@ class Pungi(PungiBase):
self.fulltree_excludes = set(self.ksparser.handler.fulltree_excludes)
# rootfs image size
self.rootfs_size = self.config.get('pungi', 'rootfs_size')
def _add_yum_repo(self, name, url, mirrorlist=False, groups=True,
cost=1000, includepkgs=None, excludepkgs=None,
proxy=None):
@ -1570,6 +1571,9 @@ class Pungi(PungiBase):
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
pass
if self.rootfs_size != "False":
cmd.extend(["--rootfs-size", self.rootfs_size])
# Allow the output directory to exist.
cmd.append("--force")