From e7e6adfb14c7c0bae7c98454975624c71d1ee1c6 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 17 Nov 2016 10:15:03 -0500 Subject: [PATCH 1/2] Expose lorax's --rootfs-size argument This is going to be necessary for reworking the Atomic Host ISO, see: https://pagure.io/fedora-lorax-templates/pull-request/6 Signed-off-by: Colin Walters --- doc/configuration.rst | 1 + pungi/checks.py | 1 + pungi/phases/ostree_installer.py | 1 + pungi/wrappers/lorax.py | 4 ++++ tests/test_config.py | 1 + 5 files changed, 8 insertions(+) diff --git a/doc/configuration.rst b/doc/configuration.rst index e22ae44..58be31e 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -1171,6 +1171,7 @@ an OSTree repository. This always runs in Koji as a ``runroot`` task. * ``add_arch_template`` -- (*[str]*) * ``add_template_var`` -- (*[str]*) * ``add_arch_template_var`` -- (*[str]*) + * ``rootfs_size`` -- (*[str]*) * ``template_repo`` -- (*str*) Git repository with extra templates. * ``template_branch`` -- (*str*) Branch to use from ``template_repo``. diff --git a/pungi/checks.py b/pungi/checks.py index edf7020..be7cfc7 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -715,6 +715,7 @@ def _make_schema(): "add_arch_template": {"$ref": "#/definitions/list_of_strings"}, "add_template_var": {"$ref": "#/definitions/list_of_strings"}, "add_arch_template_var": {"$ref": "#/definitions/list_of_strings"}, + "rootfs_size": {"type": "string"}, "template_repo": {"type": "string"}, "template_branch": {"type": "string"}, }, diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py index 8cde3d7..b07d7a4 100644 --- a/pungi/phases/ostree_installer.py +++ b/pungi/phases/ostree_installer.py @@ -152,6 +152,7 @@ class OstreeInstallerThread(WorkerThread): add_arch_template=self._get_templates(config, 'add_arch_template'), add_template_var=config.get('add_template_var'), add_arch_template_var=config.get('add_arch_template_var'), + rootfs_size=config.get('rootfs_size'), is_final=compose.supported, log_dir=self.logdir, ) diff --git a/pungi/wrappers/lorax.py b/pungi/wrappers/lorax.py index 12263fa..50b91c0 100644 --- a/pungi/wrappers/lorax.py +++ b/pungi/wrappers/lorax.py @@ -26,6 +26,7 @@ class LoraxWrapper(object): is_final=False, buildarch=None, volid=None, buildinstallpackages=None, add_template=None, add_arch_template=None, add_template_var=None, add_arch_template_var=None, + rootfs_size=None, log_dir=None): cmd = ["lorax"] cmd.append("--product=%s" % product) @@ -67,6 +68,9 @@ class LoraxWrapper(object): if log_dir: cmd.append('--logfile=%s' % os.path.join(log_dir, 'lorax.log')) + if rootfs_size is not None: + cmd.append('--rootfs-size=%s' % (rootfs_size)) + output_dir = os.path.abspath(output_dir) cmd.append(output_dir) diff --git a/tests/test_config.py b/tests/test_config.py index b49b2c1..7f49f5d 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -310,6 +310,7 @@ class OstreeInstallerConfigTestCase(unittest.TestCase): "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", ], "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], + "rootfs_size": "3", "add_arch_template_var": [ "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", "ostree_osname=fedora-atomic", -- 2.9.3