Make the Apple/HFS compatibility configurable

The default is the original behaviour. On F30+ a new option should be
added to config to make it work.

Over time as users move to this option (which requires a new enough
version of lorax), the default should be switched and then the option
removed.

Resolves: https://pagure.io/pungi/issue/1126
Merges: https://pagure.io/pungi/pull-request/1128
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-02-21 13:56:58 +01:00
parent 071d11a883
commit f33973ee65
7 changed files with 29 additions and 10 deletions

View File

@ -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.

View File

@ -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"
}),

View File

@ -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")

View File

@ -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:

View File

@ -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)

View File

@ -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',

View File

@ -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,