Backport patches for ostree installer

* Expose lorax's rootfs-size argument
 * Use dvd-ostree as type in metadata
This commit is contained in:
Lubomír Sedlář 2016-12-08 08:59:47 +01:00
parent 6db0406068
commit 6f72597677
3 changed files with 144 additions and 1 deletions

View File

@ -0,0 +1,90 @@
From e7e6adfb14c7c0bae7c98454975624c71d1ee1c6 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
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 <walters@verbum.org>
---
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

View File

@ -0,0 +1,46 @@
From ec4fb785e5e68d09b6790963085d33787337ac0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
Date: Thu, 6 Oct 2016 13:12:34 +0200
Subject: [PATCH 2/2] ostree-installer: Use dvd-ostree as type in metadata
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This depends on python-productmd >= 1.3 that understands this format.
Fixes: #417
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
---
pungi/phases/ostree_installer.py | 2 +-
tests/test_ostree_installer_phase.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py
index b07d7a4..5b8d89d 100644
--- a/pungi/phases/ostree_installer.py
+++ b/pungi/phases/ostree_installer.py
@@ -107,7 +107,7 @@ class OstreeInstallerThread(WorkerThread):
img.mtime = util.get_mtime(full_iso_path)
img.size = util.get_file_size(full_iso_path)
img.arch = arch
- img.type = "boot"
+ img.type = "dvd-ostree"
img.format = "iso"
img.disc_number = 1
img.disc_count = 1
diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py
index ad7ee2f..b3e04b6 100644
--- a/tests/test_ostree_installer_phase.py
+++ b/tests/test_ostree_installer_phase.py
@@ -61,7 +61,7 @@ class OstreeThreadTest(helpers.PungiTestCase):
self.assertEqual(image.mtime, 13579)
self.assertEqual(image.size, 1024)
self.assertEqual(image.arch, 'x86_64')
- self.assertEqual(image.type, "boot")
+ self.assertEqual(image.type, "dvd-ostree")
self.assertEqual(image.format, "iso")
self.assertEqual(image.disc_number, 1)
self.assertEqual(image.disc_count, 1)
--
2.9.3

View File

@ -1,12 +1,14 @@
Name: pungi
Version: 4.1.11
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Distribution compose tool
Group: Development/Tools
License: GPLv2
URL: https://pagure.io/pungi
Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2
Patch0: 0001-Expose-lorax-s-rootfs-size-argument.patch
Patch1: 0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch
BuildRequires: python-nose, python-mock
BuildRequires: python-devel, python-setuptools, python2-productmd
@ -56,6 +58,8 @@ A tool to create anaconda based installation trees/isos of a set of rpms.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
%{__python} setup.py build
@ -88,6 +92,9 @@ cd tests && ./test_compose.sh
/var/cache/pungi
%changelog
* Thu Dec 08 2016 Lubomír Sedlář <lsedlar@redhat.com> - 4.1.11-3
- Backport patches for ostree installer
* Mon Nov 21 2016 Lubomír Sedlář <lsedlar@redhat.com> - 4.1.11-2
- Add missing dependency on libguestfs-tools-c