From f1c9940f14be032458c1087ce0985a6d0d52f6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 21 Feb 2019 16:14:23 +0100 Subject: [PATCH] Make it possible to disable Apple/HFS compatibility on ppc64le --- 0001-update-iso-creation-for-ppc64le.patch | 47 ++++ ...Apple-HFS-compatibility-configurable.patch | 203 ++++++++++++++++++ pungi.spec | 7 +- 3 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 0001-update-iso-creation-for-ppc64le.patch create mode 100644 0002-Make-the-Apple-HFS-compatibility-configurable.patch diff --git a/0001-update-iso-creation-for-ppc64le.patch b/0001-update-iso-creation-for-ppc64le.patch new file mode 100644 index 00000000..e9800cc4 --- /dev/null +++ b/0001-update-iso-creation-for-ppc64le.patch @@ -0,0 +1,47 @@ +From 071d11a8836c7da8730cdfd54531121a75bb4dcf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +Date: Wed, 20 Feb 2019 11:47:33 +0100 +Subject: [PATCH 1/2] update iso creation for ppc64le +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Don't produce ISO image with Apple/HFS compatibility stuff on ppc64le. + +Signed-off-by: Dan Horák +--- + pungi/wrappers/iso.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/pungi/wrappers/iso.py b/pungi/wrappers/iso.py +index 0b8afa2a..f059ccd9 100644 +--- a/pungi/wrappers/iso.py ++++ b/pungi/wrappers/iso.py +@@ -63,7 +63,7 @@ def get_boot_options(arch, createfrom, efi=True): + ] + return result + +- if arch in ("ppc", "ppc64", "ppc64le"): ++ if arch in ("ppc", "ppc64"): + result = [ + '-part', + '-hfs', +@@ -78,6 +78,15 @@ def get_boot_options(arch, createfrom, efi=True): + ] + return result + ++ if arch == "ppc64le": ++ result = [ ++ '-r', ++ '-l', ++ '-sysid', 'PPC', ++ '-chrp-boot', ++ ] ++ return result ++ + if arch == "sparc": + result = [ + '-G', '/boot/isofs.b', +-- +2.17.2 + diff --git a/0002-Make-the-Apple-HFS-compatibility-configurable.patch b/0002-Make-the-Apple-HFS-compatibility-configurable.patch new file mode 100644 index 00000000..81115565 --- /dev/null +++ b/0002-Make-the-Apple-HFS-compatibility-configurable.patch @@ -0,0 +1,203 @@ +From f33973ee65812390762e106f8715508758849f5f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Thu, 21 Feb 2019 13:56:58 +0100 +Subject: [PATCH 2/2] Make the Apple/HFS compatibility configurable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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ář +--- + doc/configuration.rst | 5 +++++ + pungi/checks.py | 1 + + pungi/createiso.py | 8 ++++++-- + pungi/phases/createiso.py | 1 + + pungi/phases/extra_isos.py | 1 + + pungi/wrappers/iso.py | 6 +++--- + tests/test_createiso_phase.py | 17 ++++++++++++----- + 7 files changed, 29 insertions(+), 10 deletions(-) + +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, +-- +2.17.2 + diff --git a/pungi.spec b/pungi.spec index bf51f95c..4e868385 100644 --- a/pungi.spec +++ b/pungi.spec @@ -2,12 +2,14 @@ Name: pungi Version: 4.1.33 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 +Patch0: 0001-update-iso-creation-for-ppc64le.patch +Patch1: 0002-Make-the-Apple-HFS-compatibility-configurable.patch BuildRequires: python3-nose BuildRequires: python3-mock @@ -194,6 +196,9 @@ nosetests-3 --exe %{_bindir}/%{name}-wait-for-signed-ostree-handler %changelog +* Thu Feb 21 2019 Lubomír Sedlář - 4.1.33-2 +- Make it possible to disable Apple/HFS compatibility on ppc64le + * Wed Feb 13 2019 Lubomír Sedlář - 4.1.33-1 - isos: Check maximum expected size (lsedlar) - osbs: Process data about pushing images to registries (lsedlar)