From 86314fdc83fa77cbaaa832b0cfe40680893e206b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Sat, 12 Jan 2019 11:26:18 +0100 Subject: [PATCH] pungi-legacy: expose lorax's --rootfs-size argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merges: https://pagure.io/pungi/pull-request/1112 Fixes: https://pagure.io/pungi/issue/1107 Signed-off-by: Frédéric Pierret (fepitre) --- bin/pungi | 5 +++++ pungi/config.py | 1 + pungi/gather.py | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/pungi b/bin/pungi index 221a79c0..0a45d178 100755 --- a/bin/pungi +++ b/bin/pungi @@ -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 ') diff --git a/pungi/config.py b/pungi/config.py index 7fd783e0..3c94739c 100644 --- a/pungi/config.py +++ b/pungi/config.py @@ -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: diff --git a/pungi/gather.py b/pungi/gather.py index 5034cbc7..6c152e58 100644 --- a/pungi/gather.py +++ b/pungi/gather.py @@ -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")