diff --git a/0023-parted-fix-build-error-on-s390.patch b/0023-parted-fix-build-error-on-s390.patch new file mode 100644 index 0000000..4b60f19 --- /dev/null +++ b/0023-parted-fix-build-error-on-s390.patch @@ -0,0 +1,143 @@ +From 388bab890a4e09b09d2428c0e773ed083295f91b Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Thu, 29 Oct 2015 21:12:01 +0100 +Subject: [PATCH] parted: fix build error on s390 + +The preceding dasd probing patches have introduced a compile error +when building with blkid support. Fixed by reordering function +definitions. + +Signed-off-by: Colin Watson +Signed-off-by: Viktor Mihajlovski +Signed-off-by: Brian C. Lane +--- + libparted/arch/linux.c | 106 ++++++++++++++++++++++++------------------------- + 1 file changed, 53 insertions(+), 53 deletions(-) + +diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c +index 9344ceb..1198f52 100644 +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -3184,59 +3184,6 @@ linux_disk_commit (PedDisk* disk) + return 1; + } + +-#if defined __s390__ || defined __s390x__ +-/** +- * Check whether this device could be a DASD +- * +- * The device probing yields PED_DEVICE_DASD for native DASD transport +- * If the block device uses a different transport (e.g. virtio) +- * a simplified heuristic (assuming a model 3390 with 4K sectors) +- * is applied (only) on s390x systems for this check. +- * +- * \return 1 if the geometry indicates this could be a DASD +- * and 0 otherwise +- */ +-static int +-_ped_device_like_dasd(const PedDevice *dev) +-{ +- return (dev->type == PED_DEVICE_DASD) +- || (dev->hw_geom.heads == 15 +- && dev->hw_geom.sectors == 12 +- && (dev->hw_geom.cylinders +- * dev->hw_geom.heads +- * dev->hw_geom.sectors +- * dev->phys_sector_size +- == dev->length * dev->sector_size)); +-} +- +- +- +-static PedAlignment* +-s390_get_minimum_alignment(const PedDevice *dev) +-{ +-#if USE_BLKID +- return linux_get_minimum_alignment(dev); +-#else +- return ped_alignment_new(0, +- dev->phys_sector_size +- / dev->sector_size); +-#endif +-} +- +-static PedAlignment* +-s390_get_optimum_alignment(const PedDevice *dev) +-{ +- /* DASD needs to use minimum alignment */ +- if (_ped_device_like_dasd(dev)) +- return s390_get_minimum_alignment(dev); +-#if USE_BLKID +- return linux_get_optimum_alignment(dev); +-#else +- return NULL; +-#endif +-} +-#endif +- + #if USE_BLKID + static PedAlignment* + linux_get_minimum_alignment(const PedDevice *dev) +@@ -3293,6 +3240,59 @@ linux_get_optimum_alignment(const PedDevice *dev) + } + #endif + ++#if defined __s390__ || defined __s390x__ ++/** ++ * Check whether this device could be a DASD ++ * ++ * The device probing yields PED_DEVICE_DASD for native DASD transport ++ * If the block device uses a different transport (e.g. virtio) ++ * a simplified heuristic (assuming a model 3390 with 4K sectors) ++ * is applied (only) on s390x systems for this check. ++ * ++ * \return 1 if the geometry indicates this could be a DASD ++ * and 0 otherwise ++ */ ++static int ++_ped_device_like_dasd(const PedDevice *dev) ++{ ++ return (dev->type == PED_DEVICE_DASD) ++ || (dev->hw_geom.heads == 15 ++ && dev->hw_geom.sectors == 12 ++ && (dev->hw_geom.cylinders ++ * dev->hw_geom.heads ++ * dev->hw_geom.sectors ++ * dev->phys_sector_size ++ == dev->length * dev->sector_size)); ++} ++ ++ ++ ++static PedAlignment* ++s390_get_minimum_alignment(const PedDevice *dev) ++{ ++#if USE_BLKID ++ return linux_get_minimum_alignment(dev); ++#else ++ return ped_alignment_new(0, ++ dev->phys_sector_size ++ / dev->sector_size); ++#endif ++} ++ ++static PedAlignment* ++s390_get_optimum_alignment(const PedDevice *dev) ++{ ++ /* DASD needs to use minimum alignment */ ++ if (_ped_device_like_dasd(dev)) ++ return s390_get_minimum_alignment(dev); ++#if USE_BLKID ++ return linux_get_optimum_alignment(dev); ++#else ++ return NULL; ++#endif ++} ++#endif ++ + static PedDeviceArchOps linux_dev_ops = { + _new: linux_new, + destroy: linux_destroy, +-- +2.4.3 + diff --git a/parted.spec b/parted.spec index dfb39d0..e771fea 100644 --- a/parted.spec +++ b/parted.spec @@ -4,7 +4,7 @@ Summary: The GNU disk partition manipulation program Name: parted Version: 3.2 -Release: 12%{?dist} +Release: 13%{?dist} License: GPLv3+ Group: Applications/System URL: http://www.gnu.org/software/parted @@ -36,6 +36,7 @@ Patch0019: 0019-libparted-Use-read-only-when-probing-devices-on-linu.patch Patch0020: 0020-tests-Use-wait_for_dev_to_-functions.patch Patch0021: 0021-fdasd-geometry-handling-updated-from-upstream-s390-t.patch Patch0022: 0022-dasd-enhance-device-probing.patch +Patch0023: 0023-parted-fix-build-error-on-s390.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: e2fsprogs-devel @@ -178,6 +179,9 @@ fi %changelog +* Thu Oct 29 2015 Brian C. Lane 3.2-13 +- parted: fix build error on s390 + * Tue Oct 27 2015 Brian C. Lane 3.2-12 - dasd: enhance device probing - fdasd: geometry handling updated from upstream s390-tools