diff --git a/doc/configuration.rst b/doc/configuration.rst index 7e76b187..d4abb0d6 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -1222,6 +1222,10 @@ Options The staging directory is deleted when ISO is successfully created. In that case the same task to create the ISO will not be re-runnable. +**createiso_use_xorrisofs** = False + (*bool*) -- when set to True, use ``xorrisofs`` for creating ISOs instead + of ``genisoimage``. + **iso_size** = 4700000000 (*int|str*) -- size of ISO image. The value should either be an integer meaning size in bytes, or it can be a string with ``k``, ``M``, ``G`` diff --git a/pungi/checks.py b/pungi/checks.py index 9aec2c49..c37e0fd8 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -78,7 +78,17 @@ def is_genisoimage_needed(conf): """This is only needed locally for createiso without runroot. """ runroot_tag = conf.get("runroot_tag", "") - if runroot_tag: + if runroot_tag or conf.get("createiso_use_xorrisofs"): + return False + return True + + +def is_xorrisofs_needed(conf): + """This is only needed locally for createiso without runroot and + createiso_use_xorrisofs=True. + """ + runroot_tag = conf.get("runroot_tag", "") + if runroot_tag or not conf.get("createiso_use_xorrisofs"): return False return True @@ -96,6 +106,7 @@ tools = [ ("isomd5sum", "/usr/bin/checkisomd5", None), ("jigdo", "/usr/bin/jigdo-lite", is_jigdo_needed), ("genisoimage", "/usr/bin/genisoimage", is_genisoimage_needed), + ("xorriso", "/usr/bin/xorrisofs", is_xorrisofs_needed), ("syslinux", "/usr/bin/isohybrid", is_isohybrid_needed), # createrepo, modifyrepo and mergerepo are not needed by default, only when # createrepo_c is not configured @@ -732,6 +743,7 @@ def make_schema(): {"type": "boolean", "default": False} ), "createiso_break_hardlinks": {"type": "boolean", "default": False}, + "createiso_use_xorrisofs": {"type": "boolean", "default": False}, "iso_hfs_ppc64le_compatible": {"type": "boolean", "default": True}, "multilib": _variant_arch_mapping( {"$ref": "#/definitions/list_of_strings"} diff --git a/pungi/createiso.py b/pungi/createiso.py index b1324d22..1f7990db 100644 --- a/pungi/createiso.py +++ b/pungi/createiso.py @@ -24,6 +24,7 @@ CreateIsoOpts = namedtuple( "supported", "os_tree", "hfs_compat", + "use_xorrisofs", ], ) CreateIsoOpts.__new__.__defaults__ = (None,) * len(CreateIsoOpts._fields) diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py index 8bde4950..cd20080f 100644 --- a/pungi/phases/createiso.py +++ b/pungi/phases/createiso.py @@ -171,6 +171,7 @@ class CreateisoPhase(PhaseLoggerMixin, PhaseBase): arch=arch, supported=self.compose.supported, hfs_compat=self.compose.conf["iso_hfs_ppc64le_compatible"], + use_xorrisofs=self.compose.conf.get("createiso_use_xorrisofs"), ) if bootable: @@ -326,7 +327,11 @@ def add_iso_to_metadata( def run_createiso_command( num, compose, bootable, arch, cmd, mounts, log_file, with_jigdo=True ): - packages = ["coreutils", "genisoimage", "isomd5sum"] + packages = [ + "coreutils", + "xorriso" if compose.conf.get("createiso_use_xorrisofs") else "genisoimage", + "isomd5sum", + ] if with_jigdo and compose.conf["create_jigdo"]: packages.append("jigdo") if bootable: diff --git a/pungi/phases/extra_isos.py b/pungi/phases/extra_isos.py index 4c68a8e6..abca3b1f 100644 --- a/pungi/phases/extra_isos.py +++ b/pungi/phases/extra_isos.py @@ -114,6 +114,7 @@ class ExtraIsosThread(WorkerThread): arch=arch, supported=compose.supported, hfs_compat=compose.conf["iso_hfs_ppc64le_compatible"], + use_xorrisofs=compose.conf.get("createiso_use_xorrisofs"), ) if compose.conf["create_jigdo"]: jigdo_dir = compose.paths.compose.jigdo_dir(arch, variant) diff --git a/pungi/wrappers/iso.py b/pungi/wrappers/iso.py index 2849db7a..afbdf87b 100644 --- a/pungi/wrappers/iso.py +++ b/pungi/wrappers/iso.py @@ -145,6 +145,7 @@ def get_mkisofs_cmd( boot_args=None, input_charset="utf-8", graft_points=None, + use_xorrisofs=False, ): # following options are always enabled untranslated_filenames = True @@ -153,7 +154,7 @@ def get_mkisofs_cmd( joliet_long = True rock = True - cmd = ["/usr/bin/genisoimage"] + cmd = ["/usr/bin/xorrisofs" if use_xorrisofs else "/usr/bin/genisoimage"] if appid: cmd.extend(["-appid", appid]) @@ -178,7 +179,7 @@ def get_mkisofs_cmd( if verbose: cmd.append("-verbose") - if translation_table: + if not use_xorrisofs and translation_table: cmd.append("-translation-table") if input_charset: diff --git a/tests/test_createiso_phase.py b/tests/test_createiso_phase.py index 977de369..48bf37b7 100644 --- a/tests/test_createiso_phase.py +++ b/tests/test_createiso_phase.py @@ -122,6 +122,7 @@ class CreateisoPhaseTest(helpers.PungiTestCase): jigdo_dir="%s/compose/Server/x86_64/jigdo" % self.topdir, os_tree="%s/compose/Server/x86_64/os" % self.topdir, hfs_compat=True, + use_xorrisofs=False, ) ], ) @@ -247,6 +248,7 @@ class CreateisoPhaseTest(helpers.PungiTestCase): jigdo_dir="%s/compose/Server/x86_64/jigdo" % self.topdir, os_tree="%s/compose/Server/x86_64/os" % self.topdir, hfs_compat=True, + use_xorrisofs=False, ), CreateIsoOpts( output_dir="%s/compose/Server/source/iso" % self.topdir, @@ -258,6 +260,7 @@ class CreateisoPhaseTest(helpers.PungiTestCase): jigdo_dir="%s/compose/Server/source/jigdo" % self.topdir, os_tree="%s/compose/Server/source/tree" % self.topdir, hfs_compat=True, + use_xorrisofs=False, ), ], ) @@ -389,6 +392,7 @@ class CreateisoPhaseTest(helpers.PungiTestCase): jigdo_dir="%s/compose/Server/source/jigdo" % self.topdir, os_tree="%s/compose/Server/source/tree" % self.topdir, hfs_compat=True, + use_xorrisofs=False, ) ], ) @@ -495,6 +499,7 @@ class CreateisoPhaseTest(helpers.PungiTestCase): jigdo_dir="%s/compose/Server/x86_64/jigdo" % self.topdir, os_tree="%s/compose/Server/x86_64/os" % self.topdir, hfs_compat=False, + use_xorrisofs=False, ) ], )