diff --git a/0001-linux-Include-sys-sysmacros.h-for-major-macro.patch b/0082-linux-Include-sys-sysmacros.h-for-major-macro.patch similarity index 79% rename from 0001-linux-Include-sys-sysmacros.h-for-major-macro.patch rename to 0082-linux-Include-sys-sysmacros.h-for-major-macro.patch index 1c05bb0..ee09cb5 100644 --- a/0001-linux-Include-sys-sysmacros.h-for-major-macro.patch +++ b/0082-linux-Include-sys-sysmacros.h-for-major-macro.patch @@ -1,7 +1,7 @@ -From 2d572685e56e46fa10ea25c46185a17e38cb156c Mon Sep 17 00:00:00 2001 +From ba5e0451b51c983e40afd123b6e0d3eddb55e610 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 24 Mar 2018 17:37:02 +0000 -Subject: [PATCH] linux: Include for major() macro. +Subject: [PATCH 82/92] linux: Include for major() macro. Since glibc 2.27 this header is required. --- @@ -21,5 +21,5 @@ index 31b98ab..7e86b51 100644 #include #endif -- -2.15.1 +2.17.1 diff --git a/0083-Fix-make-check.patch b/0083-Fix-make-check.patch new file mode 100644 index 0000000..191bbdc --- /dev/null +++ b/0083-Fix-make-check.patch @@ -0,0 +1,63 @@ +From d91acc645ad1204ded41cfecad337bf9c48952f6 Mon Sep 17 00:00:00 2001 +From: Phillip Susi +Date: Fri, 4 May 2018 10:12:05 -0400 +Subject: [PATCH 83/92] Fix make check + +Make check failed due to some warnings treated as errors. One was +caused by a warning that a function could have the noreturn attribute. +It seems that this had previously been disabled but gcc has changed +the flag from -Wmissing-noreturn to -Wsuggest-attribute=noreturn. The +recently added volser.c test also caused a few warnings when not +compiled on s390x because most of the functions were no used, so #if +those out as well. +--- + configure.ac | 2 +- + libparted/tests/volser.c | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 738c697..056478f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -226,7 +226,7 @@ if test "$gl_gcc_warnings" = yes; then + nw="$nw -Wpacked" + nw="$nw -Wmissing-prototypes" + nw="$nw -Wmissing-declarations" +- nw="$nw -Wmissing-noreturn" ++ nw="$nw -Wsuggest-attribute=noreturn" + # things I might fix soon: + nw="$nw -Wfloat-equal" # sort.c, seq.c + nw="$nw -Wmissing-format-attribute" # copy.c +diff --git a/libparted/tests/volser.c b/libparted/tests/volser.c +index 9063821..c6efa5f 100644 +--- a/libparted/tests/volser.c ++++ b/libparted/tests/volser.c +@@ -14,6 +14,8 @@ + #include "common.h" + #include "progname.h" + ++#if defined __s390__ || defined __s390x__ ++ + /* set dasd first */ + static char vol_devno[7] = {0}; + static char *tmp_disk; +@@ -75,7 +77,6 @@ END_TEST + + START_TEST (test_check_volser) + { +- char vol[7] = {0}; + char vol_long[] = "abcdefg"; + char vol_short[] = "ab_c "; + char vol_null[] = " "; +@@ -135,6 +136,8 @@ START_TEST (test_reuse_vtoc) + } + END_TEST + ++#endif ++ + int main (int argc, char **argv) + { + +-- +2.17.1 + diff --git a/0084-tests-fix-t6100-mdraid-partitions.patch b/0084-tests-fix-t6100-mdraid-partitions.patch new file mode 100644 index 0000000..55701c6 --- /dev/null +++ b/0084-tests-fix-t6100-mdraid-partitions.patch @@ -0,0 +1,26 @@ +From ddb9cce8a2ec87cdd9853bdca25c852c7aee8bdf Mon Sep 17 00:00:00 2001 +From: Phillip Susi +Date: Fri, 4 May 2018 10:35:42 -0400 +Subject: [PATCH 84/92] tests: fix t6100-mdraid-partitions + +The test was failing because it didn't wait for the md device +to appear after creating it. +--- + tests/t6100-mdraid-partitions.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/t6100-mdraid-partitions.sh b/tests/t6100-mdraid-partitions.sh +index dbb1686..b37cddf 100755 +--- a/tests/t6100-mdraid-partitions.sh ++++ b/tests/t6100-mdraid-partitions.sh +@@ -47,6 +47,7 @@ cleanup_fn_() { + + # create mdraid on top of both partitions + mdadm -C $md_dev --force -R -l1 -n2 "${scsi_dev}1" "${scsi_dev}2" ++wait_for_dev_to_appear_ ${md_dev} || { fail=1; cat /proc/partitions; } + + # create gpt and two partitions on the raid device + parted -s $md_dev mklabel gpt \ +-- +2.17.1 + diff --git a/0085-Fix-set-and-disk_set-to-not-crash-when-no-flags-are-.patch b/0085-Fix-set-and-disk_set-to-not-crash-when-no-flags-are-.patch new file mode 100644 index 0000000..47d3788 --- /dev/null +++ b/0085-Fix-set-and-disk_set-to-not-crash-when-no-flags-are-.patch @@ -0,0 +1,77 @@ +From 9e196cc2902255c328a90584e44666b79e4344c3 Mon Sep 17 00:00:00 2001 +From: Phillip Susi +Date: Thu, 10 May 2018 12:31:36 -0400 +Subject: [PATCH 85/92] Fix set and disk_set to not crash when no flags are + supported + +Loop labels and file images support no flags. set and disk_set +would prompt for a flag and accept any string since the list of +flags was empty, then fail to look up an actual flag value, then +throw an exception with a null string for the name of the flag, +which would bug. +--- + parted/ui.c | 18 ++++++++++++++++-- + tests/t3310-flags.sh | 13 +++++++++++++ + 3 files changed, 31 insertions(+), 2 deletions(-) + +diff --git a/parted/ui.c b/parted/ui.c +index 752860b..4f42b7c 100644 +--- a/parted/ui.c ++++ b/parted/ui.c +@@ -1150,7 +1150,14 @@ command_line_get_disk_flag (const char* prompt, const PedDisk* disk, + opts = str_list_append_unique (opts, _(walk_name)); + } + } +- ++ if (opts == NULL) ++ { ++ ped_exception_throw (PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_OK, ++ _("No flags supported")); ++ ++ return 0; ++ } + flag_name = command_line_get_word (prompt, NULL, opts, 1); + str_list_destroy (opts); + +@@ -1179,7 +1186,14 @@ command_line_get_part_flag (const char* prompt, const PedPartition* part, + opts = str_list_append_unique (opts, _(walk_name)); + } + } +- ++ if (opts == NULL) ++ { ++ ped_exception_throw (PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_OK, ++ _("No flags supported")); ++ ++ return 0; ++ } + flag_name = command_line_get_word (prompt, NULL, opts, 1); + str_list_destroy (opts); + +diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh +index 2da72d0..0997748 100644 +--- a/tests/t3310-flags.sh ++++ b/tests/t3310-flags.sh +@@ -114,4 +114,17 @@ for table_type in aix amiga atari bsd dvh gpt mac msdos pc98 sun loop; do + done + done + ++# loop filesystems support no flags. Make sure this doesn't crash ++ ++if [ $ss == 512 ]; then ++ # only test on 512 byte ss since mke2fs assumes this on a file ++ truncate -s 5m img || framework_failure ++ mke2fs img || framework_failure ++ echo Error: No flags supported > out.exp ++ parted -s img set 1 foo on > out 2>&1 ++ compare out.exp out || fail=1 ++ parted -s img disk_set foo on > out 2>&1 ++ compare out.exp out || fail=1 ++fi ++ + Exit $fail +-- +2.17.1 + diff --git a/0086-mkpart-Allow-negative-start-value-when-FS-TYPE-is-no.patch b/0086-mkpart-Allow-negative-start-value-when-FS-TYPE-is-no.patch new file mode 100644 index 0000000..a42a080 --- /dev/null +++ b/0086-mkpart-Allow-negative-start-value-when-FS-TYPE-is-no.patch @@ -0,0 +1,122 @@ +From f3b4015e216a3733082e71ff930526f3e8bf0c26 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= +Date: Fri, 11 May 2018 21:09:05 +0200 +Subject: [PATCH 86/92] mkpart: Allow negative start value when FS-TYPE is not + given +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The manual had long documented that negative values are +allowed for both start and end values, but until now negative +start values were rejected if FS-TYPE was not given. + +Example: + + # parted --script -a optimal /dev/loop0 -- mklabel gpt mkpart primary ext4 -5MiB 100% + (succeeds) + + # parted --script -a optimal /dev/loop0 -- mklabel gpt mkpart primary -5MiB 100% + parted: invalid token: -5MiB + Error: Expecting a file system type. + +This commit fixes the latter error. +The issue was an insufficient lookahead in command line parsing, +looking only for digits when skipping over FS-TYPE. +The fix is including the minus '-' in the lookahead. + +Originally reported as Debian bug #880035: + + "parted: fails to use negative start value for 'mkpart' command without specyfying FS-TYPE" + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=880035 + +Signed-off-by: Niklas Hambüchen +--- + parted/parted.c | 2 +- + tests/Makefile.am | 1 + + tests/t0213-mkpart-start-negative.sh | 48 ++++++++++++++++++++++++++++ + 4 files changed, 52 insertions(+), 1 deletion(-) + create mode 100755 tests/t0213-mkpart-start-negative.sh + +diff --git a/parted/parted.c b/parted/parted.c +index b5e3b97..88f32b9 100644 +--- a/parted/parted.c ++++ b/parted/parted.c +@@ -682,7 +682,7 @@ do_mkpart (PedDevice** dev, PedDisk** diskp) + + peek_word = command_line_peek_word (); + if (part_type == PED_PARTITION_EXTENDED +- || (peek_word && isdigit (peek_word[0]))) { ++ || (peek_word && (isdigit (peek_word[0]) || peek_word[0] == '-'))) { + fs_type = NULL; + } else { + if (!command_line_get_fs_type (_("File system type?"), +diff --git a/tests/Makefile.am b/tests/Makefile.am +index a840304..3851983 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -25,6 +25,7 @@ TESTS = \ + t0210-gpt-resized-partition-entry-array.sh \ + t0211-gpt-rewrite-header.sh \ + t0212-gpt-many-partitions.sh \ ++ t0213-mkpart-start-negative.sh \ + t0220-gpt-msftres.sh \ + t0250-gpt.sh \ + t0251-gpt-unicode.sh \ +diff --git a/tests/t0213-mkpart-start-negative.sh b/tests/t0213-mkpart-start-negative.sh +new file mode 100755 +index 0000000..182ef0c +--- /dev/null ++++ b/tests/t0213-mkpart-start-negative.sh +@@ -0,0 +1,48 @@ ++#!/bin/sh ++# Make sure parted mkpart ends the partition one sector before the specified ++# value if end is specified with IEC units. ++ ++# Copyright (C) 2011-2018 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++. "${srcdir=.}/init.sh"; path_prepend_ ../parted ++ ++require_512_byte_sector_size_ ++n_mbs=8 ++dev=dev-file ++ ++dd if=/dev/null of=$dev bs=1M seek=$n_mbs || fail=1 ++# start negative, end positive ++parted --align=none -s $dev -- mklabel gpt mkpart p1 -7MiB 2MiB > err 2>&1 || fail=1 ++compare /dev/null err || fail=1 # expect no output ++ ++# start negative, end negative ++parted --align=none -s $dev -- mkpart p2 -6MiB -5MiB > err 2>&1 || fail=1 ++compare /dev/null err || fail=1 # expect no output ++ ++# check boundaries of the partitions ++parted -m -s $dev u s p > out || fail=1 ++ ++# prepare expected output ++cat < exp || framework_failure ++1:2048s:4095s:2048s::p1:; ++2:4096s:6143s:2048s::p2:; ++EOF ++ ++# compare expected and actual outputs ++sed -e "1,2d" out > k; mv k out ++compare exp out || fail=1 ++ ++Exit $fail +-- +2.17.1 + diff --git a/0087-Fix-resizepart-iec-unit-end-sector.patch b/0087-Fix-resizepart-iec-unit-end-sector.patch new file mode 100644 index 0000000..04fc662 --- /dev/null +++ b/0087-Fix-resizepart-iec-unit-end-sector.patch @@ -0,0 +1,32 @@ +From 247e3fc6cd8bca79b7c0362886ae9b5b06ba6f8c Mon Sep 17 00:00:00 2001 +From: Phillip Susi +Date: Thu, 12 May 2016 21:38:51 -0400 +Subject: [PATCH 87/92] Fix resizepart iec unit end sector + +Fix resizepart to adjust the end to be -1 sector when using iec +power of 2 units so that the next partition can start immediately +following the new end, just like mkpart does. +--- + parted/parted.c | 5 ++++- + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/parted/parted.c b/parted/parted.c +index 88f32b9..267c346 100644 +--- a/parted/parted.c ++++ b/parted/parted.c +@@ -1567,8 +1567,11 @@ do_resizepart (PedDevice** dev, PedDisk** diskp) + + start = part->geom.start; + end = oldend = part->geom.end; +- if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, NULL)) ++ char *end_input; ++ if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, &end_input)) + goto error; ++ _adjust_end_if_iec(&start, &end, range_end, end_input); ++ free(end_input); + /* Do not move start of the partition */ + constraint = constraint_from_start_end_fixed_start (*dev, start, range_end); + if (!ped_disk_set_partition_geom (disk, part, constraint, +-- +2.17.1 + diff --git a/0088-build-Remove-unused-traces-of-dynamic-loading.patch b/0088-build-Remove-unused-traces-of-dynamic-loading.patch new file mode 100644 index 0000000..3629bd8 --- /dev/null +++ b/0088-build-Remove-unused-traces-of-dynamic-loading.patch @@ -0,0 +1,238 @@ +From b49388018931cab220b9dd50f3a2bd51401e48af Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Mon, 21 Sep 2015 12:10:02 +0100 +Subject: [PATCH 88/92] build: Remove unused traces of dynamic loading + +Now that file system operations have been removed from libparted, +libreiserfs is no longer used. Remove references to it, along with the +dynamic loading build infrastructure which was only used for +libreiserfs. + +Signed-off-by: Colin Watson +--- + README | 9 ++---- + configure.ac | 49 -------------------------------- + doc/parted.texi | 15 ---------- + libparted/Makefile.am | 1 - + libparted/fs/reiserfs/reiserfs.c | 16 +---------- + libparted/tests/Makefile.am | 1 - + libparted/tests/t2100-zerolen.sh | 3 -- + parted.spec.in | 3 +- + 8 files changed, 4 insertions(+), 93 deletions(-) + +diff --git a/README b/README +index 3d1fee9..de91d4c 100644 +--- a/README ++++ b/README +@@ -56,10 +56,5 @@ dangerous bugs before they would have done damage, so we think it's worth + it. Also, it means we get more bug reports ;) + + +-(2) When doing dependencies, remember that libreiserfs is a *soft* dependency, +-so I guess that means Debian-look-alikes should do a "suggests", but +-not a "requires". +- +- +-(3) When space is important, we suggest --without-readline, --disable-shared, +-and possibly --disable-nls and --disable-dynamic-loading. ++(2) When space is important, we suggest --without-readline, --disable-shared, ++and possibly --disable-nls. +diff --git a/configure.ac b/configure.ac +index 056478f..8413e06 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -103,20 +103,6 @@ if test "$enable_discover_only" = yes; then + fi + + PARTED_LIBS="" +-AC_ARG_ENABLE([dynamic-loading], +-[ --enable-dynamic-loading support dynamic fs libraries [default=yes]], , +- if test "$enable_discover_only" = yes; then +- enable_dynamic_loading=no +- else +- enable_dynamic_loading=yes +- fi +-) +-if test "$enable_discover_only" = yes \ +- && test "$enable_dynamic_loading" = yes; then +- AC_MSG_ERROR( +-[You can't use --enable-dynamic-loading and --disable-discover-only together] +- ) +-fi + + AC_ARG_ENABLE([debug], + [ --enable-debug compile in assertions [default=yes]], , +@@ -303,23 +289,6 @@ Or install gettext. GNU gettext is available from + ]) + fi + +-dnl Check for libdl, if we are doing dynamic loading +-DL_LIBS="" +-AC_SUBST([DYNAMIC_LOADING]) +-DYNAMIC_LOADING=no +-if test "$enable_dynamic_loading" = yes; then +- AC_CHECK_LIB([dl], [dlopen], +- DL_LIBS="-ldl" +- PARTED_LIBS="$PARTED_LIBS -ldl" +- DYNAMIC_LOADING=yes +- AC_DEFINE([DYNAMIC_LOADING], [1], [Lazy linking to fs libs]), +- AC_MSG_ERROR( +- [-ldl not found! Try using --disable-dynamic-loading] +- ) +- ) +-fi +-AC_SUBST([DL_LIBS]) +- + dnl Check for libuuid + UUID_LIBS="" + AC_CHECK_LIB([uuid], [uuid_generate], [UUID_LIBS="-luuid"], +@@ -357,24 +326,6 @@ if test "$enable_selinux" = yes; then + fi + AC_SUBST([SELINUX_LIBS]) + +-dnl Check for libreiserfs +-REISER_LIBS="" +-if test "$enable_dynamic_loading" = no && test "$enable_discover_only" = no; then +- OLD_LIBS="$LIBS" +- AC_CHECK_LIB([dal], [dal_equals], +- LIBS="-ldal" +- AC_CHECK_LIB([reiserfs], [reiserfs_fs_probe], +- REISER_LIBS="-ldal -lreiserfs" +- AC_DEFINE([HAVE_LIBREISERFS], [1], [Have libreiserfs]) +- ) +- AC_CHECK_LIB([reiserfs], [reiserfs_fs_check], +- AC_DEFINE([HAVE_REISERFS_FS_CHECK], [1], [Have reiserfs_fs_check()]) +- ) +- ) +- LIBS="$OLD_LIBS" +-fi +-AC_SUBST([REISER_LIBS]) +- + dnl Check for termcap + if test "$with_readline" = yes; then + OLD_LIBS="$LIBS" +diff --git a/doc/parted.texi b/doc/parted.texi +index ac23ef6..c08cdc7 100644 +--- a/doc/parted.texi ++++ b/doc/parted.texi +@@ -178,13 +178,6 @@ internationalisation support is desired. + + @uref{ftp://ftp.gnu.org/gnu/gettext} + +-@item libreiserfs, if you want reiserfs support: +- +- @uref{http://reiserfs.osdn.org.ua} +- +-Note that parted will automatically detect libreiserfs at runtime, and enable +-reiserfs support. libreiserfs is new, and hasn't been widely tested yet. +- + @end itemize + + @node Supported Platforms +@@ -242,14 +235,6 @@ etc., where few libraries are available. + @item --disable-debug + don't include assertions + +-@item --disable-dynamic-loading +-disables dynamic loading of some libraries (only libreiserfs for now, +-although we hope to expand this). Dynamic loading is useful because it +-allows you to reuse libparted shared libraries even when you don't know +-if some libraries will be available. It has a small overhead (mainly +-linking with libdl), so it may be useful to disable it on bootdisks if +-you don't need the flexibility. +- + @item --disable-nls + turns off native language support. This is useful for use with old + versions of glibc, or a trimmed down version of glibc suitable for +diff --git a/libparted/Makefile.am b/libparted/Makefile.am +index cb58648..e4a8049 100644 +--- a/libparted/Makefile.am ++++ b/libparted/Makefile.am +@@ -54,7 +54,6 @@ libparted_la_LIBADD = \ + labels/liblabels.la \ + $(top_builddir)/lib/libgnulib.la \ + $(OS_LIBS) \ +- $(DL_LIBS) \ + $(DM_LIBS) \ + $(SELINUX_LIBS) \ + $(LIB_BLKID) \ +diff --git a/libparted/fs/reiserfs/reiserfs.c b/libparted/fs/reiserfs/reiserfs.c +index 2efcdf3..ef809cd 100644 +--- a/libparted/fs/reiserfs/reiserfs.c ++++ b/libparted/fs/reiserfs/reiserfs.c +@@ -1,5 +1,5 @@ + /* +- reiserfs.c -- libparted / libreiserfs glue ++ reiserfs.c -- ReiserFS detection + Copyright (C) 2001-2002, 2007, 2009-2014 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify +@@ -14,17 +14,6 @@ + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +- +- This is all rather complicated. There are a few combinations: +- * shared libraries full support +- * dynamic libraries present full support (via dlopen) +- * dynamic libraries absent (full support disabled) (via dlopen) +- * discover only +- +- We'd love to hear comments... +- +- So far, we've opted for maximum flexibility for the user. Is it +- all worth it? + */ + + #include +@@ -49,9 +38,6 @@ + static PedSector reiserfs_super_offset[] = { 128, 16, -1 }; + static PedFileSystemType* reiserfs_type; + +-#define FPTR +-#define FCLASS extern +- + static PedGeometry *reiserfs_probe(PedGeometry *geom) + { + int i; +diff --git a/libparted/tests/Makefile.am b/libparted/tests/Makefile.am +index 9689fb3..7954e91 100644 +--- a/libparted/tests/Makefile.am ++++ b/libparted/tests/Makefile.am +@@ -35,5 +35,4 @@ $(TEST_LOGS): prereq + TESTS_ENVIRONMENT = \ + top_srcdir='$(top_srcdir)' \ + abs_top_srcdir='$(abs_top_srcdir)' \ +- DYNAMIC_LOADING=$(DYNAMIC_LOADING) \ + ENABLE_DEVICE_MAPPER=$(ENABLE_DEVICE_MAPPER) +diff --git a/libparted/tests/t2100-zerolen.sh b/libparted/tests/t2100-zerolen.sh +index ecd579c..e0e521e 100755 +--- a/libparted/tests/t2100-zerolen.sh ++++ b/libparted/tests/t2100-zerolen.sh +@@ -28,9 +28,6 @@ init_root_dir_ + test "$(uname -s)" = Linux \ + || skip_ "not on Linux" + +-test "x$DYNAMIC_LOADING" = xyes \ +- || skip_ "no dynamic loading support" +- + test "x$ENABLE_DEVICE_MAPPER" = xyes \ + || skip_ "no device-mapper support" + +diff --git a/parted.spec.in b/parted.spec.in +index cd5a99a..bdbe218 100644 +--- a/parted.spec.in ++++ b/parted.spec.in +@@ -60,8 +60,7 @@ Parted library, you need to install this package. + %endif + --enable-part-static \ + --enable-pc98=no \ +- --enable-Werror=no \ +- --disable-dynamic-loading ++ --enable-Werror=no + %{__make} %{?_smp_mflags} + + %install +-- +2.17.1 + diff --git a/0089-Lift-512-byte-restriction-on-fat-resize.patch b/0089-Lift-512-byte-restriction-on-fat-resize.patch new file mode 100644 index 0000000..391a9db --- /dev/null +++ b/0089-Lift-512-byte-restriction-on-fat-resize.patch @@ -0,0 +1,52 @@ +From 4347ddb8e2dd01674c759e94eaaf5872915a2e48 Mon Sep 17 00:00:00 2001 +From: Phillip Susi +Date: Fri, 4 May 2018 10:57:56 -0400 +Subject: [PATCH 89/92] Lift 512 byte restriction on fat resize + +As Colin Watson pointed out way back in 2014, when I removed the +512 byte sector size restriction from the fs recognition code, +I missed the same from the fat resize code. +--- + NEWS | 2 ++ + libparted/fs/r/fat/bootsector.c | 12 ------------ + 2 files changed, 2 insertions(+), 12 deletions(-) + +diff --git a/NEWS b/NEWS +index 83352a6..552e319 100644 +--- a/NEWS ++++ b/NEWS +@@ -45,6 +45,8 @@ GNU parted NEWS -*- outline -*- + + ** New Features + ++ libparted-fs-resize: Work on non 512 byte sectors. ++ + Add resizepart command to resize a partition. This works even on + mounted partitions. + +diff --git a/libparted/fs/r/fat/bootsector.c b/libparted/fs/r/fat/bootsector.c +index 99d788d..3e34e13 100644 +--- a/libparted/fs/r/fat/bootsector.c ++++ b/libparted/fs/r/fat/bootsector.c +@@ -125,18 +125,6 @@ fat_boot_sector_analyse (FatBootSector* bs, PedFileSystem* fs) + + PED_ASSERT (bs != NULL); + +- if (PED_LE16_TO_CPU (bs->sector_size) != 512) { +- if (ped_exception_throw ( +- PED_EXCEPTION_BUG, +- PED_EXCEPTION_IGNORE_CANCEL, +- _("This file system has a logical sector size of %d. " +- "GNU Parted is known not to work properly with sector " +- "sizes other than 512 bytes."), +- (int) PED_LE16_TO_CPU (bs->sector_size)) +- != PED_EXCEPTION_IGNORE) +- return 0; +- } +- + fs_info->logical_sector_size = PED_LE16_TO_CPU (bs->sector_size) / 512; + + fs_info->sectors_per_track = PED_LE16_TO_CPU (bs->secs_track); +-- +2.17.1 + diff --git a/0090-Fix-atari-label-false-positives.patch b/0090-Fix-atari-label-false-positives.patch new file mode 100644 index 0000000..054300b --- /dev/null +++ b/0090-Fix-atari-label-false-positives.patch @@ -0,0 +1,41 @@ +From 395f8aabfecb28820006d37ec37e9ffe1d2eb1e3 Mon Sep 17 00:00:00 2001 +From: Phillip Susi +Date: Fri, 11 May 2018 11:01:01 -0400 +Subject: [PATCH 90/92] Fix atari label false positives + +The atari label gets false positives easily, so probe it after +all other labels have said no. +--- + libparted/libparted.c | 4 ++-- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/libparted/libparted.c b/libparted/libparted.c +index d855d0e..3bd071d 100644 +--- a/libparted/libparted.c ++++ b/libparted/libparted.c +@@ -80,12 +80,13 @@ extern void ped_disk_atari_init (); + static void + init_disk_types () + { ++ /* Note that probing is done in the reverse order of init */ + ped_disk_loop_init (); /* must be last in the probe list */ + + #if defined __s390__ || defined __s390x__ + ped_disk_dasd_init(); + #endif +- ++ ped_disk_atari_init (); /* easy false positives, so probe others first */ + ped_disk_sun_init (); + #ifdef ENABLE_PC98 + ped_disk_pc98_init (); +@@ -97,7 +98,6 @@ init_disk_types () + ped_disk_bsd_init (); + ped_disk_amiga_init (); + ped_disk_aix_init (); +- ped_disk_atari_init (); + } + + extern void ped_file_system_amiga_init (void); +-- +2.17.1 + diff --git a/0091-Modify-gpt-header-move-and-msdos-overlap-to-work-wit.patch b/0091-Modify-gpt-header-move-and-msdos-overlap-to-work-wit.patch new file mode 100644 index 0000000..e3ddd84 --- /dev/null +++ b/0091-Modify-gpt-header-move-and-msdos-overlap-to-work-wit.patch @@ -0,0 +1,87 @@ +From a0494446d44f00fbd47c1081186678d26c331a51 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Wed, 27 Jun 2018 13:45:09 -0700 +Subject: [PATCH 91/92] Modify gpt-header-move and msdos-overlap to work with + py2 or py3 + +Distributions are starting to remove python2 and only use python3. +Modify these test scripts so that they will work with either python 2.7 +or python 3.X +--- + tests/gpt-header-move | 15 ++++++++------- + tests/msdos-overlap | 5 ++--- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/tests/gpt-header-move b/tests/gpt-header-move +index 05cdc65..3dda5cb 100755 +--- a/tests/gpt-header-move ++++ b/tests/gpt-header-move +@@ -3,20 +3,21 @@ + # open img file, subtract 33 from altlba address, and move the last 33 sectors + # back by 33 sectors + +-from struct import * ++from struct import unpack_from, pack_into + from zipfile import crc32 + import array + import sys ++ + file = open(sys.argv[1],'rb+') + file.seek(512) + gptheader = file.read(512) +-altlba = unpack_from('" ++ print("%s: " % sys.argv[0]) + sys.exit(1) + +-data = "".join(chr(c) for c in BAD_ENTRY) + with open(sys.argv[1], "rb+") as f: + f.seek(OFFSET, 0) +- f.write(data) ++ f.write(bytes(BAD_ENTRY)) + + sys.exit(0) +-- +2.17.1 + diff --git a/0092-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch b/0092-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch new file mode 100644 index 0000000..536414d --- /dev/null +++ b/0092-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch @@ -0,0 +1,33 @@ +From f37716966aaa5bde3b2636249944e9cdfdf2f82a Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Wed, 27 Jun 2018 13:47:33 -0700 +Subject: [PATCH 92/92] Switch gpt-header-move and msdos-overlap to python3 + +--- + tests/gpt-header-move | 2 +- + tests/msdos-overlap | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/gpt-header-move b/tests/gpt-header-move +index 3dda5cb..18f58d0 100755 +--- a/tests/gpt-header-move ++++ b/tests/gpt-header-move +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + + # open img file, subtract 33 from altlba address, and move the last 33 sectors + # back by 33 sectors +diff --git a/tests/msdos-overlap b/tests/msdos-overlap +index 48cfa7f..4f48005 100755 +--- a/tests/msdos-overlap ++++ b/tests/msdos-overlap +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + """ + Write an overlapping partition to a msdos disk + +-- +2.17.1 + diff --git a/parted.spec b/parted.spec index c899a20..2cda8c8 100644 --- a/parted.spec +++ b/parted.spec @@ -4,7 +4,7 @@ Summary: The GNU disk partition manipulation program Name: parted Version: 3.2 -Release: 33%{?dist} +Release: 34%{?dist} License: GPLv3+ Group: Applications/System URL: http://www.gnu.org/software/parted @@ -95,10 +95,21 @@ Patch0078: 0078-libparted-Fix-udev-cookie-leak-in-_dm_resize_partiti.patch Patch0079: 0079-atari.c-Drop-xlocale.h-1476934.patch Patch0080: 0080-libparted-labels-link-with-libiconv-if-needed.patch Patch0081: 0081-Add-support-for-NVDIMM-devices.patch +Patch0082: 0082-linux-Include-sys-sysmacros.h-for-major-macro.patch +Patch0083: 0083-Fix-make-check.patch +Patch0084: 0084-tests-fix-t6100-mdraid-partitions.patch +Patch0085: 0085-Fix-set-and-disk_set-to-not-crash-when-no-flags-are-.patch +Patch0086: 0086-mkpart-Allow-negative-start-value-when-FS-TYPE-is-no.patch +Patch0087: 0087-Fix-resizepart-iec-unit-end-sector.patch +Patch0088: 0088-build-Remove-unused-traces-of-dynamic-loading.patch +Patch0089: 0089-Lift-512-byte-restriction-on-fat-resize.patch +Patch0090: 0090-Fix-atari-label-false-positives.patch + +# Use python3 in the buildroot +# Sent upstream 2018-06-27 +Patch0091: 0091-Modify-gpt-header-move-and-msdos-overlap-to-work-wit.patch +Patch0092: 0092-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch -# Fix for missing major/minor() macros in glibc 2.27. -# Sent upstream 2018-03-24. -Patch0099: 0001-linux-Include-sys-sysmacros.h-for-major-macro.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -120,8 +131,9 @@ BuildRequires: xfsprogs BuildRequires: dosfstools BuildRequires: perl-Digest-CRC BuildRequires: bc -Buildrequires: python2 +Buildrequires: python3 BuildRequires: gperf +BuildRequires: make Requires(post): /sbin/ldconfig Requires(post): /sbin/install-info @@ -235,6 +247,21 @@ fi %changelog +* Wed Jun 27 2018 Brian C. Lane - 3.2-34 +- Use python3 in buildroot +- Add make to BuildRequires +- Switch gpt-header-move and msdos-overlap to python3 (bcl) +- Modify gpt-header-move and msdos-overlap to work with py2 or py3 (bcl) +- Fix atari label false positives (psusi) +- Lift 512 byte restriction on fat resize (psusi) +- build: Remove unused traces of dynamic loading (cjwatson) +- Fix resizepart iec unit end sector (psusi) +- mkpart: Allow negative start value when FS-TYPE is not given (mail) +- Fix set and disk_set to not crash when no flags are supported (psusi) +- tests: fix t6100-mdraid-partitions (psusi) +- Fix make check (psusi) +- linux: Include for major() macro. (rjones) + * Thu Jun 07 2018 Brian C. Lane - 3.2-33 - Use gpg2 for signature checking @@ -243,7 +270,7 @@ fi * Mon Feb 19 2018 Brian C. Lane - 3.2-31 - Add gcc BuildRequires for future minimal buildroot support -- Remove %clean section +- Remove %%clean section * Thu Feb 08 2018 Fedora Release Engineering - 3.2-30 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild