From 41e18d8a97d3f4c21bea78e0251e925d5164d231 Mon Sep 17 00:00:00 2001 From: David Lehman Date: Tue, 15 Nov 2016 11:04:36 -0500 Subject: [PATCH] python-blivet-2.1.6-4 - Fix detection of 'macefi' partitions (#1393846) (awilliam) - Fix "unknown" SAS device sysfs parsing. (#1394026) (awilliam) --- ...tection-of-macefi-partitions-1393846.patch | 47 +++++++++++++++++++ ...Fix-unknown-SAS-device-sysfs-parsing.patch | 34 ++++++++++++++ python-blivet.spec | 10 +++- 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-detection-of-macefi-partitions-1393846.patch create mode 100644 0001-Fix-unknown-SAS-device-sysfs-parsing.patch diff --git a/0001-Fix-detection-of-macefi-partitions-1393846.patch b/0001-Fix-detection-of-macefi-partitions-1393846.patch new file mode 100644 index 0000000..57f593a --- /dev/null +++ b/0001-Fix-detection-of-macefi-partitions-1393846.patch @@ -0,0 +1,47 @@ +From d08d99dfb766e539b9e0074643ab3bc940d6fcee Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Thu, 10 Nov 2016 11:34:24 -0800 +Subject: [PATCH] Fix detection of 'macefi' partitions (#1393846) + +368a4db6 lost a crucial condition in the detection of 'macefi' +partitions in the transition to the 'populator helper' design. +Previously we checked that the parted partition 'name' (which +is a GPT property, for GPT partitions) matched the expected +value according to the macefi format, which basically means we +will only detect partitions created by a previous anaconda run +as 'macefi' (because that name is a very specific one which is +only created by anaconda in the first place). + +In the transition, that condition was lost, and now we treat +any device with an HFS+ filesystem that's over 50MiB in size +as a 'macefi' device, which means we mount it at /boot/efi and +try to write all kinds of stuff to it. Not surprisingly, this +borks the install. Fortunately, HFS+ filesystems are mounted +read-only unless they have journalling disabled, so this won't +result in us messing up people's OS X partitions with any luck. +--- + blivet/populator/helpers/boot.py | 10 ++++++++++ + tests/populator_test.py | 33 +++++++++++++++++++++++++++++++++ + 2 files changed, 43 insertions(+) + +diff --git a/blivet/populator/helpers/boot.py b/blivet/populator/helpers/boot.py +index b679b3b..3d80dd2 100644 +--- a/blivet/populator/helpers/boot.py ++++ b/blivet/populator/helpers/boot.py +@@ -54,6 +54,16 @@ class MacEFIFormatPopulator(BootFormatPopulator): + _type_specifier = "macefi" + _base_type_specifier = "hfsplus" + ++ @classmethod ++ def match(cls, data, device): ++ fmt = formats.get_format(cls._type_specifier) ++ try: ++ return (super().match(data, device) and ++ device.parted_partition.name == fmt.name) ++ except AttributeError: ++ # just in case device.parted_partition has no name attr ++ return False ++ + + class AppleBootFormatPopulator(BootFormatPopulator): + _type_specifier = "appleboot" diff --git a/0001-Fix-unknown-SAS-device-sysfs-parsing.patch b/0001-Fix-unknown-SAS-device-sysfs-parsing.patch new file mode 100644 index 0000000..55161b9 --- /dev/null +++ b/0001-Fix-unknown-SAS-device-sysfs-parsing.patch @@ -0,0 +1,34 @@ +From 7a9697eae467fc0ed44022d948f70f30d156d69e Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Fri, 11 Nov 2016 12:36:12 -0500 +Subject: [PATCH] Fix "unknown" SAS device sysfs parsing. + +Since the regexp matches the device type as well as the identifying +numbers, we need to pull the numbers from match groups 2 and 3, not 1 +and 2. + +Resolves: rhbz#1394026 + +Signed-off-by: Peter Jones +--- + blivet/devicelibs/edd.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/blivet/devicelibs/edd.py b/blivet/devicelibs/edd.py +index 7a1a1e2..51b7ed8 100644 +--- a/blivet/devicelibs/edd.py ++++ b/blivet/devicelibs/edd.py +@@ -316,8 +316,8 @@ class EddEntry(object): + self.sas_address = int(sas_match.group(1), base=16) + self.sas_lun = int(sas_match.group(2), base=16) + elif unknown_match: +- self.sas_address = int(unknown_match.group(1), base=16) +- self.sas_lun = int(unknown_match.group(2), base=16) ++ self.sas_address = int(unknown_match.group(2), base=16) ++ self.sas_lun = int(unknown_match.group(3), base=16) + else: + log.warning("edd: can not match interface for %s: %s", + self.sysfspath, interface) +-- +2.7.4 + diff --git a/python-blivet.spec b/python-blivet.spec index 0402071..b1b6d2a 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -5,7 +5,7 @@ Version: 2.1.6 #%%global prerelease .b1 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 -Release: 3%{?prerelease}%{?dist} +Release: 4%{?prerelease}%{?dist} Epoch: 1 License: LGPLv2+ Group: System Environment/Libraries @@ -17,6 +17,8 @@ Patch0: 0001-Use-correct-type-for-port-in-GVariant-tuple.patch Patch1: 0002-iSCSI-Store-auth-info-in-NodeInfo-tuples.patch Patch2: 0003-iSCSI-turn-iscsi.initiator_set-into-a-property.patch Patch3: 0004-Add-device-symlinks-to-the-PVs-dictionary-for-MD-RAI.patch +Patch4: 0001-Fix-detection-of-macefi-partitions-1393846.patch +Patch5: 0001-Fix-unknown-SAS-device-sysfs-parsing.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -70,6 +72,8 @@ configuration. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 rm -rf %{py3dir} cp -a . %{py3dir} @@ -89,6 +93,10 @@ make PYTHON=%{__python3} DESTDIR=%{buildroot} install %{python3_sitelib}/* %changelog +* Tue Nov 15 2016 David Lehman - 2.1.6-4 +- Fix detection of 'macefi' partitions (#1393846) (awilliam) +- Fix "unknown" SAS device sysfs parsing. (#1394026) (awilliam) + * Mon Nov 07 2016 David Lehman - 2.1.6-3 - Never update POT file as part of rpm build.