buildinstall: Add support for rootfs-type lorax option
JIRA: ENGCMP-5117 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
b3a316776e
commit
3c6298ee28
6 changed files with 34 additions and 0 deletions
|
|
@ -629,6 +629,10 @@ Options
|
|||
* ``squashfs_only`` -- *bool* (default ``False``) pass the --squashfs_only to Lorax.
|
||||
* ``configuration_file`` -- (:ref:`scm_dict <scm_support>`) (default empty) pass the
|
||||
specified configuration file to Lorax using the -c option.
|
||||
* ``rootfs_type`` -- *string* (default empty) pass the ``--rootfs-type``
|
||||
option to Lorax with the provided value. If not specified, no type is
|
||||
specified to Lorax, which will choose whatever default it is configured
|
||||
with.
|
||||
**lorax_extra_sources**
|
||||
(*list*) -- a variant/arch mapping with urls for extra source repositories
|
||||
added to Lorax command line. Either one repo or a list can be specified.
|
||||
|
|
|
|||
|
|
@ -1411,6 +1411,7 @@ def make_schema():
|
|||
"skip_branding": {"type": "boolean"},
|
||||
"squashfs_only": {"type": "boolean"},
|
||||
"configuration_file": {"$ref": "#/definitions/str_or_scm_dict"},
|
||||
"rootfs_type": {"type": "string"},
|
||||
},
|
||||
"additionalProperties": False,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ class BuildinstallPhase(PhaseBase):
|
|||
squashfs_only = False
|
||||
configuration_file = None
|
||||
configuration_file_source = None
|
||||
rootfs_type = None
|
||||
version = self.compose.conf.get(
|
||||
"treeinfo_version", self.compose.conf["release_version"]
|
||||
)
|
||||
|
|
@ -116,6 +117,7 @@ class BuildinstallPhase(PhaseBase):
|
|||
skip_branding = data.get("skip_branding", False)
|
||||
configuration_file_source = data.get("configuration_file")
|
||||
squashfs_only = data.get("squashfs_only", False)
|
||||
rootfs_type = data.get("rootfs_type", None)
|
||||
if "version" in data:
|
||||
version = data["version"]
|
||||
output_dir = os.path.join(output_dir, variant.uid)
|
||||
|
|
@ -171,6 +173,7 @@ class BuildinstallPhase(PhaseBase):
|
|||
"skip_branding": skip_branding,
|
||||
"squashfs_only": squashfs_only,
|
||||
"configuration_file": configuration_file,
|
||||
"rootfs-type": rootfs_type,
|
||||
}
|
||||
else:
|
||||
# If the buildinstall_topdir is set, it means Koji is used for
|
||||
|
|
@ -205,6 +208,7 @@ class BuildinstallPhase(PhaseBase):
|
|||
skip_branding=skip_branding,
|
||||
squashfs_only=squashfs_only,
|
||||
configuration_file=configuration_file,
|
||||
rootfs_type=rootfs_type,
|
||||
)
|
||||
return "rm -rf %s && %s" % (
|
||||
shlex.quote(output_topdir),
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ class LoraxWrapper(object):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
):
|
||||
cmd = ["lorax"]
|
||||
cmd.append("--product=%s" % product)
|
||||
|
|
@ -106,6 +107,9 @@ class LoraxWrapper(object):
|
|||
output_dir = os.path.abspath(output_dir)
|
||||
cmd.append(output_dir)
|
||||
|
||||
if rootfs_type:
|
||||
cmd.append("--rootfs-type=%s" % rootfs_type)
|
||||
|
||||
# TODO: workdir
|
||||
|
||||
return cmd
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -183,6 +184,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -212,6 +214,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
|
@ -293,6 +296,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
"skip_branding": False,
|
||||
"squashfs_only": False,
|
||||
"configuration_file": None,
|
||||
"rootfs-type": None,
|
||||
},
|
||||
{
|
||||
"product": "Test",
|
||||
|
|
@ -320,6 +324,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
"skip_branding": False,
|
||||
"squashfs_only": False,
|
||||
"configuration_file": None,
|
||||
"rootfs-type": None,
|
||||
},
|
||||
{
|
||||
"product": "Test",
|
||||
|
|
@ -347,6 +352,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
"skip_branding": False,
|
||||
"squashfs_only": False,
|
||||
"configuration_file": None,
|
||||
"rootfs-type": None,
|
||||
},
|
||||
]
|
||||
|
||||
|
|
@ -444,6 +450,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
)
|
||||
],
|
||||
any_order=True,
|
||||
|
|
@ -557,6 +564,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
"logs/x86_64/buildinstall-Server-logs",
|
||||
"lorax.conf",
|
||||
),
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -585,6 +593,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=True,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -613,6 +622,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
|
@ -730,6 +740,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -758,6 +769,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -786,6 +798,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
|
@ -886,6 +899,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -914,6 +928,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -942,6 +957,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
|
@ -1035,6 +1051,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -1063,6 +1080,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
mock.call(
|
||||
"Test",
|
||||
|
|
@ -1093,6 +1111,7 @@ class TestBuildinstallPhase(PungiTestCase):
|
|||
skip_branding=False,
|
||||
squashfs_only=False,
|
||||
configuration_file=None,
|
||||
rootfs_type=None,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class LoraxWrapperTest(unittest.TestCase):
|
|||
squashfs_only=True,
|
||||
configuration_file="/storage/RHEL-7.8-20200731.n.0/"
|
||||
+ "logs/x86_64/buildinstall-Server-logs/lorax.conf",
|
||||
rootfs_type="erofs",
|
||||
)
|
||||
|
||||
self.assertEqual(cmd[0], "lorax")
|
||||
|
|
@ -84,6 +85,7 @@ class LoraxWrapperTest(unittest.TestCase):
|
|||
"--config",
|
||||
"/storage/RHEL-7.8-20200731.n.0/"
|
||||
+ "logs/x86_64/buildinstall-Server-logs/lorax.conf",
|
||||
"--rootfs-type=erofs",
|
||||
"/mnt/output_dir",
|
||||
],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue