diff --git a/doc/configuration.rst b/doc/configuration.rst index fa9b3b2a..7aae3689 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -1036,6 +1036,11 @@ Options (*int|str*) -- how much free space should be left on each disk. The format is the same as for ``iso_size`` option. +**iso_hfs_ppc64le_compatible** = True + (*bool*) -- when set to False, the Apple/HFS compatibility is turned off + for ppc64le ISOs. This option only makes sense for bootable products, and + affects images produced in *createiso* and *extra_isos* phases. + .. note:: Source architecture needs to be listed explicitly. diff --git a/pungi/checks.py b/pungi/checks.py index 0f2ab356..8ac5b882 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -735,6 +735,7 @@ def make_schema(): "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 d079b778..2e0ff706 100644 --- a/pungi/createiso.py +++ b/pungi/createiso.py @@ -13,7 +13,8 @@ from .wrappers.jigdo import JigdoWrapper CreateIsoOpts = namedtuple('CreateIsoOpts', ['buildinstall_method', 'arch', 'output_dir', 'jigdo_dir', - 'iso_name', 'volid', 'graft_points', 'supported', 'os_tree']) + 'iso_name', 'volid', 'graft_points', 'supported', 'os_tree', + "hfs_compat"]) CreateIsoOpts.__new__.__defaults__ = (None,) * len(CreateIsoOpts._fields) @@ -48,7 +49,10 @@ def make_image(f, opts): if opts.buildinstall_method == 'lorax': emit(f, FIND_TEMPLATE_SNIPPET) mkisofs_kwargs["boot_args"] = iso.get_boot_options( - opts.arch, os.path.join('$TEMPLATE', 'config_files/ppc')) + opts.arch, + os.path.join("$TEMPLATE", "config_files/ppc"), + hfs_compat=opts.hfs_compat, + ) elif opts.buildinstall_method == 'buildinstall': mkisofs_kwargs["boot_args"] = iso.get_boot_options( opts.arch, "/usr/lib/anaconda-runtime/boot") diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py index 060cc0f7..337592be 100644 --- a/pungi/phases/createiso.py +++ b/pungi/phases/createiso.py @@ -140,6 +140,7 @@ class CreateisoPhase(PhaseLoggerMixin, PhaseBase): graft_points=graft_points, arch=arch, supported=self.compose.supported, + hfs_compat=self.compose.conf["iso_hfs_ppc64le_compatible"], ) if bootable: diff --git a/pungi/phases/extra_isos.py b/pungi/phases/extra_isos.py index 6c4b5e0f..a960f28c 100644 --- a/pungi/phases/extra_isos.py +++ b/pungi/phases/extra_isos.py @@ -105,6 +105,7 @@ class ExtraIsosThread(WorkerThread): graft_points=graft_points, arch=arch, supported=compose.supported, + hfs_compat=compose.conf["iso_hfs_ppc64le_compatible"], ) 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 f059ccd9..d33e8cc6 100644 --- a/pungi/wrappers/iso.py +++ b/pungi/wrappers/iso.py @@ -23,7 +23,7 @@ from kobo.shortcuts import force_list, relative_path, run from pungi import util -def get_boot_options(arch, createfrom, efi=True): +def get_boot_options(arch, createfrom, efi=True, hfs_compat=True): """Checks to see what we need as the -b option for mkisofs""" if arch in ("arm", "armhfp"): @@ -63,7 +63,7 @@ def get_boot_options(arch, createfrom, efi=True): ] return result - if arch in ("ppc", "ppc64"): + if arch in ("ppc", "ppc64") or (arch == "ppc64le" and hfs_compat): result = [ '-part', '-hfs', @@ -78,7 +78,7 @@ def get_boot_options(arch, createfrom, efi=True): ] return result - if arch == "ppc64le": + if arch == "ppc64le" and not hfs_compat: result = [ '-r', '-l', diff --git a/tests/test_createiso_phase.py b/tests/test_createiso_phase.py index 3afd93be..d89a1af8 100644 --- a/tests/test_createiso_phase.py +++ b/tests/test_createiso_phase.py @@ -109,7 +109,9 @@ class CreateisoPhaseTest(helpers.PungiTestCase): arch='x86_64', supported=True, jigdo_dir='%s/compose/Server/x86_64/jigdo' % self.topdir, - os_tree='%s/compose/Server/x86_64/os' % self.topdir)]) + os_tree='%s/compose/Server/x86_64/os' % self.topdir, + hfs_compat=True, + )]) self.assertItemsEqual( pool.queue_put.call_args_list, [mock.call(( @@ -178,7 +180,8 @@ class CreateisoPhaseTest(helpers.PungiTestCase): buildinstall_method='lorax', supported=True, jigdo_dir='%s/compose/Server/x86_64/jigdo' % self.topdir, - os_tree='%s/compose/Server/x86_64/os' % self.topdir), + os_tree='%s/compose/Server/x86_64/os' % self.topdir, + hfs_compat=True), CreateIsoOpts(output_dir='%s/compose/Server/source/iso' % self.topdir, iso_name='image-name', volid='test-1.0 Server.src', @@ -186,7 +189,8 @@ class CreateisoPhaseTest(helpers.PungiTestCase): arch='src', supported=True, jigdo_dir='%s/compose/Server/source/jigdo' % self.topdir, - os_tree='%s/compose/Server/source/tree' % self.topdir)]) + os_tree='%s/compose/Server/source/tree' % self.topdir, + hfs_compat=True)]) self.assertItemsEqual( pool.queue_put.call_args_list, [mock.call((compose, @@ -258,7 +262,8 @@ class CreateisoPhaseTest(helpers.PungiTestCase): arch='src', supported=True, jigdo_dir='%s/compose/Server/source/jigdo' % self.topdir, - os_tree='%s/compose/Server/source/tree' % self.topdir)]) + os_tree='%s/compose/Server/source/tree' % self.topdir, + hfs_compat=True)]) self.assertItemsEqual( pool.queue_put.call_args_list, [mock.call((compose, @@ -287,6 +292,7 @@ class CreateisoPhaseTest(helpers.PungiTestCase): 'bootable': True, 'createiso_skip': [], 'buildinstall_skip': [('Server', {'*': True})], + "iso_hfs_ppc64le_compatible": False, }) helpers.touch(os.path.join( compose.paths.compose.os_tree('x86_64', compose.variants['Server']), @@ -321,7 +327,8 @@ class CreateisoPhaseTest(helpers.PungiTestCase): arch='x86_64', supported=True, jigdo_dir='%s/compose/Server/x86_64/jigdo' % self.topdir, - os_tree='%s/compose/Server/x86_64/os' % self.topdir)]) + os_tree='%s/compose/Server/x86_64/os' % self.topdir, + hfs_compat=False)]) self.assertItemsEqual( pool.queue_put.call_args_list, [mock.call((compose,