- Cleanup library path usage in specfile

pkgconfig wasn't finding libparted.pc because it was under /usr/lib64/
- Explicitly reference the library files instead of use wildcards.
- Move libparted-fs-resize.so to the -devel package where it belongs.
- Add a pkgconfig file for the filesystem resize library
- tests: Add udevadm settle to wait_for_ loop
- tests: Add wait to t9042
- tests: Fix t1700 failing on a host with a 4k xfs file
This commit is contained in:
Brian C. Lane 2016-02-29 12:01:52 -08:00
parent ed6adbba63
commit e0ee88ed50
5 changed files with 297 additions and 15 deletions

View File

@ -0,0 +1,67 @@
From 151dd81cd1e86c1329488a892fa5df38aae132f5 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Mon, 29 Feb 2016 11:34:31 -0800
Subject: [PATCH 25/28] Add libparted-fs-resize.pc
Add a pkgconfig file for the filesystem resize library.
(cherry picked from commit 56ede67e254132eba72b0c3e74b7b3677c22782d)
---
Makefile.am | 3 ++-
configure.ac | 1 +
libparted-fs-resize.pc.in | 10 ++++++++++
3 files changed, 13 insertions(+), 1 deletion(-)
create mode 100644 libparted-fs-resize.pc.in
diff --git a/Makefile.am b/Makefile.am
index 686b61c..c426b8c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,6 +6,7 @@ EXTRA_DIST = \
.prev-version \
BUGS \
libparted.pc.in \
+ libparted-fs-resize.pc.in \
parted.spec.in \
parted.spec \
scripts/data/abi/baseline_symbols.txt \
@@ -18,7 +19,7 @@ EXTRA_DIST = \
aclocaldir=$(datadir)/aclocal
pcdir = $(libdir)/pkgconfig
-pc_DATA = libparted.pc
+pc_DATA = libparted.pc libparted-fs-resize.pc
# This is best not done via configure.ac, because automake's
# make distcheck target does not like auto-generated files
diff --git a/configure.ac b/configure.ac
index 436d0e2..3d57157 100644
--- a/configure.ac
+++ b/configure.ac
@@ -613,6 +613,7 @@ libparted/labels/Makefile
libparted/fs/Makefile
libparted/tests/Makefile
libparted.pc
+libparted-fs-resize.pc
parted/Makefile
partprobe/Makefile
doc/Makefile
diff --git a/libparted-fs-resize.pc.in b/libparted-fs-resize.pc.in
new file mode 100644
index 0000000..ed9b3d6
--- /dev/null
+++ b/libparted-fs-resize.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libparted-fs-resize
+Description: The GNU Parted filesystem resize shared library
+Version: @VERSION@
+Libs: -L${libdir} -lparted-fs-resize
+Cflags: -I${includedir}
--
2.5.0

View File

@ -0,0 +1,119 @@
From 889e484922d3d5df300718ca229e12e5601e774a Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Tue, 1 Mar 2016 10:38:26 -0800
Subject: [PATCH 26/28] tests: Add udevadm settle to wait_for_ loop (#1260664)
Sometimes the device will vanish after the wait_for_dev_to_appear exits.
Add udevadm settle in an attempt to make sure the udev system is done
flapping around and the device will stay in place.
Related: rhbz#1260664
---
tests/t-lib-helpers.sh | 2 ++
tests/t-local.sh | 2 ++
tests/t6001-psep.sh | 2 ++
tests/t6004-dm-many-partitions.sh | 1 +
tests/t6005-dm-uuid.sh | 2 ++
tests/t6100-mdraid-partitions.sh | 1 +
6 files changed, 10 insertions(+)
diff --git a/tests/t-lib-helpers.sh b/tests/t-lib-helpers.sh
index 4e83a05..298f1fc 100644
--- a/tests/t-lib-helpers.sh
+++ b/tests/t-lib-helpers.sh
@@ -371,6 +371,7 @@ wait_for_dev_to_appear_()
local i=0
local incr=1
while :; do
+ udevadm settle
ls "$file" > /dev/null 2>&1 && return 0
sleep .1 2>/dev/null || { sleep 1; incr=10; }
i=$(expr $i + $incr); test $i = 20 && break
@@ -386,6 +387,7 @@ wait_for_dev_to_disappear_()
local i=0
local incr=1
while :; do
+ udevadm settle
ls "$file" > /dev/null 2>&1 || return 0
sleep .1 2>/dev/null || { sleep 1; incr=10; }
i=$(expr $i + $incr); test $i -ge $(expr $n_sec \* 10) && break
diff --git a/tests/t-local.sh b/tests/t-local.sh
index b40a5a0..a7d5226 100644
--- a/tests/t-local.sh
+++ b/tests/t-local.sh
@@ -47,6 +47,7 @@ wait_for_dev_to_appear_()
local i=0
local incr=1
while :; do
+ udevadm settle
ls "$file" > /dev/null 2>&1 && return 0
sleep .1 2>/dev/null || { sleep 1; incr=10; }
i=$(expr $i + $incr); test $i = 20 && break
@@ -110,6 +111,7 @@ scsi_debug_setup_()
local i=0
local new_dev
while :; do
+ udevadm settle
new_dev=$(new_sdX_) && break
sleep .1 2>/dev/null || { sleep 1; incr=10; }
i=$(expr $i + $incr); test $i = 20 && break
diff --git a/tests/t6001-psep.sh b/tests/t6001-psep.sh
index 4c758e8..2985cf5 100644
--- a/tests/t6001-psep.sh
+++ b/tests/t6001-psep.sh
@@ -19,6 +19,8 @@
. "${srcdir=.}/init.sh"; path_prepend_ ../parted
require_root_
+require_udevadm_settle_
+
(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed"
# Device maps names - should be random to not conflict with existing ones on
diff --git a/tests/t6004-dm-many-partitions.sh b/tests/t6004-dm-many-partitions.sh
index 7ebc48a..01d7fc0 100755
--- a/tests/t6004-dm-many-partitions.sh
+++ b/tests/t6004-dm-many-partitions.sh
@@ -20,6 +20,7 @@
. "${srcdir=.}/init.sh"; path_prepend_ ../parted
require_root_
+require_udevadm_settle_
(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed"
ss=$sector_size_
diff --git a/tests/t6005-dm-uuid.sh b/tests/t6005-dm-uuid.sh
index ce1251a..a48ae72 100755
--- a/tests/t6005-dm-uuid.sh
+++ b/tests/t6005-dm-uuid.sh
@@ -20,6 +20,7 @@
. "${srcdir=.}/init.sh"; path_prepend_ ../parted
require_root_
+require_udevadm_settle_
(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed"
ss=$sector_size_
@@ -46,6 +47,7 @@ for ((i=1; i<=$n_partitions; i+=1)); do
cmd="$cmd mkpart p$i ${s}s ${s}s"
done
parted -m -a min -s /dev/mapper/$dm_name mklabel gpt $cmd > /dev/null 2>&1 || fail=1
+wait_for_dev_to_appear_ /dev/mapper/${dm_name}p${n_partitions} || fail=1
# Make sure all the partitions have UUIDs
for ((i=1; i<=$n_partitions; i+=1)); do
diff --git a/tests/t6100-mdraid-partitions.sh b/tests/t6100-mdraid-partitions.sh
index dbc5986..dbb1686 100755
--- a/tests/t6100-mdraid-partitions.sh
+++ b/tests/t6100-mdraid-partitions.sh
@@ -38,6 +38,7 @@ parted -s "$scsi_dev" mklabel gpt \
mkpart p1 ext2 1M 4M \
mkpart p2 ext2 5M 8M > out 2>&1 || fail=1
compare /dev/null out || fail=1
+wait_for_dev_to_appear_ ${scsi_dev}2 || { fail=1; cat /proc/partitions; }
cleanup_fn_() {
# stop mdraid array
--
2.5.0

View File

@ -0,0 +1,31 @@
From 91c2993edc47f590f1d3199976c970768fd6964c Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Tue, 1 Mar 2016 13:51:54 -0800
Subject: [PATCH 27/28] tests: Add wait to t9042 (#1257415)
Also make the new disklabel and first partition all in one step to
prevent udev problems.
Resolves: rhbz#1257415
---
tests/t9042-dos-partition-limit.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/t9042-dos-partition-limit.sh b/tests/t9042-dos-partition-limit.sh
index b01828c..1a69384 100644
--- a/tests/t9042-dos-partition-limit.sh
+++ b/tests/t9042-dos-partition-limit.sh
@@ -44,8 +44,8 @@ printf '%s\n' "BYT;" \
"1:$((start-2))s:$((n-1))s:$((n-start+2))s:::lba;" \
> exp || fail=1
-parted -s $scsi_dev mklabel msdos || fail=1
-parted -s -a min $scsi_dev mkpart extended $((start-2))s 100% || fail=1
+parted -s -a min $scsi_dev mklabel msdos mkpart extended $((start-2))s 100% || fail=1
+wait_for_dev_to_appear_ ${scsi_dev}1 || fail=1
i=1
while :; do
--
2.5.0

View File

@ -0,0 +1,56 @@
From 1fc0439a5bd27697fb5daa911f776de4a69e0ca3 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Mon, 29 Feb 2016 14:31:35 -0800
Subject: [PATCH 28/28] tests: Fix t1700 failing on a host with a 4k xfs
filesystem (#1260664)
The problem is that mkfs.xfs won't work if the file it is trying to
create is on a filesystem with a sector size larger than the passed
-ssize value. So a host with 4k disks (eg. s390) and the xfs filesystem
will fail with the error message:
illegal sector size 512; hw sector is 4096
Failures setting up the environment for the test aren't parted bugs.
This stops treating mkfs and dd errors as test failures, skipping the fs
and logging a warning.
Related: rhbz#1260664
---
tests/t1700-probe-fs.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/t1700-probe-fs.sh b/tests/t1700-probe-fs.sh
index 94ed9ae..b13cec0 100755
--- a/tests/t1700-probe-fs.sh
+++ b/tests/t1700-probe-fs.sh
@@ -39,13 +39,13 @@ for type in ext2 ext3 ext4 btrfs xfs nilfs2 ntfs vfat hfsplus; do
hfsplus) fsname=hfs+;;
esac
- # create an $type file system
+ # create an $type file system, creation failures are not parted bugs,
+ # skip the filesystem instead of failing the test.
if [ "$type" = "xfs" ]; then
- # Work around a problem with s390
- mkfs.xfs -ssize=$ss -dfile,name=$dev,size=${n_sectors}s || fail=1
+ mkfs.xfs -ssize=$ss -dfile,name=$dev,size=${n_sectors}s || { warn_ "$ME: mkfs.$type failed, skipping"; continue; }
else
- dd if=/dev/null of=$dev bs=$ss seek=$n_sectors >/dev/null || fail=1
- mkfs.$type $force $dev || { warn_ $ME: mkfs.$type failed; fail=1; continue; }
+ dd if=/dev/null of=$dev bs=$ss seek=$n_sectors >/dev/null || { warn_ "$ME: dd failed, skipping $type"; continue; }
+ mkfs.$type $force $dev || { warn_ "$ME: mkfs.$type failed skipping"; continue; }
fi
# probe the $type file system
@@ -57,7 +57,7 @@ done
# Some features should indicate ext4 by themselves.
for feature in uninit_bg flex_bg; do
# create an ext3 file system
- dd if=/dev/null of=$dev bs=1024 seek=4096 >/dev/null || fail=1
+ dd if=/dev/null of=$dev bs=1024 seek=4096 >/dev/null || skip_ "dd failed"
mkfs.ext3 -F $dev >/dev/null || skip_ "mkfs.ext3 failed"
# set the feature
--
2.5.0

View File

@ -4,7 +4,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 3.2
Release: 15%{?dist}
Release: 16%{?dist}
License: GPLv3+
Group: Applications/System
URL: http://www.gnu.org/software/parted
@ -38,6 +38,11 @@ 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
Patch0024: 0024-fdasd.c-Safeguard-against-geometry-misprobing.patch
Patch0025: 0025-Add-libparted-fs-resize.pc.patch
Patch0026: 0026-tests-Add-udevadm-settle-to-wait_for_-loop-1260664.patch
Patch0027: 0027-tests-Add-wait-to-t9042-1257415.patch
Patch0028: 0028-tests-Fix-t1700-failing-on-a-host-with-a-4k-xfs-file.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: e2fsprogs-devel
@ -116,16 +121,6 @@ V=1 %{__make} %{?_smp_mflags}
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
# Move devel package components in to the correct location
%{__mkdir} -p %{buildroot}%{_exec_prefix}/%{_lib}
%{__mv} %{buildroot}%{_libdir}/libparted.so %{buildroot}%{_exec_prefix}/%{_lib}
%{__mv} %{buildroot}%{_libdir}/pkgconfig %{buildroot}%{_exec_prefix}/%{_lib}
pushd %{buildroot}%{_exec_prefix}/%{_lib}
reallibrary="$(readlink libparted.so)"
%{__rm} -f libparted.so
ln -sf ../../%{_lib}/${reallibrary} libparted.so
popd
# Remove components we do not ship
%{__rm} -rf %{buildroot}%{_libdir}/*.la
%{__rm} -rf %{buildroot}%{_infodir}/dir
@ -167,19 +162,33 @@ fi
%{_sbindir}/partprobe
%{_mandir}/man8/parted.8.gz
%{_mandir}/man8/partprobe.8.gz
%{_libdir}/libparted.so.*
%{_libdir}/libparted-fs-resize.so*
%{_libdir}/libparted.so.2
%{_libdir}/libparted.so.2.0.1
%{_libdir}/libparted-fs-resize.so.0
%{_libdir}/libparted-fs-resize.so.0.0.1
%{_infodir}/parted.info.gz
%files devel
%defattr(-,root,root,-)
%doc TODO doc/API doc/FAT
%{_includedir}/parted
%{_exec_prefix}/%{_lib}/libparted.so
%{_exec_prefix}/%{_lib}/pkgconfig/libparted.pc
%{_libdir}/libparted.so
%{_libdir}/libparted-fs-resize.so
%{_libdir}/pkgconfig/libparted.pc
%{_libdir}/pkgconfig/libparted-fs-resize.pc
%changelog
* Mon Feb 29 2016 Brian C. Lane <bcl@redhat.com> 3.2-16
- Cleanup library path usage in specfile
pkgconfig wasn't finding libparted.pc because it was under /usr/lib64/
- Explicitly reference the library files instead of use wildcards.
- Move libparted-fs-resize.so to the -devel package where it belongs.
- Add a pkgconfig file for the filesystem resize library
- tests: Add udevadm settle to wait_for_ loop
- tests: Add wait to t9042
- tests: Fix t1700 failing on a host with a 4k xfs file
* Tue Feb 09 2016 Brian C. Lane <bcl@redhat.com> 3.2-15
- fdasd.c Safeguard against geometry misprobing.patch (#1305931)