diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 38e06af..ad40058 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,20 @@ clog /parted-3.1.90.tar.xz.sig /parted-3.2.tar.xz /parted-3.2.tar.xz.sig +/parted-3.2.153.tar.xz +/parted-3.2.153.tar.xz.sig +/parted-3.3.tar.xz +/parted-3.3.tar.xz.sig +/parted-3.3.52.tar.xz +/parted-3.3.52.tar.xz.sig +/parted-3.4.tar.xz +/parted-3.4.tar.xz.sig +/parted-3.4.64.tar.xz +/parted-3.4.64.tar.xz.sig +/parted-3.5.tar.xz +/parted-3.5.tar.xz.sig +/parted-3.5.28.tar.xz +/parted-3.5.28.tar.xz.sig +/parted-3.6.tar.xz +/parted-3.6.tar.xz.sig +/parted-3.6.tar.xz.sug diff --git a/0001-parted-Print-the-Fixing.-message-to-stderr.patch b/0001-parted-Print-the-Fixing.-message-to-stderr.patch new file mode 100644 index 0000000..bfc90de --- /dev/null +++ b/0001-parted-Print-the-Fixing.-message-to-stderr.patch @@ -0,0 +1,28 @@ +From fc16e90a9fd64e2db12a815417b538b193fe48db Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Wed, 10 Jul 2024 15:41:16 -0700 +Subject: [PATCH 1/2] parted: Print the Fixing... message to stderr + +Otherwise it messes up stdout of things like --json + +Thanks to Mikael Q for reporting this. +--- + parted/ui.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parted/ui.c b/parted/ui.c +index 33a1808..d6d1da4 100644 +--- a/parted/ui.c ++++ b/parted/ui.c +@@ -645,7 +645,7 @@ exception_handler (PedException* ex) + /* script-mode and fix? */ + int fix_is_an_option = (ex->options & PED_EXCEPTION_FIX); + if (opt_script_mode && opt_fix_mode && fix_is_an_option) { +- printf ("Fixing, due to --fix\n"); ++ fprintf (stderr, "Fixing, due to --fix\n"); + return PED_EXCEPTION_FIX; + } + +-- +2.45.2 + diff --git a/0001-tests-Try-several-UTF8-locales.patch b/0001-tests-Try-several-UTF8-locales.patch deleted file mode 100644 index e19cce2..0000000 --- a/0001-tests-Try-several-UTF8-locales.patch +++ /dev/null @@ -1,45 +0,0 @@ -From e73c27f435017e22a68383255f15ebaa562dd414 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Wed, 13 Aug 2014 13:40:28 -0700 -Subject: [PATCH] tests: Try several UTF8 locales - -Not all distributions (Fedora) have C.UTF-8 so try several (en_US, de_DE, -fr_FR, es_ES). This may still fail if none exist. - -* tests/t0251-gpt-unicode.sh: Test for en_US de_DE fr_FR es_ES ---- - tests/t0251-gpt-unicode.sh | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/tests/t0251-gpt-unicode.sh b/tests/t0251-gpt-unicode.sh -index c845950..537aaa1 100755 ---- a/tests/t0251-gpt-unicode.sh -+++ b/tests/t0251-gpt-unicode.sh -@@ -22,7 +22,23 @@ dev=loop-file - # create zeroed device - truncate -s 10m $dev || fail=1 - --export LC_ALL=C.UTF-8 -+found_locale=no -+for locale in en_US de_DE fr_FR es_ES -+do -+ LC_ALL="$locale.utf8" -+ -+ # In a UTF-8 locale, the string below prints as 4 characters. -+ if [ `printf 'foo\341\264\244' | wc -m` -eq 4 ]; then -+ found_locale=yes -+ break -+ fi -+done -+ -+if [ "$found_locale" != "yes" ]; then -+ echo "no valid UTF-8 locale found; skipping" >&2 -+ exit 77 -+fi -+ - # create gpt label with named partition - part_name=$(printf 'foo\341\264\244') - parted -s $dev mklabel gpt mkpart primary ext2 1MiB 2MiB name 1 $part_name > empty 2>&1 || fail=1 --- -1.9.3 - diff --git a/0002-doc-Document-IEC-unit-behavior-in-the-manpage.patch b/0002-doc-Document-IEC-unit-behavior-in-the-manpage.patch new file mode 100644 index 0000000..09f116f --- /dev/null +++ b/0002-doc-Document-IEC-unit-behavior-in-the-manpage.patch @@ -0,0 +1,37 @@ +From e34c1477cfa446f1b44287b10425a9e69602b519 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Fri, 12 Jul 2024 16:24:58 -0700 +Subject: [PATCH 2/2] doc: Document IEC unit behavior in the manpage + +Previously this has only been documented in the info page. +--- + doc/C/parted.8 | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/doc/C/parted.8 b/doc/C/parted.8 +index 3069c33..171269c 100644 +--- a/doc/C/parted.8 ++++ b/doc/C/parted.8 +@@ -151,6 +151,19 @@ Toggle the state of the disk \fIflag\fP. + .B version + Display version information and a copyright message. + .RE ++.SH UNITS ++\fBparted\fP will compute sensible ranges for the locations you specify when using ++units like "GB", "MB", etc. Use the sector unit "s" or IEC binary units like ++"GiB", "MiB", to specify exact locations. ++ ++When you specify start or end values using IEC binary units like "MiB", ++"GiB", "TiB", etc., \fBparted\fP treats those values as exact, and equivalent to ++the same number specified in bytes (i.e., with the "B" suffix), in that it ++provides no helpful range of sloppiness. Contrast that with a partition ++start request of "4GB", which may actually resolve to some sector up to 500MB ++before or after that point. Thus, when creating a partition in an exact location ++you should use units of bytes ("B"), sectors ("s"), or IEC binary units like ++"MiB", "GiB", but not "MB", "GB", etc. + .SH REPORTING BUGS + Report bugs to + .SH SEE ALSO +-- +2.45.2 + diff --git a/0002-maint-post-release-administrivia.patch b/0002-maint-post-release-administrivia.patch deleted file mode 100644 index 8d2a23a..0000000 --- a/0002-maint-post-release-administrivia.patch +++ /dev/null @@ -1,50 +0,0 @@ -From f1cdf08806caf7d71779a5fe67af797c8e3ab09e Mon Sep 17 00:00:00 2001 -From: Phillip Susi -Date: Mon, 28 Jul 2014 23:19:51 -0400 -Subject: [PATCH 2/6] maint: post-release administrivia - -* NEWS: Add header line for next release. -* .prev-version: Record previous version. -* cfg.mk (old_NEWS_hash): Auto-update. ---- - .prev-version | 2 +- - NEWS | 3 +++ - cfg.mk | 2 +- - 3 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/.prev-version b/.prev-version -index 8c50098..a3ec5a4 100644 ---- a/.prev-version -+++ b/.prev-version -@@ -1 +1 @@ --3.1 -+3.2 -diff --git a/NEWS b/NEWS -index 49c8129..297b0a5 100644 ---- a/NEWS -+++ b/NEWS -@@ -1,5 +1,8 @@ - GNU parted NEWS -*- outline -*- - -+* Noteworthy changes in release ?.? (????-??-??) [?] -+ -+ - * Noteworthy changes in release 3.2 (2014-07-28) [stable] - - ** New Features -diff --git a/cfg.mk b/cfg.mk -index ade72d7..62a02b6 100644 ---- a/cfg.mk -+++ b/cfg.mk -@@ -43,7 +43,7 @@ local-checks-to-skip = \ - # Now that we have better (check.mk) tests, make this the default. - export VERBOSE = yes - --old_NEWS_hash = bd453bcf049e292a9677c094d24a29dd -+old_NEWS_hash = 85f2e93c40425e202491675d97e40166 - - include $(srcdir)/dist-check.mk - --- -1.9.3 - diff --git a/0003-libparted-Fail-early-when-detecting-nilfs2.patch b/0003-libparted-Fail-early-when-detecting-nilfs2.patch new file mode 100644 index 0000000..b9675bb --- /dev/null +++ b/0003-libparted-Fail-early-when-detecting-nilfs2.patch @@ -0,0 +1,55 @@ +From 8623f65e1fd064a679f75e3e075dff86f30282a7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Old=C5=99ich=20Jedli=C4=8Dka?= +Date: Sat, 6 Apr 2024 19:21:11 +0200 +Subject: [PATCH] libparted: Fail early when detecting nilfs2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When the disk is encrypted with TCG Opal HW encryption (supported by +cryptsetup 2.7.0+), the partition initially contains locked area, which +shows reading errors in kernel logs and may lead to configuring the disk +to work with lower reading speed. When the disk area is unlocked with +password, the reading succeeds. The beginning of the protected partition is +not locked and contains LUKS header, this is always readable. + +To work around the errors when reading from the locked area, try first +detecting nilfs2 at the beginning (may be an unprotected LUKS header area) +and only check the second superblock that is at the end of the area (and +possibly locked) if the first one is valid (meaning the partition is not +LUKS-protected). + +This is a change in behavior, but is consistent with the nilfs2 code, which +considers both superblocks mandatory, see [1]. + +[1] https://github.com/nilfs-dev/nilfs-utils/blob/master/lib/sb.c#L135-L158 + +Signed-off-by: Oldřich Jedlička +Signed-off-by: Brian C. Lane +--- + libparted/fs/nilfs2/nilfs2.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/libparted/fs/nilfs2/nilfs2.c b/libparted/fs/nilfs2/nilfs2.c +index 6204542..40f8567 100644 +--- a/libparted/fs/nilfs2/nilfs2.c ++++ b/libparted/fs/nilfs2/nilfs2.c +@@ -118,11 +118,12 @@ nilfs2_probe (PedGeometry* geom) + + if (ped_geometry_read(geom, buf, 0, sectors)) + sb = (struct nilfs2_super_block*)(buf + 1024); ++ if (!sb || !is_valid_nilfs_sb(sb)) ++ return NULL; ++ + if (ped_geometry_read(geom, buff2, sb2off, sectors2)) + sb2 = (struct nilfs2_super_block*)buff2; +- +- if ((!sb || !is_valid_nilfs_sb(sb)) && +- (!sb2 || !is_valid_nilfs_sb(sb2))) ++ if (!sb2 || !is_valid_nilfs_sb(sb2)) + return NULL; + + /* reserve 4k bytes for secondary superblock */ +-- +2.47.0 + diff --git a/0003-libparted-also-link-to-UUID_LIBS.patch b/0003-libparted-also-link-to-UUID_LIBS.patch deleted file mode 100644 index eb9ab33..0000000 --- a/0003-libparted-also-link-to-UUID_LIBS.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 507d8e8d4c60fa6175d327c4f2dac307dc11ccd6 Mon Sep 17 00:00:00 2001 -From: Heiko Becker -Date: Fri, 19 Sep 2014 16:51:34 +0200 -Subject: [PATCH 3/6] libparted: also link to UUID_LIBS - -* libparted/Makefile.am (libparted_la_LIBADD): Add UUID_LIBS. -This fixes building parted with the gold linker. ---- - libparted/Makefile.am | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libparted/Makefile.am b/libparted/Makefile.am -index edc5f2e..cb58648 100644 ---- a/libparted/Makefile.am -+++ b/libparted/Makefile.am -@@ -58,6 +58,7 @@ libparted_la_LIBADD = \ - $(DM_LIBS) \ - $(SELINUX_LIBS) \ - $(LIB_BLKID) \ -+ $(UUID_LIBS) \ - $(INTLLIBS) - - EXTRA_DIST = mbr.s --- -1.9.3 - diff --git a/0004-bug-74444-PATCH-parted-fix-do_version-declaration.patch b/0004-bug-74444-PATCH-parted-fix-do_version-declaration.patch new file mode 100644 index 0000000..187e4c4 --- /dev/null +++ b/0004-bug-74444-PATCH-parted-fix-do_version-declaration.patch @@ -0,0 +1,41 @@ +From 16343bda6ce0d41edf43f8dac368db3bbb63d271 Mon Sep 17 00:00:00 2001 +From: Rudi Heitbaum +Date: Wed, 20 Nov 2024 12:22:22 +0000 +Subject: [PATCH] bug#74444: [PATCH] parted: fix do_version declaration + +With gcc 15-20241117 compile fails with the below error, update the +do_version declaration to match the header in command.h + +../../parted/parted.c: In function '_init_commands': +../../parted/parted.c:2469:9: error: passing argument 2 of 'command_create' from incompatible pointer type [-Wincompatible-pointer-types] + 2469 | do_version, + | ^~~~~~~~~~ + | | + | int (*)(void) +In file included from ../../parted/parted.c:28: +../../parted/command.h:35:39: note: expected 'int (*)(PedDevice **, PedDisk **)' {aka 'int (*)(struct _PedDevice **, struct _PedDisk **)'} but argument is of type 'int (*)(void)' + 35 | int (*method) (PedDevice** dev, PedDisk** diskp), + | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Rudi Heitbaum +Signed-off-by: Brian C. Lane +--- + parted/parted.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parted/parted.c b/parted/parted.c +index 3abb52f..fc2aeba 100644 +--- a/parted/parted.c ++++ b/parted/parted.c +@@ -2172,7 +2172,7 @@ do_unit (PedDevice** dev, PedDisk** diskp) + } + + static int +-do_version () ++do_version (PedDevice** dev, PedDisk** diskp) + { + printf ("\n%s\n%s", + prog_name, +-- +2.47.0 + diff --git a/0004-lib-fs-resize-Prevent-crash-resizing-FAT16-file-syst.patch b/0004-lib-fs-resize-Prevent-crash-resizing-FAT16-file-syst.patch deleted file mode 100644 index 4f56b35..0000000 --- a/0004-lib-fs-resize-Prevent-crash-resizing-FAT16-file-syst.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 1e9e770f4bc7f3d80e09ecd1df58575fad064163 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sun, 28 Sep 2014 16:15:48 +0100 -Subject: [PATCH 4/6] lib-fs-resize: Prevent crash resizing FAT16 file systems - -Resizing FAT16 file system crashes in libparted/fs/r/fat/resize.c -create_resize_context() because it was dereferencing NULL pointer -fs_info->info_sector to copy the info_sector. - -Only FAT32 file systems have info_sector populated by fat_open() -> -fat_info_sector_read(). FAT12 and FAT16 file systems don't have an -info_sector so pointer fs_info->info_sector remains assigned NULL from -fat_alloc(). When resizing a FAT file system create_resize_context() -was always dereferencing fs_info->info_sector to memory copy the -info_sector, hence it crashed for FAT12 and FAT16. - -Make create_resize_context() only copy the info_sector for FAT32 file -systems. - -Reported by Christian Hesse in -https://bugzilla.gnome.org/show_bug.cgi?id=735669 ---- - NEWS | 4 ++++ - libparted/fs/r/fat/resize.c | 12 +++++++++--- - 2 files changed, 13 insertions(+), 3 deletions(-) - -diff --git a/NEWS b/NEWS -index 297b0a5..da7db50 100644 ---- a/NEWS -+++ b/NEWS -@@ -2,6 +2,10 @@ GNU parted NEWS -*- outline -*- - - * Noteworthy changes in release ?.? (????-??-??) [?] - -+** Bug Fixes -+ -+ libparted-fs-resize: Prevent crash resizing FAT16 file systems. -+ - - * Noteworthy changes in release 3.2 (2014-07-28) [stable] - -diff --git a/libparted/fs/r/fat/resize.c b/libparted/fs/r/fat/resize.c -index 919acf0..bfe60a0 100644 ---- a/libparted/fs/r/fat/resize.c -+++ b/libparted/fs/r/fat/resize.c -@@ -668,11 +668,17 @@ create_resize_context (PedFileSystem* fs, const PedGeometry* new_geom) - - /* preserve boot code, etc. */ - new_fs_info->boot_sector = ped_malloc (new_geom->dev->sector_size); -- new_fs_info->info_sector = ped_malloc (new_geom->dev->sector_size); - memcpy (new_fs_info->boot_sector, fs_info->boot_sector, - new_geom->dev->sector_size); -- memcpy (new_fs_info->info_sector, fs_info->info_sector, -- new_geom->dev->sector_size); -+ new_fs_info->info_sector = NULL; -+ if (fs_info->fat_type == FAT_TYPE_FAT32) -+ { -+ PED_ASSERT (fs_info->info_sector != NULL); -+ new_fs_info->info_sector = -+ ped_malloc (new_geom->dev->sector_size); -+ memcpy (new_fs_info->info_sector, fs_info->info_sector, -+ new_geom->dev->sector_size); -+ } - - new_fs_info->logical_sector_size = fs_info->logical_sector_size; - new_fs_info->sector_count = new_geom->length; --- -1.9.3 - diff --git a/0005-libparted-Fix-sun-disklabel-unhandled-exception.patch b/0005-libparted-Fix-sun-disklabel-unhandled-exception.patch new file mode 100644 index 0000000..e4c5d9f --- /dev/null +++ b/0005-libparted-Fix-sun-disklabel-unhandled-exception.patch @@ -0,0 +1,31 @@ +From 95b877cfa36c1571487c2a67a3902f1f5c4dc747 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Tue, 7 Jan 2025 16:50:21 -0800 +Subject: [PATCH 5/8] libparted: Fix sun disklabel unhandled exception + +The CHS warning should only continue if ignored, not if unhandled. + +Script mode, or exception handlers can return PED_EXCEPTION_UNHANDLED +which should act the same as a cancel. Previously it would only exit if +cancel was selected, allowing it to continue to use the bad CHS and +crash later. +--- + libparted/labels/sun.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libparted/labels/sun.c b/libparted/labels/sun.c +index 5ed2886..853576b 100644 +--- a/libparted/labels/sun.c ++++ b/libparted/labels/sun.c +@@ -284,7 +284,7 @@ _check_geometry_sanity (PedDisk* disk, SunRawLabel* label) + PED_BE16_TO_CPU(label->pcylcount), + PED_BE16_TO_CPU(label->ntrks), + PED_BE16_TO_CPU(label->nsect)) +- == PED_EXCEPTION_CANCEL) ++ != PED_EXCEPTION_IGNORE) + return 0; + #endif + dev->bios_geom.sectors = PED_BE16_TO_CPU(label->nsect); +-- +2.47.1 + diff --git a/0005-tests-t3000-resize-fs.sh-Add-FAT16-resizing-test.patch b/0005-tests-t3000-resize-fs.sh-Add-FAT16-resizing-test.patch deleted file mode 100644 index fccf55f..0000000 --- a/0005-tests-t3000-resize-fs.sh-Add-FAT16-resizing-test.patch +++ /dev/null @@ -1,54 +0,0 @@ -From d704c4919e7e95c3a2e28f48bb8eeacaf17a7cc8 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sun, 28 Sep 2014 16:15:49 +0100 -Subject: [PATCH 5/6] tests: t3000-resize-fs.sh: Add FAT16 resizing test - -Add FAT16 resizing test so that we don't regress again. ---- - tests/t3000-resize-fs.sh | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh -index 8cab476..9084eb4 100755 ---- a/tests/t3000-resize-fs.sh -+++ b/tests/t3000-resize-fs.sh -@@ -46,7 +46,7 @@ device_sectors_required=$(echo $default_end | sed 's/s$//') - # Ensure that $dev is large enough for this test - test $device_sectors_required -le $dev_n_sectors || fail=1 - --for fs_type in hfs+ fat32; do -+for fs_type in hfs+ fat32 fat16; do - - # create an empty $fs_type partition, cylinder aligned, size > 256 MB - parted -a min -s $dev mkpart p1 $start $default_end > out 2>&1 || fail=1 -@@ -59,6 +59,7 @@ for fs_type in hfs+ fat32; do - wait_for_dev_to_appear_ ${dev}1 - - case $fs_type in -+ fat16) mkfs_cmd='mkfs.vfat -F 16'; fsck='fsck.vfat -v';; - fat32) mkfs_cmd='mkfs.vfat -F 32'; fsck='fsck.vfat -v';; - hfs*) mkfs_cmd='mkfs.hfs'; fsck=fsck.hfs;; - *) error "internal error: unhandled fs type: $fs_type";; -@@ -70,8 +71,17 @@ for fs_type in hfs+ fat32; do - # NOTE: shrinking is the only type of resizing that works. - # resize that file system to be one cylinder (8MiB) smaller - fs-resize ${dev}1 0 $new_end > out 2>&1 || fail=1 -- # expect no output -- compare /dev/null out || fail=1 -+ -+ # check for expected output -+ case $fs_type in -+ fat16) cat << EOF > exp || framework_failure -+Information: Would you like to use FAT32? If you leave your file system as FAT16, then you will have no problems. If you convert to FAT32, and MS Windows is installed on this partition, then you must re-install the MS Windows boot loader. If you want to do this, you should consult the Parted manual (or your distribution's manual). Also, converting to FAT32 will make the file system unreadable by MS DOS, MS Windows 95a, and MS Windows NT. -+EOF -+ ;; -+ fat32) cat /dev/null > exp || framework_failure;; # expect no output -+ hfs*) cat /dev/null > exp || framework_failure;; # expect no output -+ esac -+ compare exp out || fail=1 - - # This is known to segfault with fsck.hfs from - # Fedora 16's hfsplus-tools-332.14-12.fc15.x86_64. --- -1.9.3 - diff --git a/0006-tests-Add-test-for-SUN-disklabel-handling.patch b/0006-tests-Add-test-for-SUN-disklabel-handling.patch new file mode 100644 index 0000000..735e60d --- /dev/null +++ b/0006-tests-Add-test-for-SUN-disklabel-handling.patch @@ -0,0 +1,116 @@ +From bdb92f73112177c091a764836a9ceaa59f7e9b15 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Wed, 8 Jan 2025 11:59:40 -0800 +Subject: [PATCH 6/8] tests: Add test for SUN disklabel handling + +When fixed the output from script mode should be an unknown disklabel, +not sun. +--- + tests/Makefile.am | 3 ++- + tests/sun-badlabel | 42 +++++++++++++++++++++++++++++++++++++ + tests/t4002-sun-badlabel.sh | 23 ++++++++++++++++++++ + 3 files changed, 67 insertions(+), 1 deletion(-) + create mode 100755 tests/sun-badlabel + create mode 100644 tests/t4002-sun-badlabel.sh + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index fa27b44..00f4a9d 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -67,6 +67,7 @@ TESTS = \ + t3400-whole-disk-FAT-partition.sh \ + t4000-sun-raid-type.sh \ + t4001-sun-vtoc.sh \ ++ t4002-sun-badlabel.sh \ + t4100-msdos-partition-limits.sh \ + t4100-dvh-partition-limits.sh \ + t4100-msdos-starting-sector.sh \ +@@ -103,7 +104,7 @@ TESTS = \ + EXTRA_DIST = \ + $(TESTS) t-local.sh t-lvm.sh \ + init.cfg init.sh t-lib-helpers.sh gpt-header-munge \ +- gpt-header-move msdos-overlap gpt-attrs ++ gpt-header-move msdos-overlap gpt-attrs sun-badlabel + + check_PROGRAMS = print-align print-flags print-max dup-clobber duplicate \ + fs-resize +diff --git a/tests/sun-badlabel b/tests/sun-badlabel +new file mode 100755 +index 0000000..6a28e86 +--- /dev/null ++++ b/tests/sun-badlabel +@@ -0,0 +1,42 @@ ++#!/usr/bin/python3 ++# Mangle the CHS values stored in a SUN disklabel ++# This sets CHS to 1 track, 2 sectors and updates the checksum ++# This triggers a bug in the SUN disklabel code when the CHS ++# error is UNHANDLED (in script mode or with a custom exception ++# handler) and it continues using a bad label which will coredump ++# when .duplicate() is called on it. ++ ++import array ++from struct import unpack_from, pack_into ++import sys ++ ++file = open(sys.argv[1],'rb+') ++header = file.read(512) ++ ++# Make sure it looks like a SUN disklabel first ++magic = unpack_from(">H", header, 0x1FC)[0] ++if magic != 0xDABE: ++ raise RuntimeError("Not a SUN disklabel. magic = 0x%04X" % magic) ++csum = unpack_from(">H", header, 0x1FE)[0] ++ntrks = unpack_from(">H", header, 0x1B4)[0] ++nsect = unpack_from(">H", header, 0x1B6)[0] ++ ++header = array.array('B', header) ++# cylinders at 0x1B0 ++# modify ntrks at offset 0x1B4 ++pack_into('>H', header, 0x1B4, 1) ++# modify nsect at offset 0x1B6 ++pack_into('>H', header, 0x1B6, 2) ++ ++## Undo old values ++csum ^= ntrks ++csum ^= nsect ++ ++## Add new ++csum ^= 1 ++csum ^= 2 ++pack_into('>H', header, 0x1FE, csum) ++ ++file.seek(0) ++file.write(header) ++file.close() +diff --git a/tests/t4002-sun-badlabel.sh b/tests/t4002-sun-badlabel.sh +new file mode 100644 +index 0000000..177c0e4 +--- /dev/null ++++ b/tests/t4002-sun-badlabel.sh +@@ -0,0 +1,23 @@ ++#!/bin/sh ++# Test exception handling on a bad SUN disklabel ++ ++. "${srcdir=.}/init.sh"; path_prepend_ ../parted $srcdir ++ss=$sector_size_ ++ ++n_sectors=2000 # number of sectors ++dev=sun-disk-file ++# create an empty file as a test disk ++dd if=/dev/zero of=$dev bs=$ss count=$n_sectors 2> /dev/null || fail=1 ++ ++# label the test disk as a sun disk ++parted -s $dev mklabel sun > out 2>&1 || fail=1 ++compare /dev/null out || fail=1 ++ ++# Mangle the disklabel to have incorrect CHS values, but a valid checksum ++sun-badlabel $dev || fail=1 ++ ++# Check the output (this should return 1, but depend on checking the output for the test) ++parted -m -s $dev p > out 2>&1 ++grep unknown out || { cat out; fail=1; } ++ ++Exit $fail +-- +2.47.1 + diff --git a/0006-tests-t3000-resize-fs.sh-Add-requirement-on-mkfs.vfa.patch b/0006-tests-t3000-resize-fs.sh-Add-requirement-on-mkfs.vfa.patch deleted file mode 100644 index f803fbe..0000000 --- a/0006-tests-t3000-resize-fs.sh-Add-requirement-on-mkfs.vfa.patch +++ /dev/null @@ -1,68 +0,0 @@ -From ac74b830ce518c2228b8ae3fba3f1ece82b49f81 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sun, 28 Sep 2014 16:15:50 +0100 -Subject: [PATCH 6/6] tests: t3000-resize-fs.sh: Add requirement on mkfs.vfat - -Add test skipping requirement on mkfs.vfat for the FAT32 and FAT16 file -system resizing tests. This matches existing test skipping requirement -on mkfs.hfs for the hfs+ file system. - -* tests/t3000-resize-fs.sh: Also correct skip_test_ to skip_. -* tests/t-lib-helpers.sh: Also update message for requirement of hfs. ---- - tests/t-lib-helpers.sh | 8 +++++++- - tests/t3000-resize-fs.sh | 5 +++-- - 2 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/tests/t-lib-helpers.sh b/tests/t-lib-helpers.sh -index 4e83a05..c8684bb 100644 ---- a/tests/t-lib-helpers.sh -+++ b/tests/t-lib-helpers.sh -@@ -20,7 +20,13 @@ require_acl_() - require_hfs_() - { - mkfs.hfs 2>&1 | grep '^usage:' \ -- || skip_ "This test requires HFS support." -+ || skip_ "mkfs.hfs: command not found" -+} -+ -+require_fat_() -+{ -+ mkfs.vfat 2>&1 | grep '^Usage:' \ -+ || skip_ "mkfs.vfat: command not found" - } - - # Skip this test if we're not in SELinux "enforcing" mode. -diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh -index 9084eb4..a79a307 100755 ---- a/tests/t3000-resize-fs.sh -+++ b/tests/t3000-resize-fs.sh -@@ -18,7 +18,7 @@ - - . "${srcdir=.}/init.sh"; path_prepend_ ../parted . - require_hfs_ -- -+require_fat_ - require_root_ - require_scsi_debug_module_ - require_512_byte_sector_size_ -@@ -31,7 +31,7 @@ default_end=546147s - - # create memory-backed device - scsi_debug_setup_ dev_size_mb=550 > dev-name || -- skip_test_ 'failed to create scsi_debug device' -+ skip_ 'failed to create scsi_debug device' - dev=$(cat dev-name) - - fail=0 -@@ -47,6 +47,7 @@ device_sectors_required=$(echo $default_end | sed 's/s$//') - test $device_sectors_required -le $dev_n_sectors || fail=1 - - for fs_type in hfs+ fat32 fat16; do -+ echo "fs_type=$fs_type" - - # create an empty $fs_type partition, cylinder aligned, size > 256 MB - parted -a min -s $dev mkpart p1 $start $default_end > out 2>&1 || fail=1 --- -1.9.3 - diff --git a/0007-libparted-Fix-dvh-disklabel-unhandled-exception.patch b/0007-libparted-Fix-dvh-disklabel-unhandled-exception.patch new file mode 100644 index 0000000..59dacde --- /dev/null +++ b/0007-libparted-Fix-dvh-disklabel-unhandled-exception.patch @@ -0,0 +1,29 @@ +From 1480769f2a7071c5a251b6c69658808199e8b05b Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Wed, 8 Jan 2025 13:35:04 -0800 +Subject: [PATCH 7/8] libparted: Fix dvh disklabel unhandled exception + +When an exception is using PED_EXCEPTION_IGNORE_CANCEL it should check +for !PED_EXCEPTION_IGNORE so that an unhandled exception is treated the +same as cancel. Otherwise it could lead to using the disklabel with +incorrect values. +--- + libparted/labels/dvh.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libparted/labels/dvh.c b/libparted/labels/dvh.c +index 0f9124d..7d7dae3 100644 +--- a/libparted/labels/dvh.c ++++ b/libparted/labels/dvh.c +@@ -308,7 +308,7 @@ dvh_read (PedDisk* disk) + PED_EXCEPTION_IGNORE_CANCEL, + _("Checksum is wrong, indicating the partition " + "table is corrupt.")) +- == PED_EXCEPTION_CANCEL) ++ != PED_EXCEPTION_IGNORE) + return 0; + } + +-- +2.47.1 + diff --git a/0007-tests-Change-minimum-size-to-256MiB.patch b/0007-tests-Change-minimum-size-to-256MiB.patch deleted file mode 100644 index a5be3fa..0000000 --- a/0007-tests-Change-minimum-size-to-256MiB.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 17630fc4d523d9c03af87a6e735599e88a032e2a Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 7 Nov 2014 11:15:55 -0800 -Subject: [PATCH] tests: Change minimum size to 256MiB - -btrfs on ppc64 wants 136MiB so expand the minimum temp filesystem size -for the t1700-probe-fs test. ---- - tests/t1700-probe-fs.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/t1700-probe-fs.sh b/tests/t1700-probe-fs.sh -index 574d6fe..94ed9ae 100755 ---- a/tests/t1700-probe-fs.sh -+++ b/tests/t1700-probe-fs.sh -@@ -21,7 +21,7 @@ require_512_byte_sector_size_ - - dev=loop-file - ss=$sector_size_ --n_sectors=$((257*1024)) -+n_sectors=$((512*1024)) - - for type in ext2 ext3 ext4 btrfs xfs nilfs2 ntfs vfat hfsplus; do - --- -1.9.3 - diff --git a/0008-parted-don-t-crash-in-disk_set-when-disk-label-not-f.patch b/0008-parted-don-t-crash-in-disk_set-when-disk-label-not-f.patch deleted file mode 100644 index c6aae75..0000000 --- a/0008-parted-don-t-crash-in-disk_set-when-disk-label-not-f.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 624a8b14af7d358782ecc12627c84da72c28aeff Mon Sep 17 00:00:00 2001 -From: Phillip Susi -Date: Tue, 13 Jan 2015 11:05:48 -0500 -Subject: [PATCH 08/11] parted: don't crash in disk_set when disk label not - found - -Due to a typeo in commit 7eac058 "parted: don't reload partition -table on every command", the disk_set command would crash if -a disk label was not found. ---- - NEWS | 2 ++ - parted/parted.c | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/NEWS b/NEWS -index da7db50..10c9a6e 100644 ---- a/NEWS -+++ b/NEWS -@@ -4,6 +4,8 @@ GNU parted NEWS -*- outline -*- - - ** Bug Fixes - -+ Don't crash in the disk_set command when a disk label is not found -+ - libparted-fs-resize: Prevent crash resizing FAT16 file systems. - - -diff --git a/parted/parted.c b/parted/parted.c -index f27a035..2678554 100644 ---- a/parted/parted.c -+++ b/parted/parted.c -@@ -1684,7 +1684,7 @@ do_disk_set (PedDevice** dev, PedDisk** diskp) - - if (!*diskp) - *diskp = ped_disk_new (*dev); -- if (!diskp) -+ if (!*diskp) - goto error; - - if (!command_line_get_disk_flag (_("Flag to Invert?"), *diskp, &flag)) --- -2.1.0 - diff --git a/0008-tests-Add-test-for-dvh-with-a-bad-checksum.patch b/0008-tests-Add-test-for-dvh-with-a-bad-checksum.patch new file mode 100644 index 0000000..b1f9451 --- /dev/null +++ b/0008-tests-Add-test-for-dvh-with-a-bad-checksum.patch @@ -0,0 +1,57 @@ +From 82b582996ce691eb635bed124603207515b92efe Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Wed, 8 Jan 2025 14:01:39 -0800 +Subject: [PATCH 8/8] tests: Add test for dvh with a bad checksum + +When using script mode it should return an unknown partition type, not +dvh, because the exception is unhandled. +--- + tests/Makefile.am | 1 + + tests/t4101-dvh-badlabel.sh | 23 +++++++++++++++++++++++ + 2 files changed, 24 insertions(+) + create mode 100644 tests/t4101-dvh-badlabel.sh + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 00f4a9d..5eeab08 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -71,6 +71,7 @@ TESTS = \ + t4100-msdos-partition-limits.sh \ + t4100-dvh-partition-limits.sh \ + t4100-msdos-starting-sector.sh \ ++ t4101-dvh-badlabel.sh \ + t4200-partprobe.sh \ + t4300-nilfs2-tiny.sh \ + t4301-nilfs2-badsb2.sh \ +diff --git a/tests/t4101-dvh-badlabel.sh b/tests/t4101-dvh-badlabel.sh +new file mode 100644 +index 0000000..075c044 +--- /dev/null ++++ b/tests/t4101-dvh-badlabel.sh +@@ -0,0 +1,23 @@ ++#!/bin/sh ++# Test exception handling on a bad DVH disklabel ++ ++. "${srcdir=.}/init.sh"; path_prepend_ ../parted $srcdir ++ss=$sector_size_ ++ ++n_sectors=2000 # number of sectors ++dev=sun-disk-file ++# create an empty file as a test disk ++dd if=/dev/zero of=$dev bs=$ss count=$n_sectors 2> /dev/null || fail=1 ++ ++# label the test disk as a dvh disk ++parted -s $dev mklabel dvh > out 2>&1 || fail=1 ++compare /dev/null out || fail=1 ++ ++# Mangle the disklabel to have incorrect checksum ++dd if=/dev/zero of=$dev conv=notrunc bs=4 count=1 seek=1 ++ ++# Check the output (this should return 1, but depend on checking the output for the test) ++parted -m -s $dev p > out 2>&1 ++grep unknown out || { cat out; fail=1; } ++ ++Exit $fail +-- +2.47.1 + diff --git a/0009-tests-Add-a-test-for-device-mapper-partition-sizes.patch b/0009-tests-Add-a-test-for-device-mapper-partition-sizes.patch deleted file mode 100644 index 894ffa1..0000000 --- a/0009-tests-Add-a-test-for-device-mapper-partition-sizes.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 8ab27474806687a2af7efb008b80b33615e6eb1d Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Wed, 4 Feb 2015 16:31:00 -0800 -Subject: [PATCH 09/11] tests: Add a test for device-mapper partition sizes - -device-mapper uses 512b sector units, not device specific sector sizes. -This test ensures that the correct partition size is created, no matter -what the device's sector size is. ---- - tests/Makefile.am | 1 + - tests/t6006-dm-512b-sectors.sh | 68 ++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 69 insertions(+) - create mode 100644 tests/t6006-dm-512b-sectors.sh - -diff --git a/tests/Makefile.am b/tests/Makefile.am -index b726366..ce8391d 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -69,6 +69,7 @@ TESTS = \ - t6003-dm-hide.sh \ - t6004-dm-many-partitions.sh \ - t6005-dm-uuid.sh \ -+ t6006-dm-512b-sectors.sh \ - t6100-mdraid-partitions.sh \ - t7000-scripting.sh \ - t8000-loop.sh \ -diff --git a/tests/t6006-dm-512b-sectors.sh b/tests/t6006-dm-512b-sectors.sh -new file mode 100644 -index 0000000..31abba9 ---- /dev/null -+++ b/tests/t6006-dm-512b-sectors.sh -@@ -0,0 +1,68 @@ -+#!/bin/sh -+# device-mapper sector sizes are 512b, make sure partitions are the correct -+# size when using larger sector sizes and a linear dm table. -+ -+# Copyright (C) 2015 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_root_ -+require_scsi_debug_module_ -+ -+grep '^#define USE_BLKID 1' "$CONFIG_HEADER" > /dev/null || -+ skip_ 'this system lacks a new-enough libblkid' -+ -+(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed" -+ -+# Device maps names - should be random to not conflict with existing ones on -+# the system -+linear_=plinear-$$test -+ -+cleanup_fn_() { -+ i=0 -+ udevadm settle -+ while [ $i -lt 10 ] ; do -+ [ -e "/dev/mapper/${linear_}1" ] && dmsetup remove ${linear_}1 -+ sleep .2 -+ [ -e "/dev/mapper/$linear_" ] && dmsetup remove $linear_ -+ sleep .2 -+ [ -e "/dev/mapper/${linear_}1" -o -e "/dev/mapper/$linear_" ] || i=10 -+ i=$((i + 1)) -+ done -+ udevadm settle -+} -+ -+# Create a 500M device -+ss=$sector_size_ -+scsi_debug_setup_ sector_size=$ss dev_size_mb=500 > dev-name || -+ skip_ 'failed to create scsi_debug device' -+scsi_dev=$(cat dev-name) -+ -+# Size of device, in 512b units -+scsi_dev_size=$(blockdev --getsz $scsi_dev) || framework_failure -+ -+dmsetup create $linear_ --table "0 $scsi_dev_size linear $scsi_dev 0" || framework_failure -+dev="/dev/mapper/$linear_" -+ -+# Create msdos partition table with a partition from 1MiB to 100MiB -+parted -s $dev mklabel msdos mkpart primary ext2 1MiB 101MiB > out 2>&1 || fail=1 -+compare /dev/null out || fail=1 -+ -+# The size of the partition should be 100MiB, or 204800 512b sectors -+p1_size=$(blockdev --getsz ${dev}1) || framework_failure -+[ $p1_size == 204800 ] || fail=1 -+ -+Exit $fail --- -2.1.0 - diff --git a/0009-tests-probing-ext4-without-journal-should-still-indi.patch b/0009-tests-probing-ext4-without-journal-should-still-indi.patch new file mode 100644 index 0000000..1fa6a1c --- /dev/null +++ b/0009-tests-probing-ext4-without-journal-should-still-indi.patch @@ -0,0 +1,52 @@ +From 43c2b908396e8b7baa475e009f3f4dbf9b9beac7 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Wed, 28 May 2025 11:24:21 -0700 +Subject: [PATCH 09/12] tests: probing ext4 without journal should still + indicate ext4 + +t1700 tests a fix for the ext filesystem probe code, it was previously +returning ext2 when the filesystem is really ext4 without a journal. + +t3200 is updated to reflect the correct filesystem type -- it creates a +fs too small for a journal so it used to identify it as ext2 but now +correctly identifies it as ext4. +--- + tests/t1700-probe-fs.sh | 10 ++++++++++ + tests/t3200-resize-partition.sh | 2 +- + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/tests/t1700-probe-fs.sh b/tests/t1700-probe-fs.sh +index 7557f92..2bf2810 100755 +--- a/tests/t1700-probe-fs.sh ++++ b/tests/t1700-probe-fs.sh +@@ -70,4 +70,14 @@ for feature in uninit_bg flex_bg; do + rm $dev + done + ++# ext4 without a journal should still indicate ext4 ++# create an ext3 file system ++dd if=/dev/null of=$dev bs=1024 seek=8192 >/dev/null || skip_ "dd failed" ++mkfs.ext4 -O ^has_journal -F $dev >/dev/null || skip_ "mkfs.ext4 failed" ++ ++# probe the file system, which should still be ext4 ++parted -m -s $dev u s print >out 2>&1 || fail=1 ++grep '^1:.*:ext4::;$' out || fail=1 ++rm $dev ++ + Exit $fail +diff --git a/tests/t3200-resize-partition.sh b/tests/t3200-resize-partition.sh +index 846fbc3..c9decab 100755 +--- a/tests/t3200-resize-partition.sh ++++ b/tests/t3200-resize-partition.sh +@@ -111,7 +111,7 @@ compare exp out || fail=1 + parted -m -s $dev u s p > out 2>&1 || fail=1 + + sed -n 3p out > k && mv k out || fail=1 +-printf "1:$default_start:$new_end:3073s:ext2::$ms;\n" > exp || fail=1 ++printf "1:$default_start:$new_end:3073s:ext4::$ms;\n" > exp || fail=1 + compare exp out || fail=1 + + umount "${dev}1" || fail=1 +-- +2.49.0 + diff --git a/0010-libparted-Do-not-detect-ext4-without-journal-as-ext2.patch b/0010-libparted-Do-not-detect-ext4-without-journal-as-ext2.patch new file mode 100644 index 0000000..2739563 --- /dev/null +++ b/0010-libparted-Do-not-detect-ext4-without-journal-as-ext2.patch @@ -0,0 +1,61 @@ +From e61584ddeb952ff04823936dabd1a6a241f04f38 Mon Sep 17 00:00:00 2001 +From: Pascal Hambourg +Date: Thu, 17 Apr 2025 18:42:33 +0200 +Subject: [PATCH 10/12] libparted: Do not detect ext4 without journal as ext2 + +ext4 may have other incompatible features than journal and cannot be +mounted as ext2 by linux, so detect it as ext4 even without journal +if it has other incompatible features. + +Signed-off-by: Brian C. Lane +--- + libparted/fs/ext2/interface.c | 33 +++++++++++++++------------------ + 1 file changed, 15 insertions(+), 18 deletions(-) + +diff --git a/libparted/fs/ext2/interface.c b/libparted/fs/ext2/interface.c +index 7e0b197..5f64ab3 100644 +--- a/libparted/fs/ext2/interface.c ++++ b/libparted/fs/ext2/interface.c +@@ -52,24 +52,21 @@ _ext2_generic_probe (PedGeometry* geom, int expect_ext_ver) + int is_ext3 = 0; + int is_ext4 = 0; + +- is_ext3 = (EXT2_SUPER_FEATURE_COMPAT (*sb) +- & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0; +- if (is_ext3) { +- is_ext4 = ((EXT2_SUPER_FEATURE_RO_COMPAT (*sb) +- & EXT4_FEATURE_RO_COMPAT_HUGE_FILE) +- || (EXT2_SUPER_FEATURE_RO_COMPAT (*sb) +- & EXT4_FEATURE_RO_COMPAT_GDT_CSUM) +- || (EXT2_SUPER_FEATURE_RO_COMPAT (*sb) +- & EXT4_FEATURE_RO_COMPAT_DIR_NLINK) +- || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) +- & EXT4_FEATURE_INCOMPAT_EXTENTS) +- || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) +- & EXT4_FEATURE_INCOMPAT_64BIT) +- || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) +- & EXT4_FEATURE_INCOMPAT_FLEX_BG)); +- if (is_ext4) +- is_ext3 = 0; +- } ++ is_ext4 = ((EXT2_SUPER_FEATURE_RO_COMPAT (*sb) ++ & EXT4_FEATURE_RO_COMPAT_HUGE_FILE) ++ || (EXT2_SUPER_FEATURE_RO_COMPAT (*sb) ++ & EXT4_FEATURE_RO_COMPAT_GDT_CSUM) ++ || (EXT2_SUPER_FEATURE_RO_COMPAT (*sb) ++ & EXT4_FEATURE_RO_COMPAT_DIR_NLINK) ++ || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) ++ & EXT4_FEATURE_INCOMPAT_EXTENTS) ++ || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) ++ & EXT4_FEATURE_INCOMPAT_64BIT) ++ || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) ++ & EXT4_FEATURE_INCOMPAT_FLEX_BG)); ++ if (!is_ext4) ++ is_ext3 = (EXT2_SUPER_FEATURE_COMPAT (*sb) ++ & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0; + if (expect_ext_ver == 2 && (is_ext3 || is_ext4)) + return NULL; + if (expect_ext_ver == 3 && !is_ext3) +-- +2.49.0 + diff --git a/0010-libparted-device-mapper-uses-512b-sectors.patch b/0010-libparted-device-mapper-uses-512b-sectors.patch deleted file mode 100644 index 3f91c28..0000000 --- a/0010-libparted-device-mapper-uses-512b-sectors.patch +++ /dev/null @@ -1,93 +0,0 @@ -From f98f791e19669b900345dad7d96ea4df974e4596 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Wed, 4 Feb 2015 16:46:07 -0800 -Subject: [PATCH 10/11] libparted: device mapper uses 512b sectors - -device mapper doesn't use the device's sector size when creating a -table. It always uses 512b units. This causes partitions to be created -8x smaller than expected on devices with 4906b sectors. ---- - NEWS | 4 ++++ - libparted/arch/linux.c | 21 +++++++++++++++++---- - 2 files changed, 21 insertions(+), 4 deletions(-) - -diff --git a/NEWS b/NEWS -index 10c9a6e..96135ed 100644 ---- a/NEWS -+++ b/NEWS -@@ -4,6 +4,10 @@ GNU parted NEWS -*- outline -*- - - ** Bug Fixes - -+ Use 512b sector size when communicating with device-mapper. Fixes -+ problems with partitions being created too small on dm devices -+ with sector sizes > 5121b -+ - Don't crash in the disk_set command when a disk label is not found - - libparted-fs-resize: Prevent crash resizing FAT16 file systems. -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index 0f18904..90ab21d 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -2763,6 +2763,12 @@ _dm_get_partition_start_and_length(PedPartition const *part, - if (sscanf (params, "%d:%d %Ld", &major, &minor, start) != 3) - goto err; - rc = 1; -+ -+ /* device-mapper uses 512b units, make sure we return length and start in terms of the device's -+ * sector size. -+ */ -+ *start /= (part->disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT); -+ *length /= (part->disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT); - err: - free (path); - dm_task_destroy(task); -@@ -2810,8 +2816,10 @@ _dm_add_partition (PedDisk* disk, const PedPartition* part) - /* Caution: dm_task_destroy frees dev_name. */ - dm_task_destroy (task); - task = NULL; -+ /* device-mapper uses 512b units, not the device's sector size */ - if ( ! (params = zasprintf ("%d:%d %lld", arch_specific->major, -- arch_specific->minor, part->geom.start))) -+ arch_specific->minor, -+ part->geom.start * (disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT)))) - goto err; - - task = dm_task_create (DM_DEVICE_CREATE); -@@ -2821,7 +2829,8 @@ _dm_add_partition (PedDisk* disk, const PedPartition* part) - dm_task_set_name (task, vol_name); - if (vol_uuid) - dm_task_set_uuid (task, vol_uuid); -- dm_task_add_target (task, 0, part->geom.length, -+ /* device-mapper uses 512b units, not the device's sector size */ -+ dm_task_add_target (task, 0, part->geom.length * (disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT), - "linear", params); - if (!dm_task_set_cookie (task, &cookie, 0)) - goto err; -@@ -2878,8 +2887,11 @@ _dm_resize_partition (PedDisk* disk, const PedPartition* part) - /* Caution: dm_task_destroy frees dev_name. */ - dm_task_destroy (task); - task = NULL; -+ -+ /* device-mapper uses 512b units, not the device's sector size */ - if ( ! (params = zasprintf ("%d:%d %lld", arch_specific->major, -- arch_specific->minor, part->geom.start))) -+ arch_specific->minor, -+ part->geom.start * (disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT)))) - goto err; - - task = dm_task_create (DM_DEVICE_RELOAD); -@@ -2887,7 +2899,8 @@ _dm_resize_partition (PedDisk* disk, const PedPartition* part) - goto err; - - dm_task_set_name (task, vol_name); -- dm_task_add_target (task, 0, part->geom.length, -+ /* device-mapper uses 512b units, not the device's sector size */ -+ dm_task_add_target (task, 0, part->geom.length * (disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT), - "linear", params); - if (!dm_task_set_cookie (task, &cookie, 0)) - goto err; --- -2.1.0 - diff --git a/0011-Update-manpage-NAME-so-whatis-will-work.patch b/0011-Update-manpage-NAME-so-whatis-will-work.patch deleted file mode 100644 index a4130bc..0000000 --- a/0011-Update-manpage-NAME-so-whatis-will-work.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 098bf9ca4c1ea7955ad683694c64f0201760de60 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 1 Aug 2014 14:48:13 -0700 -Subject: [PATCH 11/11] Update manpage NAME so whatis will work - ---- - doc/C/parted.8 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/doc/C/parted.8 b/doc/C/parted.8 -index 689011c..5304375 100644 ---- a/doc/C/parted.8 -+++ b/doc/C/parted.8 -@@ -1,6 +1,6 @@ - .TH PARTED 8 "2007 March 29" parted "GNU Parted Manual" - .SH NAME --GNU Parted \- a partition manipulation program -+parted \- a partition manipulation program - .SH SYNOPSIS - .B parted - [options] [device [command [options...]...]] --- -2.1.0 - diff --git a/0011-nilfs2-Fixed-possible-sigsegv-in-case-of-corrupted-s.patch b/0011-nilfs2-Fixed-possible-sigsegv-in-case-of-corrupted-s.patch new file mode 100644 index 0000000..de1b0c5 --- /dev/null +++ b/0011-nilfs2-Fixed-possible-sigsegv-in-case-of-corrupted-s.patch @@ -0,0 +1,61 @@ +From 2fad7d827d27e75298f1d17b5fa6567ddfc4c338 Mon Sep 17 00:00:00 2001 +From: Anton Butenko +Date: Fri, 28 Feb 2025 16:09:18 +0100 +Subject: [PATCH 11/12] nilfs2: Fixed possible sigsegv in case of corrupted + superblock + +bytes value comes from the superblock and it must be at least as long as +s_sum which is a 32 bit value. So sumoff + 4 is the correct lower limit +for it, not sumoff - 4. + +Signed-off-by: Brian C. Lane +--- + libparted/fs/nilfs2/nilfs2.c | 2 +- + tests/t4301-nilfs2-badsb2.sh | 10 ++++++++-- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/libparted/fs/nilfs2/nilfs2.c b/libparted/fs/nilfs2/nilfs2.c +index 40f8567..74186f1 100644 +--- a/libparted/fs/nilfs2/nilfs2.c ++++ b/libparted/fs/nilfs2/nilfs2.c +@@ -88,7 +88,7 @@ is_valid_nilfs_sb(struct nilfs2_super_block *sb) + return 0; + + bytes = PED_LE16_TO_CPU(sb->s_bytes); +- if (bytes > 1024 || bytes < sumoff - 4) ++ if (bytes > 1024 || bytes < sumoff + 4) + return 0; + + crc = __efi_crc32(sb, sumoff, PED_LE32_TO_CPU(sb->s_crc_seed)); +diff --git a/tests/t4301-nilfs2-badsb2.sh b/tests/t4301-nilfs2-badsb2.sh +index 2a1205b..45b6644 100755 +--- a/tests/t4301-nilfs2-badsb2.sh ++++ b/tests/t4301-nilfs2-badsb2.sh +@@ -27,16 +27,22 @@ end=$(($len * 512 / $ss)) + parted -s $dev mklabel msdos mkpart primary 1s ${end}s || framework_failure_ + + # Write a secondary superblock with the nilfs magic number and a nilfs +-# superblock length (s_bytes) field of only 10 bytes. ++# superblock length (s_bytes) field of only 13 bytes. + # struct nilfs2_super_block starts with these four fields... + # uint32_t s_rev_level; + # uint16_t s_minor_rev_level; + # uint16_t s_magic; + # uint16_t s_bytes; + sb2_offset=$(( 24 / ($ss / 512) + 1)) +-perl -e "print pack 'LSSS.', 0, 0, 0x3434, 10, $ss" | ++perl -e "print pack 'LSSS.', 0, 0, 0x3434, 13, $ss" | + dd of=$dev bs=$ss seek=$sb2_offset count=1 conv=notrunc + ++# Write primary nilfs magic number and a nilfs ++# superblock length (s_bytes) field of only 13 bytes. ++sb_offset=3 ++perl -e "print pack 'LSSS.', 0, 0, 0x3434, 13, $ss" | ++ dd of=$dev bs=$ss seek=$sb_offset count=1 conv=notrunc ++ + # This used to give parted a sigsegv. + parted -s $dev print || fail=1 + +-- +2.49.0 + diff --git a/0012-doc-Fix-some-groff-mandoc-linting-complaints.patch b/0012-doc-Fix-some-groff-mandoc-linting-complaints.patch new file mode 100644 index 0000000..a846f6f --- /dev/null +++ b/0012-doc-Fix-some-groff-mandoc-linting-complaints.patch @@ -0,0 +1,90 @@ +From a2164c99b4d7d37334f9ca5ece55d8af95d002b7 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Wed, 28 May 2025 13:09:32 -0700 +Subject: [PATCH 12/12] doc: Fix some groff/mandoc linting complaints + +--- + doc/C/parted.8 | 27 ++++++++++++--------------- + 1 file changed, 12 insertions(+), 15 deletions(-) + +diff --git a/doc/C/parted.8 b/doc/C/parted.8 +index 171269c..c852112 100644 +--- a/doc/C/parted.8 ++++ b/doc/C/parted.8 +@@ -54,7 +54,6 @@ Use optimum alignment as given by the disk topology information. This + aligns to a multiple of the physical block size in a way that guarantees + optimal performance. + .RE +- + .SH COMMANDS + .TP + .B [device] +@@ -62,8 +61,7 @@ The block device to be used. When none is given, \fBparted\fP will use the + first block device it finds. + .TP + .B [command [options]] +-Specifies the command to be executed. If no command is given, +-.BR parted ++Specifies the command to be executed. If no command is given, \fBparted\fP + will present a command prompt. Possible commands are: + .RS + .TP +@@ -119,8 +117,8 @@ or an LVM logical volume if necessary. + .B set \fIpartition\fP \fIflag\fP \fIstate\fP + Change the state of the \fIflag\fP on \fIpartition\fP to \fIstate\fP. + Supported flags are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba", +-"legacy_boot", "irst", "msftres", "esp", "chromeos_kernel", "bls_boot", "linux-home", +-"no_automount", "bios_grub", and "palo". ++"legacy_boot", "irst", "msftres", "esp", "chromeos_kernel", "bls_boot", ++"linux-home", "no_automount", "bios_grub", and "palo". + \fIstate\fP should be either "on" or "off". + .TP + .B unit \fIunit\fP +@@ -140,10 +138,10 @@ On MS-DOS set the type aka. partition id of \fIpartition\fP to + the type-uuid of \fIpartition\fP to \fIuuid\fP. + .TP + .B disk_set \fIflag\fP \fIstate\fP +-Change a \fIflag\fP on the disk to \fIstate\fP. A flag can be either "on" or "off". +-Some or all of these flags will be available, depending on what disk label you +-are using. Supported flags are: "pmbr_boot" on GPT to enable the boot flag on the +-GPT's protective MBR partition. ++Change a \fIflag\fP on the disk to \fIstate\fP. A flag can be either "on" or ++"off". Some or all of these flags will be available, depending on what disk ++abel you are using. Supported flags are: "pmbr_boot" on GPT to enable the ++boot flag on the GPT's protective MBR partition. + .TP + .B disk_toggle \fIflag\fP + Toggle the state of the disk \fIflag\fP. +@@ -155,24 +153,23 @@ Display version information and a copyright message. + \fBparted\fP will compute sensible ranges for the locations you specify when using + units like "GB", "MB", etc. Use the sector unit "s" or IEC binary units like + "GiB", "MiB", to specify exact locations. +- + When you specify start or end values using IEC binary units like "MiB", + "GiB", "TiB", etc., \fBparted\fP treats those values as exact, and equivalent to + the same number specified in bytes (i.e., with the "B" suffix), in that it + provides no helpful range of sloppiness. Contrast that with a partition + start request of "4GB", which may actually resolve to some sector up to 500MB +-before or after that point. Thus, when creating a partition in an exact location +-you should use units of bytes ("B"), sectors ("s"), or IEC binary units like +-"MiB", "GiB", but not "MB", "GB", etc. ++before or after that point. Thus, when creating a partition in an exact ++location you should use units of bytes ("B"), sectors ("s"), or IEC binary units ++like "MiB", "GiB", but not "MB", "GB", etc. + .SH REPORTING BUGS + Report bugs to + .SH SEE ALSO + .BR fdisk (8), + .BR mkfs (8), + The \fIparted\fP program is fully documented in the +-.BR info(1) ++.BR info (1) + format +-.IR "GNU partitioning software" ++.I "GNU partitioning software" + manual. + .SH AUTHOR + This manual page was written by Timshel Knoll , +-- +2.49.0 + diff --git a/0012-tests-Make-sure-the-extended-partition-length-is-cor.patch b/0012-tests-Make-sure-the-extended-partition-length-is-cor.patch deleted file mode 100644 index 39b105a..0000000 --- a/0012-tests-Make-sure-the-extended-partition-length-is-cor.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 822439e4eaa4bb758d9058022154973cd690eca7 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 5 Jun 2015 13:46:29 -0700 -Subject: [PATCH] tests: Make sure the extended partition length is correct - (#1135493) - -parted tells the kernel the wrong length when reporting a resize of an -extended partition. Make sure the length is 2 for 512b sectors and 1 -sector for larger. - -(cherry picked from commit 31b5bfa4cd0b2e2944af22466e7b7d88ad94c4c9) ---- - tests/Makefile.am | 1 + - tests/t2320-dos-extended-noclobber.sh | 48 +++++++++++++++++++++++++++++++++++ - 2 files changed, 49 insertions(+) - create mode 100644 tests/t2320-dos-extended-noclobber.sh - -diff --git a/tests/Makefile.am b/tests/Makefile.am -index ce8391d..001b9de 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -47,6 +47,7 @@ TESTS = \ - t2201-pc98-label-recog.sh \ - t2300-dos-label-extended-bootcode.sh \ - t2310-dos-extended-2-sector-min-offset.sh \ -+ t2320-dos-extended-noclobber.sh \ - t2400-dos-hfs-partition-type.sh \ - t2500-probe-corrupt-hfs.sh \ - t3000-resize-fs.sh \ -diff --git a/tests/t2320-dos-extended-noclobber.sh b/tests/t2320-dos-extended-noclobber.sh -new file mode 100644 -index 0000000..6f3dfff ---- /dev/null -+++ b/tests/t2320-dos-extended-noclobber.sh -@@ -0,0 +1,48 @@ -+#!/bin/sh -+# Ensure that the extended partition reports the correct length -+# after adding another partition. -+ -+# Copyright (C) 2015 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_root_ -+require_scsi_debug_module_ -+ -+# create memory-backed device -+ss=$sector_size_ -+scsi_debug_setup_ sector_size=$ss dev_size_mb=10 > dev-name || -+ skip_ 'failed to create scsi_debug device' -+scsi_dev=$(cat dev-name) -+ -+# Create a DOS label with an extended partition and a primary partition -+parted -s $scsi_dev mklabel msdos || fail=1 -+parted -s $scsi_dev mkpart extended 1 5 > out 2>&1 || fail=1 -+parted -s $scsi_dev mkpart primary 5 10 > out 2>&1 || fail=1 -+ -+# Make sure the size of the extended partition is correct. -+# 2 sectors for 512b and 1 sector for larger. /sys/.../size is in -+# 512b blocks so convert accordingly. -+dev=${scsi_dev#/dev/} -+ext_len=$(cat /sys/block/$dev/${dev}1/size) -+if [ $ss -eq 512 ]; then -+ expected_len=2 -+else -+ expected_len=$((ss / 512)) -+fi -+[ $ext_len -eq $expected_len ] || fail=1 -+ -+Exit $fail --- -2.4.3 - diff --git a/0013-libparted-BLKPG_RESIZE_PARTITION-uses-bytes-not-sect.patch b/0013-libparted-BLKPG_RESIZE_PARTITION-uses-bytes-not-sect.patch deleted file mode 100644 index 4a1b90f..0000000 --- a/0013-libparted-BLKPG_RESIZE_PARTITION-uses-bytes-not-sect.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1174a9cca1610611ad5d8cf9f3611e9d4c984fb0 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 5 Jun 2015 14:40:00 -0700 -Subject: [PATCH 13/13] libparted: BLKPG_RESIZE_PARTITION uses bytes, not - sectors (#1135493) - -This results in the extended partition vanishing after adding another -partition. - -Resolves: rhbz#1135493 ---- - libparted/arch/linux.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index 90ab21d..e73fe1c 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -2547,7 +2547,10 @@ static int _blkpg_resize_partition (PedDisk* disk, const PedPartition *part) - if (walk->geom.start == part->geom.start+1) - linux_part.length = 1; - } -- } else linux_part.length = 1; -+ } else { -+ linux_part.length = 1; -+ } -+ linux_part.length *= disk->dev->sector_size; - } - else - linux_part.length = part->geom.length * disk->dev->sector_size; --- -2.4.0 - diff --git a/0014-parted-Fix-crash-with-name-command-and-no-disklabel-.patch b/0014-parted-Fix-crash-with-name-command-and-no-disklabel-.patch deleted file mode 100644 index 7cb8c0b..0000000 --- a/0014-parted-Fix-crash-with-name-command-and-no-disklabel-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From f5c628dd51c7d77ff939554425159ab6e8aef1c0 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Mon, 13 Jul 2015 16:43:11 -0700 -Subject: [PATCH] parted: Fix crash with name command and no disklabel - (#1226067) - -A typo (the last I think) from commit 7eac058 wasn't properly checking -the result of ped_disk_new so it could crash if there was no disklabel -on the device. ---- - parted/parted.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/parted/parted.c b/parted/parted.c -index 2678554..a9426c4 100644 ---- a/parted/parted.c -+++ b/parted/parted.c -@@ -860,7 +860,7 @@ do_name (PedDevice** dev, PedDisk** diskp) - - if (!*diskp) - *diskp = ped_disk_new (*dev); -- if (!diskp) -+ if (!*diskp) - goto error; - - if (!command_line_get_partition (_("Partition number?"), *diskp, &part)) --- -2.4.3 - diff --git a/0015-UI-Avoid-memory-leaks.patch b/0015-UI-Avoid-memory-leaks.patch deleted file mode 100644 index 91dfda8..0000000 --- a/0015-UI-Avoid-memory-leaks.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 059c9548534bef5b0312ac7089eb60e8596469be Mon Sep 17 00:00:00 2001 -From: Amarnath Valluri -Date: Fri, 31 Jul 2015 12:12:44 +0300 -Subject: [PATCH 15/18] UI: Avoid memory leaks. - -* parted/ui.c(command_line_get_sector): Don't leak input string. -* parted/ui.c(command_line_prompt_words): Don't leak _def string in - opt script mode. - -Signed-off-by: Amarnath Valluri -Signed-off-by: Brian C. Lane -(cherry picked from commit 50dc0862a94a3e6e77d4cfb2af21de117fbb4819) ---- - parted/ui.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/parted/ui.c b/parted/ui.c -index 7365e7d..505b8ac 100644 ---- a/parted/ui.c -+++ b/parted/ui.c -@@ -829,8 +829,11 @@ command_line_prompt_words (const char* prompt, const char* def, - } - - if (opt_script_mode) { -- if (_def) -+ if (_def) { - command_line_push_line (_def, 0); -+ if (_def_needs_free) -+ free (_def); -+ } - return; - } - -@@ -938,6 +941,7 @@ command_line_get_sector (const char* prompt, PedDevice* dev, PedSector* value, - if (range) { - *range = ped_geometry_new (dev, *value, 1); - free (def_str); -+ free (input); - return *range != NULL; - } - --- -2.4.3 - diff --git a/0016-libparted-Fix-memory-leaks.patch b/0016-libparted-Fix-memory-leaks.patch deleted file mode 100644 index 23cc36a..0000000 --- a/0016-libparted-Fix-memory-leaks.patch +++ /dev/null @@ -1,61 +0,0 @@ -From bb1014e4e66c6a113f208d2ede8e484f7b702a9d Mon Sep 17 00:00:00 2001 -From: Amarnath Valluri -Date: Mon, 3 Aug 2015 11:46:33 +0300 -Subject: [PATCH 16/18] libparted: Fix memory leaks - -* libparted/fs/r/hfs/hfs.c(hfsplus_resize): Don't leak embedded_geom - when volume resizing failed. -* libparted/fs/fat/fat.c(fat_create): Don't leake fs in-case of - fat_write_clustor failuer. -* libparted/arch/linux.c(_kernel_get_partition_start_and_length): Don't leak - dev_fd file descriptor. - -Signed-off-by: Amarnath Valluri -Signed-off-by: Brian C. Lane -(cherry picked from commit b70ecd7a7ef1f69b0afd5c239681decbf369f5d9) ---- - libparted/arch/linux.c | 1 + - libparted/fs/r/fat/fat.c | 2 +- - libparted/fs/r/hfs/hfs.c | 1 + - 3 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index 1d4cf17..d33c02d 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -2655,6 +2655,7 @@ _kernel_get_partition_start_and_length(PedPartition const *part, - int dev_fd = open (dev_name, O_RDONLY); - if (dev_fd != -1 && ioctl (dev_fd, HDIO_GETGEO, &geom)) { - *start = geom.start; -+ close (dev_fd); - ok = true; - } else { - if (dev_fd != -1) -diff --git a/libparted/fs/r/fat/fat.c b/libparted/fs/r/fat/fat.c -index 5aa72d8..4ecf5c5 100644 ---- a/libparted/fs/r/fat/fat.c -+++ b/libparted/fs/r/fat/fat.c -@@ -305,7 +305,7 @@ fat_create (PedGeometry* geom, FatType fat_type, PedTimer* timer) - memset (fs_info->buffer, 0, fs_info->cluster_size); - if (!fat_write_cluster (fs, fs_info->buffer, - fs_info->root_cluster)) -- return 0; -+ goto error_free_buffers; - } - - fs_info->serial_number = generate_random_uint32 (); -diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c -index a1c37cc..7109a45 100644 ---- a/libparted/fs/r/hfs/hfs.c -+++ b/libparted/fs/r/hfs/hfs.c -@@ -985,6 +985,7 @@ hfsplus_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer) - /* Resize the HFS+ volume */ - if (!hfsplus_volume_resize (fs, embedded_geom, timer_plus)) { - if (timer_plus != timer) ped_timer_destroy_nested (timer_plus); -+ if (priv_data->wrapper) ped_geometry_destroy (embedded_geom); - ped_exception_throw ( - PED_EXCEPTION_ERROR, - PED_EXCEPTION_CANCEL, --- -2.4.3 - diff --git a/0017-libparted-Fix-possible-memory-leaks.patch b/0017-libparted-Fix-possible-memory-leaks.patch deleted file mode 100644 index 525dbd2..0000000 --- a/0017-libparted-Fix-possible-memory-leaks.patch +++ /dev/null @@ -1,62 +0,0 @@ -From c01a30a6821b243cb0f497b73bb5a7b7465b6aca Mon Sep 17 00:00:00 2001 -From: Amarnath Valluri -Date: Tue, 4 Aug 2015 13:04:45 +0300 -Subject: [PATCH 17/18] libparted: Fix possible memory leaks - -* libparted/fs/r/fat/resize.c(fat_convert_directory): Possible leak - of sub_old_dir_trav or sub_new_dir_trav in error case. -* libparted/fs/r/fat/resize.c(fat_construct_converted_tree ): Possible - leak of new_trav_info or old_trav_info in error case. - -Signed-off-by: Amarnath Valluri -Signed-off-by: Brian C. Lane -(cherry picked from commit 4886bad13dd011ff56e1c46ff29e8067778c16fd) ---- - libparted/fs/r/fat/resize.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/libparted/fs/r/fat/resize.c b/libparted/fs/r/fat/resize.c -index 919acf0..b512576 100644 ---- a/libparted/fs/r/fat/resize.c -+++ b/libparted/fs/r/fat/resize.c -@@ -177,10 +177,13 @@ fat_convert_directory (FatOpContext* ctx, FatTraverseInfo* old_trav, - && old_dir_entry->name [0] != '.') { - sub_old_dir_trav - = fat_traverse_directory (old_trav, old_dir_entry); -+ if (!sub_old_dir_trav) return 0; - sub_new_dir_trav - = fat_traverse_directory (new_trav, new_dir_entry); -- if (!sub_old_dir_trav || !sub_new_dir_trav) -+ if (!sub_new_dir_trav) { -+ fat_traverse_complete (sub_old_dir_trav); - return 0; -+ } - - if (!fat_convert_directory (ctx, sub_old_dir_trav, - sub_new_dir_trav)) -@@ -315,17 +318,21 @@ fat_construct_converted_tree (FatOpContext* ctx) - if (new_fs_info->fat_type == FAT_TYPE_FAT32) { - new_trav_info = fat_traverse_begin (ctx->new_fs, - new_fs_info->root_cluster, "\\"); -+ if (!new_trav_info) return 0; - old_trav_info = fat_traverse_begin (ctx->old_fs, FAT_ROOT, - "\\"); - } else { - fat_clear_root_dir (ctx->new_fs); - new_trav_info = fat_traverse_begin (ctx->new_fs, FAT_ROOT, - "\\"); -+ if (!new_trav_info) return 0; - old_trav_info = fat_traverse_begin (ctx->old_fs, - old_fs_info->root_cluster, "\\"); - } -- if (!new_trav_info || !old_trav_info) -+ if (!old_trav_info) { -+ fat_traverse_complete (new_trav_info); - return 0; -+ } - if (!fat_convert_directory (ctx, old_trav_info, new_trav_info)) - return 0; - return 1; --- -2.4.3 - diff --git a/0018-libparted-Stop-converting-.-in-sys-path-to.patch b/0018-libparted-Stop-converting-.-in-sys-path-to.patch deleted file mode 100644 index a22738d..0000000 --- a/0018-libparted-Stop-converting-.-in-sys-path-to.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 6dc72201ff5b41c171863e6b8eb069b8f8c479cf Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 7 Aug 2015 13:59:58 -0700 -Subject: [PATCH 18/18] libparted: Stop converting . in sys path to / - -In _probe_sys_block it claimed that ! and . are replaced by / in sys -paths, but according to the kernel code only ! is replaced (for cciss -devices). - -This is now causing problems with libnvdimm devices, the details are -here: - -https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/tree/Documentation/nvdimm/nvdimm.txt?h=libnvdimm-for-next -(cherry picked from commit 579bd6878b07d8387451d36106ccf86d26818b77) ---- - libparted/arch/linux.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index d33c02d..20a7235 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -2235,9 +2235,9 @@ _probe_sys_block () - - strcpy (dev_name, "/dev/"); - strcat (dev_name, dirent->d_name); -- /* in /sys/block, '/'s are replaced with '!' or '.' */ -+ /* in /sys/block, '/'s are replaced with '!' */ - for (ptr = dev_name; *ptr != '\0'; ptr++) { -- if (*ptr == '!' || *ptr == '.') -+ if (*ptr == '!') - *ptr = '/'; - } - _ped_device_probe (dev_name); --- -2.4.3 - diff --git a/0019-libparted-Use-read-only-when-probing-devices-on-linu.patch b/0019-libparted-Use-read-only-when-probing-devices-on-linu.patch deleted file mode 100644 index 4b16f26..0000000 --- a/0019-libparted-Use-read-only-when-probing-devices-on-linu.patch +++ /dev/null @@ -1,220 +0,0 @@ -From d66b197b227e1fbd4a72f002cb8b8a7ee9461062 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 6 Aug 2015 07:17:14 -0700 -Subject: [PATCH 19/20] libparted: Use read only when probing devices on linux - (#1245144) - -When a device is opened for RW closing it can trigger other actions, -like udev scanning it for partition changes. Use read only for the -init_* methods and RW for actual changes to the device. - -This adds _device_open which takes mode flags as an argument and turns -linux_open into a wrapper for it with RW_MODE. - -_device_open_ro is added to open the device with RD_MODE and increment -the open_counter. This is used in the init_* functions. - -_device_close is a wrapper around linux_close that decrements the -open_counter and is used in the init_* functions. - -All of these changes are self-contained with no external API changes. -The only visible change in behavior is that when a new PedDevice is -created the device is opened in RO_MODE instead of RW_MODE. - -Resolves: rhbz#1245144 -(cherry picked from commit 0e169215efcdb33d588ddc2267467593bbf717c9) ---- - libparted/arch/linux.c | 62 +++++++++++++++++++++++++++++++++++--------------- - 1 file changed, 44 insertions(+), 18 deletions(-) - -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index b68130b..3934a5b 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -291,7 +291,9 @@ struct blkdev_ioctl_param { - static char* _device_get_part_path (PedDevice const *dev, int num); - static int _partition_is_mounted_by_path (const char* path); - static unsigned int _device_get_partition_range(PedDevice const* dev); -- -+static int _device_open (PedDevice* dev, int flags); -+static int _device_open_ro (PedDevice* dev); -+static int _device_close (PedDevice* dev); - - static int - _read_fd (int fd, char **buf) -@@ -910,7 +912,7 @@ init_ide (PedDevice* dev) - if (!_device_stat (dev, &dev_stat)) - goto error; - -- if (!ped_device_open (dev)) -+ if (!_device_open_ro (dev)) - goto error; - - if (ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi)) { -@@ -979,11 +981,11 @@ init_ide (PedDevice* dev) - if (!_device_probe_geometry (dev)) - goto error_close_dev; - -- ped_device_close (dev); -+ _device_close (dev); - return 1; - - error_close_dev: -- ped_device_close (dev); -+ _device_close (dev); - error: - return 0; - } -@@ -1116,7 +1118,7 @@ init_scsi (PedDevice* dev) - char* vendor; - char* product; - -- if (!ped_device_open (dev)) -+ if (!_device_open_ro (dev)) - goto error; - - if (ioctl (arch_specific->fd, SCSI_IOCTL_GET_IDLUN, &idlun) < 0) { -@@ -1130,7 +1132,7 @@ init_scsi (PedDevice* dev) - goto error_close_dev; - if (!_device_probe_geometry (dev)) - goto error_close_dev; -- ped_device_close (dev); -+ _device_close (dev); - return 1; - } - -@@ -1152,11 +1154,11 @@ init_scsi (PedDevice* dev) - if (!_device_probe_geometry (dev)) - goto error_close_dev; - -- ped_device_close (dev); -+ _device_close (dev); - return 1; - - error_close_dev: -- ped_device_close (dev); -+ _device_close (dev); - error: - return 0; - } -@@ -1168,7 +1170,7 @@ init_file (PedDevice* dev) - - if (!_device_stat (dev, &dev_stat)) - goto error; -- if (!ped_device_open (dev)) -+ if (!_device_open_ro (dev)) - goto error; - - dev->sector_size = PED_SECTOR_SIZE_DEFAULT; -@@ -1195,7 +1197,7 @@ init_file (PedDevice* dev) - goto error_close_dev; - } - -- ped_device_close (dev); -+ _device_close (dev); - - dev->bios_geom.cylinders = dev->length / 4 / 32; - dev->bios_geom.heads = 4; -@@ -1206,7 +1208,7 @@ init_file (PedDevice* dev) - return 1; - - error_close_dev: -- ped_device_close (dev); -+ _device_close (dev); - error: - return 0; - } -@@ -1222,7 +1224,7 @@ init_dasd (PedDevice* dev, const char* model_name) - if (!_device_stat (dev, &dev_stat)) - goto error; - -- if (!ped_device_open (dev)) -+ if (!_device_open_ro (dev)) - goto error; - - LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); -@@ -1262,11 +1264,11 @@ init_dasd (PedDevice* dev, const char* model_name) - - dev->model = strdup (model_name); - -- ped_device_close (dev); -+ _device_close (dev); - return 1; - - error_close_dev: -- ped_device_close (dev); -+ _device_close (dev); - error: - return 0; - } -@@ -1281,7 +1283,7 @@ init_generic (PedDevice* dev, const char* model_name) - if (!_device_stat (dev, &dev_stat)) - goto error; - -- if (!ped_device_open (dev)) -+ if (!_device_open_ro (dev)) - goto error; - - ped_exception_fetch_all (); -@@ -1329,11 +1331,11 @@ init_generic (PedDevice* dev, const char* model_name) - - dev->model = strdup (model_name); - -- ped_device_close (dev); -+ _device_close (dev); - return 1; - - error_close_dev: -- ped_device_close (dev); -+ _device_close (dev); - error: - return 0; - } -@@ -1620,12 +1622,27 @@ retry: - } - - static int -+_device_open_ro (PedDevice* dev) -+{ -+ int rc = _device_open (dev, RD_MODE); -+ if (rc) -+ dev->open_count++; -+ return rc; -+} -+ -+static int - linux_open (PedDevice* dev) - { -+ return _device_open (dev, RW_MODE); -+} -+ -+static int -+_device_open (PedDevice* dev, int flags) -+{ - LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); - - retry: -- arch_specific->fd = open (dev->path, RW_MODE); -+ arch_specific->fd = open (dev->path, flags); - - if (arch_specific->fd == -1) { - char* rw_error_msg = strerror (errno); -@@ -1694,6 +1711,15 @@ linux_refresh_close (PedDevice* dev) - return 1; - } - -+static int -+_device_close (PedDevice* dev) -+{ -+ int rc = linux_close (dev); -+ if (dev->open_count > 0) -+ dev->open_count--; -+ return rc; -+} -+ - #if SIZEOF_OFF_T < 8 - - static _syscall5(int,_llseek, --- -2.4.3 - diff --git a/0020-tests-Use-wait_for_dev_to_-functions.patch b/0020-tests-Use-wait_for_dev_to_-functions.patch deleted file mode 100644 index 1856761..0000000 --- a/0020-tests-Use-wait_for_dev_to_-functions.patch +++ /dev/null @@ -1,209 +0,0 @@ -From f72968f996372d923dbeded302395d8f08445b31 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 7 Aug 2015 11:43:17 -0700 -Subject: [PATCH 20/20] tests: Use wait_for_dev_to_ functions - -Recent changes to udev have made some long-standing problems appear more -frequently. udev executes various actions when changes are made to -devices. Sometimes this can result in device nodes not appearing -immediately. Other times it can result in EBUSY being returned. This -patch only addresses devices that are slow to appear/disappear. - -It is best to use the wait_for_dev_to_appear_ and -wait_for_dev_to_disappear_ functions than to test for existance. These -will loop and wait for up to 2 seconds for it to appear. - -This also changes t9041 to fail if mkfs doesn't work since using skip -here may hide cases when the device node doesn't appear. - -(cherry picked from commit 1dc13965e1108ab513662450e0171c3ea3af3bd1) ---- - tests/t1100-busy-label.sh | 10 ++-------- - tests/t1102-loop-label.sh | 25 +++++-------------------- - tests/t2320-dos-extended-noclobber.sh | 1 + - tests/t6001-psep.sh | 4 ++-- - tests/t6004-dm-many-partitions.sh | 6 ++---- - tests/t6006-dm-512b-sectors.sh | 1 + - tests/t6100-mdraid-partitions.sh | 5 +++-- - tests/t9041-undetected-in-use-16th-partition.sh | 2 +- - 8 files changed, 17 insertions(+), 37 deletions(-) - -diff --git a/tests/t1100-busy-label.sh b/tests/t1100-busy-label.sh -index 4e256d3..70e8ede 100755 ---- a/tests/t1100-busy-label.sh -+++ b/tests/t1100-busy-label.sh -@@ -27,22 +27,16 @@ dev=$(cat dev-name) - - parted -s "$dev" mklabel msdos mkpart primary fat32 1 40 > out 2>&1 || fail=1 - compare /dev/null out || fail=1 --mkfs.vfat ${dev}1 || skip_ "mkfs.vfat failed" -+wait_for_dev_to_appear_ ${dev}1 || fail=1 -+mkfs.vfat ${dev}1 || fail=1 - - mount_point="`pwd`/mnt" - - # Be sure to unmount upon interrupt, failure, etc. - cleanup_fn_() { umount "${dev}1" > /dev/null 2>&1; } - --# There's a race condition here: on udev-based systems, the partition#1 --# device, ${dev}1 (i.e., /dev/sdd1) is not created immediately, and --# without some delay, this mount command would fail. Using a flash card --# as $dev, the loop below typically iterates 7-20 times. -- - # create mount point dir. and mount the just-created partition on it - mkdir $mount_point || fail=1 --i=0; while :; do test -e "${dev}1" && break; test $i = 90 && break; -- i=$(expr $i + 1); done; - mount "${dev}1" $mount_point || fail=1 - - # now that a partition is mounted, mklabel attempt must fail -diff --git a/tests/t1102-loop-label.sh b/tests/t1102-loop-label.sh -index 9752002..68b9af4 100644 ---- a/tests/t1102-loop-label.sh -+++ b/tests/t1102-loop-label.sh -@@ -44,15 +44,9 @@ mv out o2 && sed -e "s,$dev,DEVICE,;s/ *$//" o2 > out - - compare exp out || fail=1 - parted -s $dev rm 1 || fail=1 --if [ -e ${dev}1 ]; then -- echo "Partition should not exist on loop device" -- fail=1 --fi -+wait_for_dev_to_disappear_ ${dev}1 2 || fail=1 - partprobe $dev || fail=1 --if [ -e ${dev}1 ]; then -- echo "Partition should not exist on loop device" -- fail=1 --fi -+wait_for_dev_to_disappear_ ${dev}1 2 || fail=1 - - mount_point="`pwd`/mnt" - -@@ -80,24 +74,15 @@ umount "$mount_point" - - # make sure partprobe cleans up stale partition devices - parted -s $dev mklabel msdos mkpart primary ext2 0% 100% || fail=1 --if [ ! -e ${dev}1 ]; then -- echo "Partition doesn't exist on loop device" -- fail=1 --fi -+wait_for_dev_to_appear_ ${dev}1 || fail=1 - - mke2fs -F $dev - partprobe $dev || fail=1 --if [ -e ${dev}1 ]; then -- echo "Partition should not exist on loop device" -- fail=1 --fi -+wait_for_dev_to_disappear_ ${dev}1 2 || fail=1 - - # make sure new loop label removes old partitions > 1 - parted -s $dev mklabel msdos mkpart primary ext2 0% 50% mkpart primary ext2 50% 100% || fail=1 - parted -s $dev mklabel loop || fail=1 --if [ -e ${dev}2 ]; then -- echo "Partition 2 not removed" -- fail=1 --fi -+wait_for_dev_to_disappear_ ${dev}2 2 || fail=1 - - Exit $fail -diff --git a/tests/t2320-dos-extended-noclobber.sh b/tests/t2320-dos-extended-noclobber.sh -index 6f3dfff..bbc4f26 100644 ---- a/tests/t2320-dos-extended-noclobber.sh -+++ b/tests/t2320-dos-extended-noclobber.sh -@@ -32,6 +32,7 @@ scsi_dev=$(cat dev-name) - parted -s $scsi_dev mklabel msdos || fail=1 - parted -s $scsi_dev mkpart extended 1 5 > out 2>&1 || fail=1 - parted -s $scsi_dev mkpart primary 5 10 > out 2>&1 || fail=1 -+wait_for_dev_to_appear_ ${scsi_dev}1 || fail=1 - - # Make sure the size of the extended partition is correct. - # 2 sectors for 512b and 1 sector for larger. /sys/.../size is in -diff --git a/tests/t6001-psep.sh b/tests/t6001-psep.sh -index f15090a..4c758e8 100644 ---- a/tests/t6001-psep.sh -+++ b/tests/t6001-psep.sh -@@ -54,7 +54,7 @@ parted -s $dev mklabel msdos mkpart primary fat32 1m 5m > out 2>&1 || fail=1 - compare /dev/null out || fail=1 - - #make sure device name is correct --test -e ${dev}p1 || fail=1 -+wait_for_dev_to_appear_ ${dev}p1 || fail=1 - - #repeat on name not ending in a digit - # setup: create a mapping -@@ -66,7 +66,7 @@ parted -s $dev mklabel msdos mkpart primary fat32 1m 5m > out 2>&1 || fail=1 - compare /dev/null out || fail=1 - - #make sure device name is correct --test -e ${dev}1 || fail=1 -+wait_for_dev_to_appear_ ${dev}1 || fail=1 - - if [ -n "$fail" ]; then - ls /dev/mapper -diff --git a/tests/t6004-dm-many-partitions.sh b/tests/t6004-dm-many-partitions.sh -index 8d291ef..7ebc48a 100755 ---- a/tests/t6004-dm-many-partitions.sh -+++ b/tests/t6004-dm-many-partitions.sh -@@ -49,10 +49,8 @@ parted -m -a min -s /dev/mapper/$dm_name mklabel gpt $cmd > /dev/null 2>&1 || fa - - # Make sure all the partitions appeared under /dev/mapper/ - for ((i=1; i<=$n_partitions; i+=1)); do -- if [ ! -e "/dev/mapper/${dm_name}p$i" ]; then -- fail=1 -- break -- fi -+ wait_for_dev_to_appear_ "/dev/mapper/${dm_name}p$i" || { fail=1; break; } -+ - # remove the partitions as we go, otherwise cleanup won't work. - dmsetup remove /dev/mapper/${dm_name}p$i - done -diff --git a/tests/t6006-dm-512b-sectors.sh b/tests/t6006-dm-512b-sectors.sh -index 31abba9..c3045af 100644 ---- a/tests/t6006-dm-512b-sectors.sh -+++ b/tests/t6006-dm-512b-sectors.sh -@@ -60,6 +60,7 @@ dev="/dev/mapper/$linear_" - # Create msdos partition table with a partition from 1MiB to 100MiB - parted -s $dev mklabel msdos mkpart primary ext2 1MiB 101MiB > out 2>&1 || fail=1 - compare /dev/null out || fail=1 -+wait_for_dev_to_appear_ ${dev}1 || fail=1 - - # The size of the partition should be 100MiB, or 204800 512b sectors - p1_size=$(blockdev --getsz ${dev}1) || framework_failure -diff --git a/tests/t6100-mdraid-partitions.sh b/tests/t6100-mdraid-partitions.sh -index 6f08442..dbc5986 100755 ---- a/tests/t6100-mdraid-partitions.sh -+++ b/tests/t6100-mdraid-partitions.sh -@@ -54,13 +54,14 @@ parted -s $md_dev mklabel gpt \ - compare /dev/null out || fail=1 - - # Verify that kernel has been informed about the second device. --grep "${md_name}p2" /proc/partitions || { fail=1; cat /proc/partitions; } -+wait_for_dev_to_appear_ ${md_dev}p2 || { fail=1; cat /proc/partitions; } - - # Remove partitions from the raid device. - parted -s $md_dev rm 2 rm 1 > out 2>&1 || fail=1 - compare /dev/null out || fail=1 - - # Verify that kernel has been informed about those removals. --grep "${md_name}p[12]" /proc/partitions && { fail=1; cat /proc/partitions; } -+wait_for_dev_to_disappear_ ${md_dev}p1 2 || { fail=1; cat /proc/partitions; } -+wait_for_dev_to_disappear_ ${md_dev}p2 2 || { fail=1; cat /proc/partitions; } - - Exit $fail -diff --git a/tests/t9041-undetected-in-use-16th-partition.sh b/tests/t9041-undetected-in-use-16th-partition.sh -index edaae1b..673e508 100644 ---- a/tests/t9041-undetected-in-use-16th-partition.sh -+++ b/tests/t9041-undetected-in-use-16th-partition.sh -@@ -72,7 +72,7 @@ wait_for_dev_to_appear_ ${scsi_dev}16 || fail_ ${scsi_dev}16 did not appear - - partitions="${scsi_dev}14 ${scsi_dev}15 ${scsi_dev}16" - for i in $partitions; do -- mkfs.ext3 $i || skip_ mkfs.ext3 $i failed -+ mkfs.ext3 $i || fail=1 - done - - # be sure to unmount upon interrupt, failure, etc. --- -2.4.3 - diff --git a/0021-fdasd-geometry-handling-updated-from-upstream-s390-t.patch b/0021-fdasd-geometry-handling-updated-from-upstream-s390-t.patch deleted file mode 100644 index f13ef02..0000000 --- a/0021-fdasd-geometry-handling-updated-from-upstream-s390-t.patch +++ /dev/null @@ -1,281 +0,0 @@ -From 4d480d980a9b69b432b8d60df3c4397ba8cdc965 Mon Sep 17 00:00:00 2001 -From: Viktor Mihajlovski -Date: Thu, 17 Sep 2015 15:33:28 +0200 -Subject: [PATCH 21/22] fdasd: geometry handling updated from upstream - s390-tools - -Remove the necessity for DASD-specific ioctls for partition handling. -This allows to correctly handle DASD-backed virtio block devices. - -Note that this is necessary because virtio is just the transport. -A DASD, even if provided via virtio, still has it's unique -characteristics, which means that only traditional DASD partition -table formats can be used (no MBR, GPT, or similar). - -Use bzero for initialization to make sure all struct members are -properly cleared. Also changed partition list handling code to be -more similar to upstream s390-tools fdasd. - -Further, enhanced error handling capabilities by providing a -return code by fdasd_get_geometry. - -Code is largely backported from s390-tools project. - -Signed-off-by: Viktor Mihajlovski -Acked-by: Stefan Haberland -Signed-off-by: Hendrik Brueckner -Signed-off-by: Brian C. Lane ---- - include/parted/fdasd.in.h | 4 +- - libparted/labels/fdasd.c | 166 ++++++++++++++++++++++++++++++++-------------- - 2 files changed, 119 insertions(+), 51 deletions(-) - -diff --git a/include/parted/fdasd.in.h b/include/parted/fdasd.in.h -index 6f6a7e0..4e351c4 100644 ---- a/include/parted/fdasd.in.h -+++ b/include/parted/fdasd.in.h -@@ -190,6 +190,8 @@ typedef struct format_data_t { - #define BLKRRPART _IO(0x12,95) - /* get block device sector size */ - #define BLKSSZGET _IO(0x12,104) -+/* device size in bytes (u64 *arg)*/ -+#define BLKGETSIZE64 _IOR(0x12,114,size_t) - /* get device geometry */ - #define HDIO_GETGEO 0x0301 - -@@ -285,7 +287,7 @@ enum fdasd_failure { - - void fdasd_cleanup (fdasd_anchor_t *anchor); - void fdasd_initialize_anchor (fdasd_anchor_t * anc); --void fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int fd); -+int fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int fd); - void fdasd_check_api_version (fdasd_anchor_t *anc, int fd); - int fdasd_check_volume (fdasd_anchor_t *anc, int fd); - int fdasd_write_labels (fdasd_anchor_t *anc, int fd); -diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c -index 1f87937..7e6a77a 100644 ---- a/libparted/labels/fdasd.c -+++ b/libparted/labels/fdasd.c -@@ -210,27 +210,7 @@ fdasd_initialize_anchor (fdasd_anchor_t * anc) - partition_info_t *p = NULL; - partition_info_t *q = NULL; - -- anc->devno = 0; -- anc->dev_type = 0; -- anc->used_partitions = 0; -- -- anc->silent = 0; -- anc->verbose = 0; -- anc->big_disk = 0; -- anc->volid_specified = 0; -- anc->config_specified = 0; -- anc->auto_partition = 0; -- anc->devname_specified = 0; -- anc->print_table = 0; -- -- anc->option_reuse = 0; -- anc->option_recreate = 0; -- -- anc->vlabel_changed = 0; -- anc->vtoc_changed = 0; -- anc->blksize = 0; -- anc->fspace_trk = 0; -- anc->label_pos = 0; -+ bzero(anc, sizeof(fdasd_anchor_t)); - - for (i=0; iused = 0x00; -- p->len_trk = 0; -- p->start_trk = 0; -- p->fspace_trk = 0; -- p->type = 0; -+ bzero(p, sizeof(partition_info_t)); - - /* add p to double pointered list */ - if (i == 1) { -- anc->first = p; -- p->prev = NULL; -+ anc->first = p; - } else if (i == USABLE_PARTITIONS) { -- anc->last = p; -- p->next = NULL; -+ anc->last = p; - p->prev = q; - q->next = p; - } else { -- p->prev = q; -- q->next = p; -+ p->prev = q; -+ q->next = p; - } - - p->f1 = malloc(sizeof(format1_label_t)); -@@ -947,15 +921,77 @@ fdasd_check_api_version (fdasd_anchor_t *anc, int f) - } - - /* -+ * The following two functions match those in the DASD ECKD device driver. -+ * They are used to compute how many records of a given size can be stored -+ * in one track. -+ */ -+static unsigned int ceil_quot(unsigned int d1, unsigned int d2) -+{ -+ return (d1 + (d2 - 1)) / d2; -+} -+ -+/* kl: key length, dl: data length */ -+static unsigned int recs_per_track(unsigned short dev_type, unsigned int kl, -+ unsigned int dl) -+{ -+ unsigned int dn, kn; -+ -+ switch (dev_type) { -+ case DASD_3380_TYPE: -+ if (kl) -+ return 1499 / (15 + 7 + ceil_quot(kl + 12, 32) + -+ ceil_quot(dl + 12, 32)); -+ else -+ return 1499 / (15 + ceil_quot(dl + 12, 32)); -+ case DASD_3390_TYPE: -+ dn = ceil_quot(dl + 6, 232) + 1; -+ if (kl) { -+ kn = ceil_quot(kl + 6, 232) + 1; -+ return 1729 / (10 + 9 + ceil_quot(kl + 6 * kn, 34) + -+ 9 + ceil_quot(dl + 6 * dn, 34)); -+ } else -+ return 1729 / (10 + 9 + ceil_quot(dl + 6 * dn, 34)); -+ case DASD_9345_TYPE: -+ dn = ceil_quot(dl + 6, 232) + 1; -+ if (kl) { -+ kn = ceil_quot(kl + 6, 232) + 1; -+ return 1420 / (18 + 7 + ceil_quot(kl + 6 * kn, 34) + -+ ceil_quot(dl + 6 * dn, 34)); -+ } else -+ return 1420 / (18 + 7 + ceil_quot(dl + 6 * dn, 34)); -+ } -+ return 0; -+} -+ -+/* -+ * Verify that number of tracks (heads) per cylinder and number of -+ * sectors per track match the expected values for a given device type -+ * and block size. -+ * Returns 1 for a valid match and 0 otherwise. -+ */ -+static int fdasd_verify_geometry(unsigned short dev_type, int blksize, -+ struct fdasd_hd_geometry *geometry) -+{ -+ unsigned int expected_sectors; -+ if (geometry->heads != 15) -+ return 0; -+ expected_sectors = recs_per_track(dev_type, 0, blksize); -+ if (geometry->sectors == expected_sectors) -+ return 1; -+ return 0; -+} -+ -+/* - * reads dasd geometry data - */ --void -+int - fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f) - { - PDEBUG - int blksize = 0; - dasd_information_t dasd_info; - struct dasd_eckd_characteristics *characteristics; -+ unsigned long long size_in_bytes; - - /* We can't get geometry from a regular file, - so simulate something usable, for the sake of testing. */ -@@ -979,6 +1015,12 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f) - anc->geo.heads; - anc->is_file = 1; - } else { -+ if (ioctl(f, BLKGETSIZE64, &size_in_bytes) != 0) { -+ fdasd_error(anc, unable_to_ioctl, -+ _("Could not retrieve disk size.")); -+ goto error; -+ } -+ - if (ioctl(f, HDIO_GETGEO, &anc->geo) != 0) - fdasd_error(anc, unable_to_ioctl, - _("Could not retrieve disk geometry information.")); -@@ -988,27 +1030,51 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f) - _("Could not retrieve blocksize information.")); - - /* get disk type */ -- if (ioctl(f, BIODASDINFO, &dasd_info) != 0) -- fdasd_error(anc, unable_to_ioctl, -- _("Could not retrieve disk information.")); -- -- characteristics = (struct dasd_eckd_characteristics *) -- &dasd_info.characteristics; -- if (characteristics->no_cyl == LV_COMPAT_CYL && -- characteristics->long_no_cyl) -- anc->hw_cylinders = characteristics->long_no_cyl; -- else -- anc->hw_cylinders = characteristics->no_cyl; -+ if (ioctl(f, BIODASDINFO, &dasd_info) != 0) { -+ /* verify that the geometry matches a 3390 DASD */ -+ if (!fdasd_verify_geometry(DASD_3390_TYPE, blksize, -+ &anc->geo)) { -+ fdasd_error(anc, wrong_disk_type, -+ _("Disk geometry does not match a " \ -+ "DASD device of type 3390.")); -+ goto error; -+ } -+ anc->dev_type = DASD_3390_TYPE; -+ anc->hw_cylinders = -+ size_in_bytes / (blksize * anc->geo.heads * anc->geo.sectors); -+ /* The VOL1 label on a CDL formatted ECKD DASD is in block 2 -+ * It will be verified later, if this position actually holds a -+ * valid label record. -+ */ -+ anc->label_pos = 2 * blksize; -+ /* A devno 0 is actually a valid devno, which could exist -+ * in the system. Since we use this number only to create -+ * a default volume serial, there is no serious conflict. -+ */ -+ anc->devno = 0; -+ } else { -+ characteristics = (struct dasd_eckd_characteristics *) -+ &dasd_info.characteristics; -+ if (characteristics->no_cyl == LV_COMPAT_CYL && -+ characteristics->long_no_cyl) -+ anc->hw_cylinders = characteristics->long_no_cyl; -+ else -+ anc->hw_cylinders = characteristics->no_cyl; -+ anc->dev_type = dasd_info.dev_type; -+ anc->label_pos = dasd_info.label_block * blksize; -+ anc->devno = dasd_info.devno; -+ anc->label_block = dasd_info.label_block; -+ anc->FBA_layout = dasd_info.FBA_layout; -+ } - - anc->is_file = 0; - } - -- anc->dev_type = dasd_info.dev_type; -- anc->blksize = blksize; -- anc->label_pos = dasd_info.label_block * blksize; -- anc->devno = dasd_info.devno; -- anc->label_block = dasd_info.label_block; -- anc->FBA_layout = dasd_info.FBA_layout; -+ anc->blksize = blksize; -+ return 1; -+ -+ error: -+ return 0; - } - - /* --- -2.4.3 - diff --git a/0022-dasd-enhance-device-probing.patch b/0022-dasd-enhance-device-probing.patch deleted file mode 100644 index e823fb3..0000000 --- a/0022-dasd-enhance-device-probing.patch +++ /dev/null @@ -1,238 +0,0 @@ -From 834713b5aee1edc004f863231dd489ee3a79f536 Mon Sep 17 00:00:00 2001 -From: Viktor Mihajlovski -Date: Thu, 17 Sep 2015 15:33:29 +0200 -Subject: [PATCH 22/22] dasd: enhance device probing - -Probe for all device/transport types as every block device -could be a DASD on s390. - -Since the calculation of the minimum and optimum alignment -is different between DASDs and common fixed block disks -we need a means other than dev->type == PED_DEVICE_DASD. -For that purpose a static function _ped_device_like_dasd() -offering a DASD detection heuristic has been added to -arch/linux.c. - -By always providing arch-specific alignment functions the -need for DASD-specific code could be removed from device.c. - -Observe fdasd_get_geometry return code for proper error -handling. - -Remove the obsolete API check as we no longer require the -DASD-specific IOCTLs. - -Signed-off-by: Viktor Mihajlovski -Acked-by: Stefan Haberland -Signed-off-by: Hendrik Brueckner -Signed-off-by: Brian C. Lane ---- - libparted/arch/linux.c | 85 ++++++++++++++++++++++++++++++++++++++++--------- - libparted/device.c | 14 +++----- - libparted/labels/dasd.c | 18 +++++------ - 3 files changed, 82 insertions(+), 35 deletions(-) - -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index adc368d..9344ceb 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -785,9 +785,13 @@ _device_set_sector_size (PedDevice* dev) - #endif - - #if defined __s390__ || defined __s390x__ -+ /* The real_sector_size is currently needed for DASD layouts, -+ * so we set it unconditionally. In the long run it should -+ * be considered to use the dev->phys_sector_size in label/dasd.c. -+ */ -+ arch_specific->real_sector_size = dev->sector_size; - /* Return PED_SECTOR_SIZE_DEFAULT for DASDs. */ - if (dev->type == PED_DEVICE_DASD) { -- arch_specific->real_sector_size = dev->sector_size; - dev->sector_size = PED_SECTOR_SIZE_DEFAULT; - } - #endif -@@ -3167,19 +3171,72 @@ linux_disk_commit (PedDisk* disk) - { - if (disk->dev->type != PED_DEVICE_FILE) { - -- /* We now require BLKPG support. If this assertion fails, -- please write to the mailing list describing your system. -- Assuming it's never triggered, ... -- FIXME: remove this assertion in 2012. */ -- assert (_have_blkpg ()); -+ /* We now require BLKPG support. If this assertion fails, -+ please write to the mailing list describing your system. -+ Assuming it's never triggered, ... -+ FIXME: remove this assertion in 2012. */ -+ assert (_have_blkpg ()); - -- if (!_disk_sync_part_table (disk)) -- return 0; -+ if (!_disk_sync_part_table (disk)) -+ return 0; - } - - 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) -@@ -3220,15 +3277,10 @@ linux_get_optimum_alignment(const PedDevice *dev) - && PED_DEFAULT_ALIGNMENT % optimal_io == 0) - || (!optimal_io && minimum_io - && PED_DEFAULT_ALIGNMENT % minimum_io == 0) -- ) { -- /* DASD needs to use minimum alignment */ -- if (dev->type == PED_DEVICE_DASD) -- return linux_get_minimum_alignment(dev); -- -+ ) - return ped_alignment_new( - blkid_topology_get_alignment_offset(tp) / dev->sector_size, - PED_DEFAULT_ALIGNMENT / dev->sector_size); -- } - - /* If optimal_io_size is 0 and we don't meet the other criteria - for using the device.c default, return the minimum alignment. */ -@@ -3255,7 +3307,10 @@ static PedDeviceArchOps linux_dev_ops = { - sync: linux_sync, - sync_fast: linux_sync_fast, - probe_all: linux_probe_all, --#if USE_BLKID -+#if defined __s390__ || defined __s390x__ -+ get_minimum_alignment: s390_get_minimum_alignment, -+ get_optimum_alignment: s390_get_optimum_alignment, -+#elif USE_BLKID - get_minimum_alignment: linux_get_minimum_alignment, - get_optimum_alignment: linux_get_optimum_alignment, - #endif -diff --git a/libparted/device.c b/libparted/device.c -index cdcc117..36fecd2 100644 ---- a/libparted/device.c -+++ b/libparted/device.c -@@ -550,16 +550,10 @@ ped_device_get_optimum_alignment(const PedDevice *dev) - /* If the arch specific code could not give as an alignment - return a default value based on the type of device. */ - if (align == NULL) { -- switch (dev->type) { -- case PED_DEVICE_DASD: -- align = ped_device_get_minimum_alignment(dev); -- break; -- default: -- /* Align to a grain of 1MiB (like vista / win7) */ -- align = ped_alignment_new(0, -- (PED_DEFAULT_ALIGNMENT -- / dev->sector_size)); -- } -+ /* Align to a grain of 1MiB (like vista / win7) */ -+ align = ped_alignment_new(0, -+ (PED_DEFAULT_ALIGNMENT -+ / dev->sector_size)); - } - - return align; -diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c -index fa9414f..bb32d66 100644 ---- a/libparted/labels/dasd.c -+++ b/libparted/labels/dasd.c -@@ -214,19 +214,13 @@ dasd_probe (const PedDevice *dev) - - PED_ASSERT(dev != NULL); - -- if (!(dev->type == PED_DEVICE_DASD -- || dev->type == PED_DEVICE_VIODASD -- || dev->type == PED_DEVICE_FILE)) -- return 0; -- - arch_specific = LINUX_SPECIFIC(dev); - - /* add partition test here */ - fdasd_initialize_anchor(&anchor); - -- fdasd_get_geometry(dev, &anchor, arch_specific->fd); -- -- fdasd_check_api_version(&anchor, arch_specific->fd); -+ if (fdasd_get_geometry(dev, &anchor, arch_specific->fd) == 0) -+ goto error_cleanup; - - /* Labels are required on CDL formatted DASDs. */ - if (fdasd_check_volume(&anchor, arch_specific->fd) && -@@ -276,7 +270,9 @@ dasd_read (PedDisk* disk) - - fdasd_initialize_anchor(&anchor); - -- fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd); -+ if (fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd) == 0) -+ goto error_close_dev; -+ - disk_specific->label_block = anchor.label_block; - - if ((anchor.geo.cylinders * anchor.geo.heads) > BIG_DISK_SIZE) -@@ -630,7 +626,9 @@ dasd_write (const PedDisk* disk) - - /* initialize the anchor */ - fdasd_initialize_anchor(&anchor); -- fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd); -+ if (fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd) == 0) -+ goto error; -+ - fdasd_check_volume(&anchor, arch_specific->fd); - memcpy(anchor.vlabel, &disk_specific->vlabel, sizeof(volume_label_t)); - anchor.vlabel_changed++; --- -2.4.3 - diff --git a/0023-parted-fix-build-error-on-s390.patch b/0023-parted-fix-build-error-on-s390.patch deleted file mode 100644 index 4b60f19..0000000 --- a/0023-parted-fix-build-error-on-s390.patch +++ /dev/null @@ -1,143 +0,0 @@ -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/0024-fdasd.c-Safeguard-against-geometry-misprobing.patch b/0024-fdasd.c-Safeguard-against-geometry-misprobing.patch deleted file mode 100644 index 8683e25..0000000 --- a/0024-fdasd.c-Safeguard-against-geometry-misprobing.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 953f340c3e24c296e9e73f4a0b45ff6563359592 Mon Sep 17 00:00:00 2001 -From: Viktor Mihajlovski -Date: Fri, 5 Feb 2016 14:47:11 +0100 -Subject: [PATCH] fdasd.c: Safeguard against geometry misprobing - -Fixes an issue with parted print being run against a logical -volume realised by extents on a physical volume residing on -a DASD. -We must make sure that geometry, device blocksize and DASD -attributes are present before we start format verifications -If any of it is missing this is not a DASD. - -Signed-off-by: Viktor Mihajlovski -Signed-off-by: Brian C. Lane ---- - libparted/labels/fdasd.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c -index 7e6a77a..968b332 100644 ---- a/libparted/labels/fdasd.c -+++ b/libparted/labels/fdasd.c -@@ -1021,13 +1021,20 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f) - goto error; - } - -- if (ioctl(f, HDIO_GETGEO, &anc->geo) != 0) -+ if (ioctl(f, HDIO_GETGEO, &anc->geo) != 0 || -+ anc->geo.heads == 0 || -+ anc->geo.sectors == 0 || -+ anc->geo.cylinders == 0 ) { - fdasd_error(anc, unable_to_ioctl, - _("Could not retrieve disk geometry information.")); -+ goto error; -+ } - -- if (ioctl(f, BLKSSZGET, &blksize) != 0) -+ if (ioctl(f, BLKSSZGET, &blksize) != 0) { - fdasd_error(anc, unable_to_ioctl, - _("Could not retrieve blocksize information.")); -+ goto error; -+ } - - /* get disk type */ - if (ioctl(f, BIODASDINFO, &dasd_info) != 0) { --- -2.5.0 - diff --git a/0025-Add-libparted-fs-resize.pc.patch b/0025-Add-libparted-fs-resize.pc.patch deleted file mode 100644 index 4d904c6..0000000 --- a/0025-Add-libparted-fs-resize.pc.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 151dd81cd1e86c1329488a892fa5df38aae132f5 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -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 - diff --git a/0026-tests-Add-udevadm-settle-to-wait_for_-loop-1260664.patch b/0026-tests-Add-udevadm-settle-to-wait_for_-loop-1260664.patch deleted file mode 100644 index 8a49b15..0000000 --- a/0026-tests-Add-udevadm-settle-to-wait_for_-loop-1260664.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 889e484922d3d5df300718ca229e12e5601e774a Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -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 - diff --git a/0027-tests-Add-wait-to-t9042-1257415.patch b/0027-tests-Add-wait-to-t9042-1257415.patch deleted file mode 100644 index ebf1415..0000000 --- a/0027-tests-Add-wait-to-t9042-1257415.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 91c2993edc47f590f1d3199976c970768fd6964c Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -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 - diff --git a/0028-tests-Fix-t1700-failing-on-a-host-with-a-4k-xfs-file.patch b/0028-tests-Fix-t1700-failing-on-a-host-with-a-4k-xfs-file.patch deleted file mode 100644 index aa5bf07..0000000 --- a/0028-tests-Fix-t1700-failing-on-a-host-with-a-4k-xfs-file.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 1fc0439a5bd27697fb5daa911f776de4a69e0ca3 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -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 - diff --git a/0029-lib-fs-resize-Prevent-crash-resizing-FAT-with-very-d.patch b/0029-lib-fs-resize-Prevent-crash-resizing-FAT-with-very-d.patch deleted file mode 100644 index 3624c8a..0000000 --- a/0029-lib-fs-resize-Prevent-crash-resizing-FAT-with-very-d.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 9a95ca5da96846f3edea48ab18c6365001805e70 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sun, 28 Feb 2016 15:36:10 +0000 -Subject: [PATCH 29/30] lib-fs-resize: Prevent crash resizing FAT with very - deep directories - -Resizing a FAT file system crashes in libparted/fs/r/fat/count.c -flag_traverse_dir() if the length of any path name in the file system -overflows the 512 byte file_name local buffer. Increase buffer to 4096, -PATH_MAX on Linux. - -Reported in -https://bugzilla.gnome.org/show_bug.cgi?id=762448 ---- - libparted/fs/r/fat/count.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libparted/fs/r/fat/count.c b/libparted/fs/r/fat/count.c -index 7949e47..a5837c0 100644 ---- a/libparted/fs/r/fat/count.c -+++ b/libparted/fs/r/fat/count.c -@@ -219,7 +219,7 @@ flag_traverse_dir (FatTraverseInfo* trav_info) { - PedFileSystem* fs = trav_info->fs; - FatDirEntry* this_entry; - FatTraverseInfo* subdir_trav_info; -- char file_name [512]; -+ char file_name [4096]; - char* file_name_start; - FatCluster first_cluster; - PedSector size; --- -2.5.0 - diff --git a/0030-tests-t3000-resize-fs.sh-Add-very-deep-directory.patch b/0030-tests-t3000-resize-fs.sh-Add-very-deep-directory.patch deleted file mode 100644 index a16e10e..0000000 --- a/0030-tests-t3000-resize-fs.sh-Add-very-deep-directory.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 599ce25c802fc1154ed619fde4249bb381430407 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sun, 28 Feb 2016 15:36:11 +0000 -Subject: [PATCH 30/30] tests: t3000-resize-fs.sh: Add very deep directory - -Create 500 deep directory tree, with longest name of 4000 characters, to -the file system being resized to test the fix to prevent crash when -resizing a FAT file system with such a long path. ---- - tests/t3000-resize-fs.sh | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh -index a79a307..608871c 100755 ---- a/tests/t3000-resize-fs.sh -+++ b/tests/t3000-resize-fs.sh -@@ -46,6 +46,13 @@ device_sectors_required=$(echo $default_end | sed 's/s$//') - # Ensure that $dev is large enough for this test - test $device_sectors_required -le $dev_n_sectors || fail=1 - -+# create mount point dir -+mount_point="`pwd`/mnt" -+mkdir "$mount_point" || fail=1 -+ -+# be sure to unmount upon interrupt, failure, etc. -+cleanup_fn_() { umount "${dev}1" > /dev/null 2>&1; } -+ - for fs_type in hfs+ fat32 fat16; do - echo "fs_type=$fs_type" - -@@ -69,6 +76,15 @@ for fs_type in hfs+ fat32 fat16; do - # create the file system - $mkfs_cmd ${dev}1 || fail=1 - -+ # create 500 deep directory tree with longest name 4000 characters -+ # to catch core dump in libparted/fs/r/fat/count.c flag_traverse_dir() -+ # overflowing 512 byte file_name local buffer. -+ mount "${dev}1" "$mount_point" || fail=1 -+ cat /dev/null > exp -+ ( cd "$mount_point"; for d in `seq 500`; do mkdir TESTDIR; cd TESTDIR; done ) > out -+ compare exp out || fail=1 # Ensure no errors creating directory tree -+ umount "${dev}1" || fail=1 -+ - # NOTE: shrinking is the only type of resizing that works. - # resize that file system to be one cylinder (8MiB) smaller - fs-resize ${dev}1 0 $new_end > out 2>&1 || fail=1 --- -2.5.0 - diff --git a/0031-Use-BLKSSZGET-to-get-device-sector-size-in-_device_p.patch b/0031-Use-BLKSSZGET-to-get-device-sector-size-in-_device_p.patch deleted file mode 100644 index b458a2d..0000000 --- a/0031-Use-BLKSSZGET-to-get-device-sector-size-in-_device_p.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 61dd3d4c5eb782eb43caa95342e63727db3f8281 Mon Sep 17 00:00:00 2001 -From: David Cantrell -Date: Thu, 17 Mar 2016 09:24:55 -0400 -Subject: [PATCH] Use BLKSSZGET to get device sector size in - _device_probe_geometry() - -Seen on certain newer devices (such as >32G SDHC memory cards), the -HDIO_GETGEO ioctl does not return useful information. The libparted -code records hardware and bios reported geometry information, but all of -that is largely unusable these days. The information is used in the -PedConstraint code for aligning partitions. The sector count is most -useful. Rather than only trying HDIO_GETGIO, first initialize the -bios_geom fields to 0 and then use BLKSSZGET to capture the sector size. -If that fails, try HDIO_GETGEO. And if that fails, raise a warning and -fall back on the library's default sector size macro. - -This problem showed up on Raspberry Pi devices where users were -attempting to grow a partition to fill the SDHC card. Using the -optimal_aligned_constraint returned invalid geometry information -(98703359 instead of 124735488 sectors). The issue was reported here: - - https://github.com/fedberry/fedberry/issues/8 - -And to the pyparted project: - - https://github.com/rhinstaller/pyparted/issues/25 - -I've applied this patch locally to parted, rebuilt, and reinstalled it -and it is working correctly for the problem SDHC cards. - -Signed-off-by: Brian C. Lane ---- - libparted/arch/linux.c | 40 +++++++++++++++++++++++++--------------- - 1 file changed, 25 insertions(+), 15 deletions(-) - -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index 1198f52..326b956 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -852,6 +852,7 @@ _device_probe_geometry (PedDevice* dev) - LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); - struct stat dev_stat; - struct hd_geometry geometry; -+ int sector_size = 0; - - if (!_device_stat (dev, &dev_stat)) - return 0; -@@ -863,26 +864,35 @@ _device_probe_geometry (PedDevice* dev) - if (!dev->length) - return 0; - -- /* The GETGEO ioctl is no longer useful (as of linux 2.6.x). We could -- * still use it in 2.4.x, but this is contentious. Perhaps we should -- * move to EDD. */ -- dev->bios_geom.sectors = 63; -- dev->bios_geom.heads = 255; -- dev->bios_geom.cylinders -- = dev->length / (63 * 255); -+ /* initialize the bios_geom values to something */ -+ dev->bios_geom.sectors = 0; -+ dev->bios_geom.heads = 0; -+ dev->bios_geom.cylinders = 0; - -- /* FIXME: what should we put here? (TODO: discuss on linux-kernel) */ -- if (!ioctl (arch_specific->fd, HDIO_GETGEO, &geometry) -+ if (!ioctl (arch_specific->fd, BLKSSZGET, §or_size)) { -+ /* get the sector count first */ -+ dev->bios_geom.sectors = 1 + (sector_size / PED_SECTOR_SIZE_DEFAULT); -+ dev->bios_geom.heads = 255; -+ } else if (!ioctl (arch_specific->fd, HDIO_GETGEO, &geometry) - && geometry.sectors && geometry.heads) { -- dev->hw_geom.sectors = geometry.sectors; -- dev->hw_geom.heads = geometry.heads; -- dev->hw_geom.cylinders -- = dev->length / (dev->hw_geom.heads -- * dev->hw_geom.sectors); -+ /* if BLKSSZGET failed, try the deprecated HDIO_GETGEO */ -+ dev->bios_geom.sectors = geometry.sectors; -+ dev->bios_geom.heads = geometry.heads; - } else { -- dev->hw_geom = dev->bios_geom; -+ ped_exception_throw ( -+ PED_EXCEPTION_WARNING, -+ PED_EXCEPTION_OK, -+ _("Could not determine sector size for %s: %s.\n" -+ "Using the default sector size (%lld)."), -+ dev->path, strerror (errno), PED_SECTOR_SIZE_DEFAULT); -+ dev->bios_geom.sectors = 2; -+ dev->bios_geom.heads = 255; - } - -+ dev->bios_geom.cylinders -+ = dev->length / (dev->bios_geom.heads -+ * dev->bios_geom.sectors); -+ dev->hw_geom = dev->bios_geom; - return 1; - } - --- -2.5.0 - diff --git a/0032-parted-fix-the-rescue-command.patch b/0032-parted-fix-the-rescue-command.patch deleted file mode 100644 index 72a9de2..0000000 --- a/0032-parted-fix-the-rescue-command.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 0b996d3ebe95fdb6704f2c1d1a82574e07e86798 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 12 Apr 2016 16:13:44 -0700 -Subject: [PATCH 32/36] parted: fix the rescue command - -The rescue command often failed to locate a filesystem due to it -leaving cylinder alignment on, which snapped the allowed bounds -of the filesystem down to the next lower cylinder boundary, -causing the detected filesystem to be rejected due to not fitting. - -(cherry picked from commit e09c30fb53179319ba1543813b5b4024e923b795) ---- - parted/parted.c | 4 ++++ - tests/Makefile.am | 1 + - tests/t1701-rescue-fs.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 57 insertions(+) - create mode 100644 tests/t1701-rescue-fs.sh - -diff --git a/parted/parted.c b/parted/parted.c -index f8c81ca..18b778c 100644 ---- a/parted/parted.c -+++ b/parted/parted.c -@@ -1472,6 +1472,10 @@ do_rescue (PedDevice** dev, PedDisk** diskp) - disk = ped_disk_new (*dev); - if (!disk) - goto error; -+ if (ped_disk_is_flag_available(disk, PED_DISK_CYLINDER_ALIGNMENT)) -+ if (!ped_disk_set_flag(disk, PED_DISK_CYLINDER_ALIGNMENT, -+ 0)) -+ goto error; - - if (!command_line_get_sector (_("Start?"), *dev, &start, NULL, NULL)) - goto error_destroy_disk; -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 001b9de..6a06dce 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -43,6 +43,7 @@ TESTS = \ - t1102-loop-label.sh \ - t1104-remove-and-add-partition.sh \ - t1700-probe-fs.sh \ -+ t1701-rescue-fs.sh \ - t2200-dos-label-recog.sh \ - t2201-pc98-label-recog.sh \ - t2300-dos-label-extended-bootcode.sh \ -diff --git a/tests/t1701-rescue-fs.sh b/tests/t1701-rescue-fs.sh -new file mode 100644 -index 0000000..9b726cf ---- /dev/null -+++ b/tests/t1701-rescue-fs.sh -@@ -0,0 +1,52 @@ -+#!/bin/sh -+# rescue ext4 file system -+ -+# Copyright (C) 2008-2014 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_ -+require_root_ -+require_scsi_debug_module_ -+ -+# create memory-backed device -+scsi_debug_setup_ sector_size=$sector_size_ dev_size_mb=32 > dev-name || -+ skip_ 'failed to create scsi_debug device' -+scsi_dev=$(cat dev-name) -+ -+( mkfs.ext4 2>&1 | grep -i '^usage' ) > /dev/null \ -+ || { warn_ "$ME: no ext4 support"; Exit $fail; } -+ -+parted -s $scsi_dev mklabel msdos mkpart primary ext2 1m 100% -+mkfs.ext4 ${scsi_dev}1 || { warn_ $ME: mkfs.ext4 failed; fail=1; Exit $fail; } -+ -+# remove the partition -+parted -s $scsi_dev rm 1 || fail=1 -+ -+# rescue the partition -+echo yes | parted ---pretend-input-tty $scsi_dev rescue 1m 100% > out 2>&1 -+cat > exp < 33.6MB. Do you want to add it to the partition table? -+Yes/No/Cancel? yes -+Information: You may need to update /etc/fstab. -+EOF -+# Transform the actual output, to avoid spurious differences when -+# $PWD contains a symlink-to-dir. Also, remove the ^M ...^M bogosity. -+# normalize the actual output -+mv out o2 && sed -e "s, * ,,g;s, $,," \ -+ -e "s,^.*/lt-parted: ,parted: ," o2 > out -+echo '' >> exp -+compare out exp || fail=1 -+Exit $fail --- -2.5.5 - diff --git a/0033-Use-disk-geometry-as-basis-for-ext2-sector-sizes.patch b/0033-Use-disk-geometry-as-basis-for-ext2-sector-sizes.patch deleted file mode 100644 index 9cb7915..0000000 --- a/0033-Use-disk-geometry-as-basis-for-ext2-sector-sizes.patch +++ /dev/null @@ -1,30 +0,0 @@ -From ac501e86dd95baa6f426cdd1395f2fe2a9c4e92a Mon Sep 17 00:00:00 2001 -From: Steven Lang -Date: Thu, 8 Jan 2015 17:22:02 -0800 -Subject: [PATCH 33/36] Use disk geometry as basis for ext2 sector sizes. - -When creating the geom for probed ext2 based filesystems, the -size was being reported in 512 byte sectors, regardless of what -the actual sector size of the device is. - -(cherry picked from commit d15a596a4436a08b9ad9db35729740b6314d536b) ---- - libparted/fs/ext2/interface.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libparted/fs/ext2/interface.c b/libparted/fs/ext2/interface.c -index 890a47b..a90c592 100644 ---- a/libparted/fs/ext2/interface.c -+++ b/libparted/fs/ext2/interface.c -@@ -41,7 +41,7 @@ _ext2_generic_probe (PedGeometry* geom, int expect_ext_ver) - struct ext2_super_block *sb = (struct ext2_super_block *)(sb_v + 1024); - - if (EXT2_SUPER_MAGIC(*sb) == EXT2_SUPER_MAGIC_CONST) { -- PedSector block_size = 1 << (EXT2_SUPER_LOG_BLOCK_SIZE(*sb) + 1); -+ PedSector block_size = (EXT2_MIN_BLOCK_SIZE << (EXT2_SUPER_LOG_BLOCK_SIZE(*sb))) / geom->dev->sector_size; - PedSector block_count = EXT2_SUPER_BLOCKS_COUNT(*sb); - PedSector group_blocks = EXT2_SUPER_BLOCKS_PER_GROUP(*sb); - PedSector group_nr = EXT2_SUPER_BLOCK_GROUP_NR(*sb); --- -2.5.5 - diff --git a/0034-docs-Add-list-of-filesystems-for-fs-type-1311596.patch b/0034-docs-Add-list-of-filesystems-for-fs-type-1311596.patch deleted file mode 100644 index 963ef9a..0000000 --- a/0034-docs-Add-list-of-filesystems-for-fs-type-1311596.patch +++ /dev/null @@ -1,29 +0,0 @@ -From d1d40cda51078a5dd8843d8c54e7e112fa028518 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Mon, 29 Feb 2016 16:47:18 -0800 -Subject: [PATCH 34/36] docs: Add list of filesystems for fs-type (#1311596) - -Add the most common filesystem types to the parted manpage. - -Resolves: rhbz#1311596 -(cherry picked from commit c9f50a36aee0a4c373b5e1bd3069aeb18fac055d) ---- - doc/C/parted.8 | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/doc/C/parted.8 b/doc/C/parted.8 -index 5304375..a45f42f 100644 ---- a/doc/C/parted.8 -+++ b/doc/C/parted.8 -@@ -76,6 +76,8 @@ should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos", - .B mkpart \fIpart-type\fP \fI[fs-type]\fP \fIstart\fP \fIend\fP - Make a \fIpart-type\fP partition for filesystem \fIfs-type\fP (if specified), - beginning at \fIstart\fP and ending at \fIend\fP (by default in megabytes). -+\fIfs-type\fP can be one of "btrfs", "ext2", "ext3", "ext4", "fat16", "fat32", -+"hfs", "hfs+", "linux-swap", "ntfs", "reiserfs", or "xfs". - \fIpart-type\fP should be one of "primary", "logical", or "extended". - .TP - .B name \fIpartition\fP \fIname\fP --- -2.5.5 - diff --git a/0035-parted-Display-details-of-partition-alignment-failur.patch b/0035-parted-Display-details-of-partition-alignment-failur.patch deleted file mode 100644 index ee44397..0000000 --- a/0035-parted-Display-details-of-partition-alignment-failur.patch +++ /dev/null @@ -1,145 +0,0 @@ -From a7d850a3b39b160dcc23e12491cb2cc7c056cd01 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Wed, 28 Oct 2015 11:57:22 -0700 -Subject: [PATCH 35/36] parted: Display details of partition alignment failure - (#726856) - -When alignment for a new partition fails it isn't always obvious why it -failed. This adds printing the reason for the failure, in the form of: - -start % grain != offset - -This modifies align-check in interactive mode to print the alignment the -error details if it isn't aligned. Script mode behavior is unchanged. - -Also cleanup pointer usage and handle asprintf failure by using a constant -string in the error report - "unknown (malloc failure)". - -(cherry picked from commit 1726dbb4cd2dc4b19fe8d3c4b94e172fc0bd2c7c) ---- - parted/parted.c | 64 +++++++++++++++++++++++++++++++++++++++++++++------------ - 1 file changed, 51 insertions(+), 13 deletions(-) - -diff --git a/parted/parted.c b/parted/parted.c -index 18b778c..06f9971 100644 ---- a/parted/parted.c -+++ b/parted/parted.c -@@ -183,7 +183,8 @@ static TimerContext timer_context; - static int _print_list (); - static void _done (PedDevice* dev, PedDisk *diskp); - static bool partition_align_check (PedDisk const *disk, -- PedPartition const *part, enum AlignmentType a_type); -+ PedPartition const *part, enum AlignmentType a_type, -+ char **align_err); - - static void - _timer_handler (PedTimer* timer, void* context) -@@ -783,21 +784,27 @@ do_mkpart (PedDevice** dev, PedDisk** diskp) - } - } - -+ char *align_err = NULL; - if ((alignment == ALIGNMENT_OPTIMAL && -- !partition_align_check(disk, part, PA_OPTIMUM)) || -+ !partition_align_check(disk, part, PA_OPTIMUM, &align_err)) || - (alignment == ALIGNMENT_MINIMAL && -- !partition_align_check(disk, part, PA_MINIMUM))) { -+ !partition_align_check(disk, part, PA_MINIMUM, &align_err))) { - if (ped_exception_throw( - PED_EXCEPTION_WARNING, - (opt_script_mode - ? PED_EXCEPTION_OK - : PED_EXCEPTION_IGNORE_CANCEL), - _("The resulting partition is not properly " -- "aligned for best performance.")) == -+ "aligned for best performance: %s"), -+ align_err ? align_err : _("unknown (malloc failed)")) == - PED_EXCEPTION_CANCEL) { -+ if (align_err) -+ free(align_err); - /* undo partition addition */ - goto error_remove_part; - } -+ if (align_err) -+ free(align_err); - } - } else { - ped_exception_leave_all(); -@@ -1629,10 +1636,18 @@ do_select (PedDevice** dev, PedDisk** diskp) - offset and alignment requirements. Also return true if there is - insufficient kernel support to determine DISK's alignment requirements. - Otherwise, return false. A_TYPE selects whether to check for minimal -- or optimal alignment requirements. */ -+ or optimal alignment requirements. -+ -+ If align_err is not NULL a string describing why the check failed -+ will be allocated and returned. It is up to the caller to free this. -+ Pass NULL if no error description is needed. -+ -+ If allocating the error string fails *align_err will be set to NULL, the -+ caller should always check for this. -+*/ - static bool - partition_align_check (PedDisk const *disk, PedPartition const *part, -- enum AlignmentType a_type) -+ enum AlignmentType a_type, char **align_err) - { - PED_ASSERT (part->disk == disk); - PedDevice const *dev = disk->dev; -@@ -1641,10 +1656,20 @@ partition_align_check (PedDisk const *disk, PedPartition const *part, - ? ped_device_get_minimum_alignment (dev) - : ped_device_get_optimum_alignment (dev)); - if (pa == NULL) -- return true; -+ return true; - - PED_ASSERT (pa->grain_size != 0); - bool ok = (part->geom.start % pa->grain_size == pa->offset); -+ -+ /* If it isn't aligned and the caller wants an explanation, -+ show them the math. */ -+ if (!ok && align_err) { -+ if (asprintf(align_err, -+ "%llds %% %llds != %llds", -+ part->geom.start, pa->grain_size, pa->offset) < 0) { -+ *align_err = NULL; -+ } -+ } - free (pa); - return ok; - } -@@ -1665,12 +1690,25 @@ do_align_check (PedDevice **dev, PedDisk** diskp) - if (!command_line_get_partition (_("Partition number?"), *diskp, &part)) - goto error; - -- bool aligned = partition_align_check (*diskp, part, align_type); -- if (!opt_script_mode) -- printf(aligned ? _("%d aligned\n") : _("%d not aligned\n"), part->num); -- -- if (opt_script_mode) -- return aligned ? 1 : 0; -+ char *align_err = NULL; -+ bool aligned = partition_align_check (*diskp, part, align_type, &align_err); -+ -+ /* Don't print the error in script mode */ -+ if (opt_script_mode) { -+ if (align_err) -+ free(align_err); -+ return aligned ? 1 : 0; -+ } -+ -+ if (aligned) -+ printf(_("%d aligned\n"), part->num); -+ else -+ printf(_("%d not aligned: %s\n"), -+ part->num, -+ align_err ? align_err : _("unknown (malloc failed)")); -+ -+ if (align_err) -+ free(align_err); - - /* Always return 1 in interactive mode, to be consistent - with the other modes. */ --- -2.5.5 - diff --git a/0036-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch b/0036-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch deleted file mode 100644 index 8f47ace..0000000 --- a/0036-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 02178bf3980410abdd57c9f1045ff27bc4f11d7e Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Mon, 11 Apr 2016 15:10:51 -0700 -Subject: [PATCH 36/36] libparted: Remove fdasd geometry code from - alloc_metadata (#1244833) - -commit db20944f changed how the trailing_metadata_end is calculated in -dasd_alloc_metadata, removing the need for setting up the anchor struct. -But dasd_alloc_metadata can be called in various contexts, and the -arch_specific->fd may or may not be valid during these calls. This can -result in unpredictable crashes when it uses a stale fd and tries to run -the file image code in fdasd_get_geometry instead of the device code. - -The solution is to just drop the unneeded code, and to remember that -arch_specific->fd should only be used when ped_device_open has first -been called. - -Resolves: rhbz#1244833 -(cherry picked from commit 9da2f460bebf9a8281fdd52536d3676b0914b8fd) ---- - libparted/labels/dasd.c | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c -index bb32d66..f79a867 100644 ---- a/libparted/labels/dasd.c -+++ b/libparted/labels/dasd.c -@@ -948,7 +948,6 @@ dasd_alloc_metadata (PedDisk* disk) - PedPartition* part = NULL; /* initialize solely to placate gcc */ - PedPartition* new_part2; - PedSector trailing_meta_start, trailing_meta_end; -- struct fdasd_anchor anchor; - - PED_ASSERT (disk != NULL); - PED_ASSERT (disk->dev != NULL); -@@ -998,10 +997,7 @@ dasd_alloc_metadata (PedDisk* disk) - backed up, then restored to a larger size disk, etc. - */ - trailing_meta_start = part->geom.end + 1; -- fdasd_initialize_anchor(&anchor); -- fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd); - trailing_meta_end = (long long) disk->dev->length - 1; -- fdasd_cleanup(&anchor); - if (trailing_meta_end >= trailing_meta_start) { - new_part2 = ped_partition_new (disk,PED_PARTITION_METADATA, - NULL, trailing_meta_start, trailing_meta_end); --- -2.5.5 - diff --git a/0037-libparted-Fix-probing-AIX-disks-on-other-arches.patch b/0037-libparted-Fix-probing-AIX-disks-on-other-arches.patch deleted file mode 100644 index 394d60b..0000000 --- a/0037-libparted-Fix-probing-AIX-disks-on-other-arches.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 85cec179048914d165e3a11b1d8d8c759725d236 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 6 May 2016 14:39:09 -0700 -Subject: [PATCH 37/38] libparted: Fix probing AIX disks on other arches - -Not a likely scenario, but make sure the magic check works everywhere. - -(cherry picked from commit 24cd71c0a7c4b2abdfff04be5a088a44ab5df2fe) ---- - libparted/labels/aix.c | 18 +++--------------- - 1 file changed, 3 insertions(+), 15 deletions(-) - -diff --git a/libparted/labels/aix.c b/libparted/labels/aix.c -index 0fa6fe7..a831d95 100644 ---- a/libparted/labels/aix.c -+++ b/libparted/labels/aix.c -@@ -34,23 +34,11 @@ - # define _(String) (String) - #endif /* ENABLE_NLS */ - --#define AIX_LABEL_MAGIC 0xc9c2d4c1 -+#define AIX_LABEL_MAGIC (0xc9c2d4c1UL) - #define MAX_TOTAL_PART 16 - - static PedDiskType aix_disk_type; - --static inline int --aix_label_magic_get (const char *label) --{ -- return *(unsigned int *)label; --} -- --static inline void --aix_label_magic_set (char *label, int magic_val) --{ -- *(unsigned int *)label = magic_val; --} -- - static int - aix_probe (const PedDevice *dev) - { -@@ -59,9 +47,9 @@ aix_probe (const PedDevice *dev) - void *label; - if (!ptt_read_sector (dev, 0, &label)) - return 0; -- unsigned int magic = aix_label_magic_get (label); -+ bool found = PED_BE32_TO_CPU(*(uint32_t *)label) == AIX_LABEL_MAGIC; - free (label); -- return magic == AIX_LABEL_MAGIC; -+ return found; - } - - static PedDisk* --- -2.5.5 - diff --git a/0038-partprobe-Open-the-device-once-for-probing.patch b/0038-partprobe-Open-the-device-once-for-probing.patch deleted file mode 100644 index 4cd4231..0000000 --- a/0038-partprobe-Open-the-device-once-for-probing.patch +++ /dev/null @@ -1,43 +0,0 @@ -From f3cbda4bf581b407586f24c980cf2e5a9cb2b4b2 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Wed, 25 May 2016 09:00:04 -0700 -Subject: [PATCH 38/38] partprobe: Open the device once for probing - -Previously there were 3 open/close pairs for the device, which may -result in triggering extra udev actions. Instead, open it once at the -start of process_dev and close it at the end. ---- - partprobe/partprobe.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/partprobe/partprobe.c b/partprobe/partprobe.c -index 34997fe..8f2190b 100644 ---- a/partprobe/partprobe.c -+++ b/partprobe/partprobe.c -@@ -105,6 +105,9 @@ process_dev (PedDevice* dev) - PedDiskType* disk_type; - PedDisk* disk; - -+ if (!ped_device_open (dev)) -+ return 0; -+ - disk_type = ped_disk_probe (dev); - if (!disk_type) { - /* Partition table not found, so create dummy, -@@ -128,11 +131,13 @@ process_dev (PedDevice* dev) - if (opt_summary) - summary (disk); - ped_disk_destroy (disk); -+ ped_device_close (dev); - return 1; - - error_destroy_disk: - ped_disk_destroy (disk); - error: -+ ped_device_close (dev); - return 0; - } - --- -2.5.5 - diff --git a/0039-Cleanup-mkpart-manpage-entry-1183077.patch b/0039-Cleanup-mkpart-manpage-entry-1183077.patch deleted file mode 100644 index e3798eb..0000000 --- a/0039-Cleanup-mkpart-manpage-entry-1183077.patch +++ /dev/null @@ -1,48 +0,0 @@ -From a5a64f34ca3d64c4da04ed6e870d4c8e469c6098 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 5 Nov 2015 15:03:54 -0800 -Subject: [PATCH 39/40] Cleanup mkpart manpage entry (#1183077) - -(cherry picked from commit fa6cd8448f68e6661fb86a8331b44198edd02c9d) ---- - doc/C/parted.8 | 8 ++++---- - doc/parted.texi | 2 +- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/doc/C/parted.8 b/doc/C/parted.8 -index a45f42f..41baa1a 100644 ---- a/doc/C/parted.8 -+++ b/doc/C/parted.8 -@@ -73,12 +73,12 @@ Create a new disklabel (partition table) of \fIlabel-type\fP. \fIlabel-type\fP - should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos", - "pc98", or "sun". - .TP --.B mkpart \fIpart-type\fP \fI[fs-type]\fP \fIstart\fP \fIend\fP --Make a \fIpart-type\fP partition for filesystem \fIfs-type\fP (if specified), --beginning at \fIstart\fP and ending at \fIend\fP (by default in megabytes). -+.B mkpart [\fIpart-type\fP \fIname\fP \fIfs-type\fP] \fIstart\fP \fIend\fP -+Create a new partition. \fIpart-type\fP may be specified only with msdos and -+dvh partition tables, it should be one of "primary", "logical", or "extended". -+\fIname\fP is required for GPT partition tables and \fIfs-type\fP is optional. - \fIfs-type\fP can be one of "btrfs", "ext2", "ext3", "ext4", "fat16", "fat32", - "hfs", "hfs+", "linux-swap", "ntfs", "reiserfs", or "xfs". --\fIpart-type\fP should be one of "primary", "logical", or "extended". - .TP - .B name \fIpartition\fP \fIname\fP - Set the name of \fIpartition\fP to \fIname\fP. This option works only on Mac, -diff --git a/doc/parted.texi b/doc/parted.texi -index 07aa702..c727fb2 100644 ---- a/doc/parted.texi -+++ b/doc/parted.texi -@@ -550,7 +550,7 @@ PCs. - @cindex mkpart, command description - @cindex command description, mkpart - --@deffn Command mkpart [@var{part-type} @var{fs-type} @var{name}] @var{start} @var{end} -+@deffn Command mkpart [@var{part-type} @var{name} @var{fs-type}] @var{start} @var{end} - - Creates a new partition, @emph{without} creating a new file system on - that partition. This is useful for creating partitions for file systems --- -2.5.5 - diff --git a/0040-doc-Add-information-about-quoting.patch b/0040-doc-Add-information-about-quoting.patch deleted file mode 100644 index a5ff968..0000000 --- a/0040-doc-Add-information-about-quoting.patch +++ /dev/null @@ -1,49 +0,0 @@ -From fd311a9367ec342b7d1fa5265f4d2167a29de30d Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 6 Nov 2015 08:56:45 -0800 -Subject: [PATCH 40/40] doc: Add information about quoting - -Some shells (bash) will strip off the " so it needs to be -wrapped in '' to prevent it. eg. - -parted -s ./disk.img mkpart '"EFI System Partition"' 1M 500M - -(cherry picked from commit 8d5e7329a6984614ac9951f376bc77ea7f822ca3) ---- - doc/C/parted.8 | 4 +++- - doc/parted.texi | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/doc/C/parted.8 b/doc/C/parted.8 -index 41baa1a..eb7cd98 100644 ---- a/doc/C/parted.8 -+++ b/doc/C/parted.8 -@@ -82,7 +82,9 @@ dvh partition tables, it should be one of "primary", "logical", or "extended". - .TP - .B name \fIpartition\fP \fIname\fP - Set the name of \fIpartition\fP to \fIname\fP. This option works only on Mac, --PC98, and GPT disklabels. The name can be placed in quotes, if necessary. -+PC98, and GPT disklabels. The name can be placed in double quotes, if necessary. -+And depending on the shell may need to also be wrapped in single quotes so that -+the shell doesn't strip off the double quotes. - .TP - .B print - Display the partition table. -diff --git a/doc/parted.texi b/doc/parted.texi -index c727fb2..1b9c084 100644 ---- a/doc/parted.texi -+++ b/doc/parted.texi -@@ -628,7 +628,9 @@ $ @kbd{mkfs.vfat /dev/sdX2} - @deffn Command name @var{number} @var{name} - - Sets the name for the partition @var{number} (GPT, Mac, MIPS and PC98 only). --The name can be placed in quotes. -+The name can be placed in quotes. And depending on the shell may need to also -+be wrapped in single quotes so that the shell doesn't strip off the double -+quotes. - - Example: - --- -2.5.5 - diff --git a/0041-libparted-dasd-correct-the-offset-where-the-first-pa.patch b/0041-libparted-dasd-correct-the-offset-where-the-first-pa.patch deleted file mode 100644 index c56f7f6..0000000 --- a/0041-libparted-dasd-correct-the-offset-where-the-first-pa.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 40270928ff4ac2a87825f47e53c680ffb18b5bc4 Mon Sep 17 00:00:00 2001 -From: Wang Dong -Date: Tue, 14 Jun 2016 12:19:40 +0200 -Subject: [PATCH 41/53] libparted/dasd: correct the offset where the first - partition begins - -The start point of first partition must start at least from the third -track of DASD, due to the existence of metadata in the first two track. -The previous constraint just sets all the device to be partitioned. -So when the start point of the first partition start before the third -track, (For example if it starts from.0) parted will exit abruptly. -And this kind of job must be done with constraint explicitly. - -Then the constraint is modified to exclude the first two tracks and -to make the first partition start from the third track by default. - -Signed-off-by: Wang Dong -Reviewed-by: Viktor Mihajlovski -Signed-off-by: Hendrik Brueckner -Signed-off-by: Brian C. Lane -(cherry picked from commit 4126d0292c75cf7d50a2f4e9d485a52b5beafccc) ---- - libparted/labels/dasd.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c -index f79a867..4e68512 100644 ---- a/libparted/labels/dasd.c -+++ b/libparted/labels/dasd.c -@@ -829,6 +829,7 @@ _primary_constraint (PedDisk* disk) - PedSector sector_size; - LinuxSpecific* arch_specific; - DasdDiskSpecific* disk_specific; -+ PedSector start; - - PDEBUG; - -@@ -842,7 +843,12 @@ _primary_constraint (PedDisk* disk) - if (!ped_alignment_init (&end_align, -1, - disk->dev->hw_geom.sectors * sector_size)) - return NULL; -- if (!ped_geometry_init (&max_geom, disk->dev, 0, disk->dev->length)) -+ -+ start = (FIRST_USABLE_TRK * (long long) disk->dev->hw_geom.sectors -+ * (long long) arch_specific->real_sector_size -+ / (long long) disk->dev->sector_size); -+ -+ if (!ped_geometry_init (&max_geom, disk->dev, start, disk->dev->length)) - return NULL; - - return ped_constraint_new(&start_align, &end_align, &max_geom, --- -2.7.4 - diff --git a/0042-Add-support-for-NVMe-devices.patch b/0042-Add-support-for-NVMe-devices.patch deleted file mode 100644 index 0abce18..0000000 --- a/0042-Add-support-for-NVMe-devices.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 797d7b90c677e49552fbe7c526ce849b964e1ffe Mon Sep 17 00:00:00 2001 -From: Petr Uzel -Date: Tue, 14 Jun 2016 13:17:00 +0200 -Subject: [PATCH 42/53] Add support for NVMe devices - -Recognize NVMe Devices, so "parted -s /dev/nvme0n1" now prints -"NVMe Device (nvme)" instead of "Model: Unknown (unknown)". - -In order for a device to be recognized as NVMe, it has to -have a 'blkext' major number. But since this major can be -used also by other device types, we also check the device -path contains 'nvme' as a substring. - -* NEWS: Mention the change -* include/parted/device.h.in(PedDeviceType): Add PED_DEVICE_NVME -* libparted/arch/linux.c(BLKEXT_MAJOR): New define. -* libparted/arch/linux.c(_is_blkext_major): New function. -* libparted/arch/linux.c(_device_probe_type): Recognize NVMe devices. -* libparted/arch/linux.c(linux_new): Handle NVMe devices. -* parted/parted.c(do_print): Add "nvme" to list of transports. - -Signed-off-by: Brian C. Lane -(cherry picked from commit e4ae4330f3e33201aeeed3b7ca88e15d98d03e13) ---- - include/parted/device.in.h | 3 ++- - libparted/arch/linux.c | 14 ++++++++++++++ - parted/parted.c | 2 +- - 3 files changed, 17 insertions(+), 2 deletions(-) - -diff --git a/include/parted/device.in.h b/include/parted/device.in.h -index 82d4104..d38db44 100644 ---- a/include/parted/device.in.h -+++ b/include/parted/device.in.h -@@ -49,7 +49,8 @@ typedef enum { - PED_DEVICE_VIRTBLK = 15, - PED_DEVICE_AOE = 16, - PED_DEVICE_MD = 17, -- PED_DEVICE_LOOP = 18 -+ PED_DEVICE_LOOP = 18, -+ PED_DEVICE_NVME = 19 - } PedDeviceType; - - typedef struct _PedDevice PedDevice; -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index eb01deb..b7ba5de 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -278,6 +278,7 @@ struct blkdev_ioctl_param { - #define SDMMC_MAJOR 179 - #define LOOP_MAJOR 7 - #define MD_MAJOR 9 -+#define BLKEXT_MAJOR 259 - - #define SCSI_BLK_MAJOR(M) ( \ - (M) == SCSI_DISK0_MAJOR \ -@@ -441,6 +442,12 @@ _is_virtblk_major (int major) - return _major_type_in_devices (major, "virtblk"); - } - -+static int -+_is_blkext_major (int major) -+{ -+ return _major_type_in_devices (major, "blkext"); -+} -+ - #ifdef ENABLE_DEVICE_MAPPER - static int - _dm_task_run_wait (struct dm_task *task, uint32_t cookie) -@@ -692,6 +699,8 @@ _device_probe_type (PedDevice* dev) - dev->type = PED_DEVICE_LOOP; - } else if (dev_major == MD_MAJOR) { - dev->type = PED_DEVICE_MD; -+ } else if (_is_blkext_major(dev_major) && dev->path && strstr(dev->path, "nvme")) { -+ dev->type = PED_DEVICE_NVME; - } else { - dev->type = PED_DEVICE_UNKNOWN; - } -@@ -1465,6 +1474,11 @@ linux_new (const char* path) - goto error_free_arch_specific; - break; - -+ case PED_DEVICE_NVME: -+ if (!init_generic (dev, _("NVMe Device"))) -+ goto error_free_arch_specific; -+ break; -+ - case PED_DEVICE_ATARAID: - if (!init_generic (dev, _("ATARAID Controller"))) - goto error_free_arch_specific; -diff --git a/parted/parted.c b/parted/parted.c -index 06f9971..bd848c3 100644 ---- a/parted/parted.c -+++ b/parted/parted.c -@@ -979,7 +979,7 @@ _print_disk_info (const PedDevice *dev, const PedDisk *diskp) - "cpqarray", "file", "ataraid", "i2o", - "ubd", "dasd", "viodasd", "sx8", "dm", - "xvd", "sd/mmc", "virtblk", "aoe", -- "md", "loopback"}; -+ "md", "loopback", "nvme"}; - - char* start = ped_unit_format (dev, 0); - PedUnit default_unit = ped_unit_get_default (); --- -2.7.4 - diff --git a/0043-docs-Improve-partition-description-in-parted.texi.patch b/0043-docs-Improve-partition-description-in-parted.texi.patch deleted file mode 100644 index 30052d5..0000000 --- a/0043-docs-Improve-partition-description-in-parted.texi.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 22a2fd360f5f0f8e7e522712a6187b1c6ac74ba7 Mon Sep 17 00:00:00 2001 -From: Gareth Randall -Date: Fri, 30 Sep 2016 10:07:42 -0700 -Subject: [PATCH 43/53] docs: Improve partition description in parted.texi - -(cherry picked from commit e27ac8ff6706f67817f68246311899bd920b9c88) ---- - doc/parted.texi | 36 +++++++++++++++++++++++++++++++----- - 1 file changed, 31 insertions(+), 5 deletions(-) - -diff --git a/doc/parted.texi b/doc/parted.texi -index 1b9c084..414179d 100644 ---- a/doc/parted.texi -+++ b/doc/parted.texi -@@ -291,12 +291,38 @@ or you want to modify a root or boot partition, use GParted Live: - @section Introduction to Partitioning - @cindex partitioning overview - --Unfortunately, partitioning your disk is rather complicated. This is --because there are interactions between many different systems that need --to be taken into consideration. -+Partitioning is the process of dividing a storage device into local -+sections, called partitions, which help organize multiple filesystems -+and their associated operating systems. -+ -+A storage device presents itself as a sequence of bytes, numbered -+starting from zero and increasing until the maximum capacity of the -+device is reached. Bytes are normally read and written a sector at a -+time, rather than individually. Each sector contains a fixed number -+of bytes, with the number determined by the device. -+ -+@example -++------------------------------------------------------------+ -+| storage device with no partitions | -++------------------------------------------------------------+ -+0 start end -+@end example -+ -+In order to store multiple filesystems, a storage device can be divided -+up in to multiple partitions. Each partition can be thought of as an -+area which contains a real filesystem inside of it. To show where these -+partitions are on the device a small table is written at the start, -+shown as PT in the diagram below. This table is called a partition -+table, or disklabel, and also stores the type of each partition and -+some flags. -+ -+@example -++--+---------------+----------------+------------------------+ -+|PT| Partition 1 | Partition 2 | Partition 3 | -++--+---------------+----------------+------------------------+ -+0 start end -+@end example - --This manual used to introduce the reader to these systems and their --working. This content has moved to the GNU Storage Guide. - - @node Running Parted - @section Using GNU Parted --- -2.7.4 - diff --git a/0044-libparted-only-IEC-units-are-treated-as-exact.patch b/0044-libparted-only-IEC-units-are-treated-as-exact.patch deleted file mode 100644 index cdf1084..0000000 --- a/0044-libparted-only-IEC-units-are-treated-as-exact.patch +++ /dev/null @@ -1,82 +0,0 @@ -From e4bf9b823452c0b98b394b8abcc67f887b6991b3 Mon Sep 17 00:00:00 2001 -From: Petr Uzel -Date: Thu, 21 Jul 2016 16:46:46 +0200 -Subject: [PATCH 44/53] libparted: only IEC units are treated as exact - -If the user specifies start/end of the partition as a unit, -whose size happens to be power of two, we treat that as -exact address with exact placement. - -Recently, commit 01900e056ec25083 added an exception for -percent units. - -This logic however can fail also for cylinders, e.g. on DASD FBA disks, -which report CHS=(*, 128, 16) geometry, hence once cylinder is 1 MiB. -With cylinders as units, exact placement is not what the user wants. - -Instead of adding cylinders to the blacklist, let's instead -whitelist units which should trigger exact placement. - -* libparted/unit.c (is_power_of_2): Remove now unused function. -(ped_unit_parse_custom): Specify which units trigger exact placement. -* NEWS (Bug Fixes): Mention this. - -(cherry picked from commit f4f38082fc4dbf0c28ccc7613c672fe279d3032e) ---- - libparted/unit.c | 33 +++++++++++++++++---------------- - 1 file changed, 17 insertions(+), 16 deletions(-) - -diff --git a/libparted/unit.c b/libparted/unit.c -index dddb5db..e47e868 100644 ---- a/libparted/unit.c -+++ b/libparted/unit.c -@@ -481,12 +481,6 @@ parse_unit_suffix (const char* suffix, PedUnit suggested_unit) - return suggested_unit; - } - --static bool --is_power_of_2 (long long n) --{ -- return (n & (n - 1)) == 0; --} -- - /** - * If \p str contains a valid description of a location on \p dev, then - * \p *sector is modified to describe the location and a geometry is created -@@ -540,16 +534,23 @@ ped_unit_parse_custom (const char* str, const PedDevice* dev, PedUnit unit, - } - - unit_size = ped_unit_get_size (dev, unit); -- radius = (ped_div_round_up (unit_size, dev->sector_size) / 2) - 1; -- if (radius < 0) -- radius = 0; -- /* If the user specifies units in a power of 2, e.g., 4MiB, as in -- parted -s -- $dev mklabel gpt mkpart P-NAME 4MiB -34s -- do not use 4MiB as the range. Rather, presume that they -- are specifying precisely the starting or ending number, -- and treat "4MiB" just as we would treat "4194304B". */ -- if (is_power_of_2 (unit_size) && unit != PED_UNIT_PERCENT) -- radius = 0; -+ switch (unit) { -+ /* If the user specifies the address using IEC units e.g., 4MiB, as in -+ parted -s -- $dev mklabel gpt mkpart P-NAME 4MiB -34s -+ do not use size of the unit as the range. Rather, presume that they -+ are specifying precisely the starting or ending number, -+ and treat "4MiB" just as we would treat "4194304B". */ -+ case PED_UNIT_KIBIBYTE: -+ case PED_UNIT_MEBIBYTE: -+ case PED_UNIT_GIBIBYTE: -+ case PED_UNIT_TEBIBYTE: -+ radius = 0; -+ break; -+ default: -+ radius = (ped_div_round_up (unit_size, dev->sector_size) / 2) - 1; -+ if (radius < 0) -+ radius = 0; -+ } - - *sector = num * unit_size / dev->sector_size; - /* negative numbers count from the end */ --- -2.7.4 - diff --git a/0045-tests-t3310-flags.sh-Query-libparted-for-all-flags-t.patch b/0045-tests-t3310-flags.sh-Query-libparted-for-all-flags-t.patch deleted file mode 100644 index 9fa912c..0000000 --- a/0045-tests-t3310-flags.sh-Query-libparted-for-all-flags-t.patch +++ /dev/null @@ -1,188 +0,0 @@ -From 450dbead63306b242e8159c85641698bddf6d19e Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sat, 1 Oct 2016 16:40:16 +0100 -Subject: [PATCH 45/53] tests: t3310-flags.sh: Query libparted for all flags to - be tested - -Replace scanning the documentation for an incomplete list of flags with -querying libparted for the complete list of supported flags via the -added helper print-flags. - -Correct $ME -> $ME_ in the warning messages. Improve the warning -messages by including the table type and flag name not correctly set or -cleared. - -Plus minor changes: -(1) use slightly longer variable name primary_or_name; -(2) use longer test partition name PTNNAME; and -(3) stop shortening parted unit command to u. - -Signed-off-by: Brian C. Lane ---- - tests/Makefile.am | 3 ++- - tests/print-flags.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - tests/t3310-flags.sh | 32 ++++++++++++++++-------------- - 3 files changed, 75 insertions(+), 16 deletions(-) - create mode 100644 tests/print-flags.c - -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 6a06dce..a840304 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -92,7 +92,8 @@ EXTRA_DIST = \ - init.cfg init.sh t-lib-helpers.sh gpt-header-munge \ - gpt-header-move msdos-overlap - --check_PROGRAMS = print-align print-max dup-clobber duplicate fs-resize -+check_PROGRAMS = print-align print-flags print-max dup-clobber duplicate \ -+ fs-resize - fs_resize_LDADD = \ - $(top_builddir)/libparted/fs/libparted-fs-resize.la \ - $(top_builddir)/libparted/libparted.la -diff --git a/tests/print-flags.c b/tests/print-flags.c -new file mode 100644 -index 0000000..3176ca6 ---- /dev/null -+++ b/tests/print-flags.c -@@ -0,0 +1,56 @@ -+/* Print the available flags for a particular partition. */ -+ -+#include -+#include -+#include -+#include -+#include "progname.h" -+ -+int -+main (int argc, char **argv) -+{ -+ PedDevice *dev; -+ PedDisk *disk; -+ PedPartition *part; -+ -+ set_program_name (argv[0]); -+ -+ if (argc != 2 ) { -+ fprintf (stderr, "Usage: %s \n", argv[0]); -+ return EXIT_FAILURE; -+ } -+ -+ dev = ped_device_get(argv[1]); -+ if (!dev) { -+ fprintf (stderr, "Error: failed to create device %s\n", -+ argv[1]); -+ return EXIT_FAILURE; -+ } -+ if (!ped_device_open (dev)) { -+ fprintf (stderr, "Error: failed to open device %s\n", argv[1]); -+ return EXIT_FAILURE; -+ } -+ disk = ped_disk_new (dev); -+ if (!disk) { -+ fprintf (stderr, -+ "Error: failed to read partition table from device %s\n", -+ argv[1]); -+ return EXIT_FAILURE; -+ } -+ -+ part = ped_disk_get_partition (disk, 1); -+ if (!part) { -+ fprintf (stderr, -+ "Error: failed to get partition 1 from device %s\n", -+ argv[1]); -+ return EXIT_FAILURE; -+ } -+ -+ for (PedPartitionFlag flag = PED_PARTITION_FIRST_FLAG; -+ flag <= PED_PARTITION_LAST_FLAG; flag++) -+ { -+ if (ped_partition_is_flag_available (part, flag)) -+ puts (ped_partition_flag_get_name (flag)); -+ } -+ return EXIT_SUCCESS; -+} -diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh -index cb3024a..85a673a 100644 ---- a/tests/t3310-flags.sh -+++ b/tests/t3310-flags.sh -@@ -1,5 +1,5 @@ - #!/bin/sh --# Exercise the exclusive, single-bit flags. -+# Exercise partition flags. - - # Copyright (C) 2010-2014 Free Software Foundation, Inc. - -@@ -16,35 +16,37 @@ - # 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 -+. "${srcdir=.}/init.sh"; path_prepend_ ../parted . - ss=$sector_size_ - dev=dev-file - - extract_flags() - { -- perl -nle '/^1:2048s:4095s:2048s::(?:P1)?:(.+);$/ and print $1' "$@" -+ perl -nle '/^1:2048s:4095s:2048s::(?:PTNNAME)?:(.+);$/ and print $1' "$@" - } - - for table_type in msdos gpt; do - -- # Extract flag names of type $table_type from the texinfo documentation. - case $table_type in -- msdos) search_term=MS-DOS; pri_or_name=pri;; -- gpt) search_term=GPT; pri_or_name=P1;; -+ gpt) primary_or_name='PTNNAME' -+ ;; -+ msdos) primary_or_name='primary' -+ ;; - esac -- flags=$(sed -n '/^@node set/,/^@node/p' \ -- "$abs_top_srcdir/doc/parted.texi" \ -- | perl -00 -ne \ -- '/^\@item (\w+).*'"$search_term"'/s and print lc($1), "\n"') - - n_sectors=5000 - dd if=/dev/null of=$dev bs=$ss seek=$n_sectors || fail=1 - - parted -s $dev mklabel $table_type \ -- mkpart $pri_or_name ext2 $((1*2048))s $((2*2048-1))s \ -+ mkpart $primary_or_name ext2 $((1*2048))s $((2*2048-1))s \ - > out 2> err || fail=1 - compare /dev/null out || fail=1 - -+ # Query libparted for the available flags for this test partition. -+ flags=`print-flags $dev` \ -+ || { warn_ "$ME_: $table_type: failed to get available flags"; -+ fail=1; continue; } -+ - for mode in on_only on_and_off ; do - for flag in $flags; do - -@@ -53,18 +55,18 @@ for table_type in msdos gpt; do - case $flag in boot|lba|hidden) continue;; esac - - # Turn on each flag, one at a time. -- parted -m -s $dev set 1 $flag on u s print > raw 2> err || fail=1 -+ parted -m -s $dev set 1 $flag on unit s print > raw 2> err || fail=1 - extract_flags raw > out - grep -F "$flag" out \ -- || { warn_ "$ME: flag not turned on: $(cat out)"; fail=1; } -+ || { warn_ "$ME_: $table_type: flag '$flag' not turned on: $(cat out)"; fail=1; } - compare /dev/null err || fail=1 - - if test $mode = on_and_off; then - # Turn it off -- parted -m -s $dev set 1 $flag off u s print > raw 2> err || fail=1 -+ parted -m -s $dev set 1 $flag off unit s print > raw 2> err || fail=1 - extract_flags raw > out - grep -F "$flag" out \ -- && { warn_ "$ME: flag not turned off: $(cat out)"; fail=1; } -+ && { warn_ "$ME_: $table_type: flag '$flag' not turned off: $(cat out)"; fail=1; } - compare /dev/null err || fail=1 - fi - done --- -2.7.4 - diff --git a/0046-tests-t3310-flags.sh-Stop-excluding-certain-flags-fr.patch b/0046-tests-t3310-flags.sh-Stop-excluding-certain-flags-fr.patch deleted file mode 100644 index e5be802..0000000 --- a/0046-tests-t3310-flags.sh-Stop-excluding-certain-flags-fr.patch +++ /dev/null @@ -1,47 +0,0 @@ -From cfcfadac1d61093f900d1903f580818d244479ad Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sat, 1 Oct 2016 16:40:17 +0100 -Subject: [PATCH 46/53] tests: t3310-flags.sh: Stop excluding certain flags - from being tested - -Also grep for whole words, grep -w, to avoid flag 'boot' being matched -as a substring of flag 'legacy_boot'. - -Signed-off-by: Brian C. Lane ---- - tests/t3310-flags.sh | 9 ++------- - 1 file changed, 2 insertions(+), 7 deletions(-) - -diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh -index 85a673a..5cbf2da 100644 ---- a/tests/t3310-flags.sh -+++ b/tests/t3310-flags.sh -@@ -49,15 +49,10 @@ for table_type in msdos gpt; do - - for mode in on_only on_and_off ; do - for flag in $flags; do -- -- # Exclude the supplemental flags. -- # These are not boolean, like the others. -- case $flag in boot|lba|hidden) continue;; esac -- - # Turn on each flag, one at a time. - parted -m -s $dev set 1 $flag on unit s print > raw 2> err || fail=1 - extract_flags raw > out -- grep -F "$flag" out \ -+ grep -w "$flag" out \ - || { warn_ "$ME_: $table_type: flag '$flag' not turned on: $(cat out)"; fail=1; } - compare /dev/null err || fail=1 - -@@ -65,7 +60,7 @@ for table_type in msdos gpt; do - # Turn it off - parted -m -s $dev set 1 $flag off unit s print > raw 2> err || fail=1 - extract_flags raw > out -- grep -F "$flag" out \ -+ grep -w "$flag" out \ - && { warn_ "$ME_: $table_type: flag '$flag' not turned off: $(cat out)"; fail=1; } - compare /dev/null err || fail=1 - fi --- -2.7.4 - diff --git a/0047-tests-t3310-flags.sh-Add-test-for-bsd-table-flags.patch b/0047-tests-t3310-flags.sh-Add-test-for-bsd-table-flags.patch deleted file mode 100644 index df52fe2..0000000 --- a/0047-tests-t3310-flags.sh-Add-test-for-bsd-table-flags.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d7bcb49f1313da7deae0ca41ab402980fb3094a4 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sat, 1 Oct 2016 16:40:18 +0100 -Subject: [PATCH 47/53] tests: t3310-flags.sh: Add test for bsd table flags - -Signed-off-by: Brian C. Lane ---- - tests/t3310-flags.sh | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh -index 5cbf2da..3f80213 100644 ---- a/tests/t3310-flags.sh -+++ b/tests/t3310-flags.sh -@@ -25,9 +25,11 @@ extract_flags() - perl -nle '/^1:2048s:4095s:2048s::(?:PTNNAME)?:(.+);$/ and print $1' "$@" - } - --for table_type in msdos gpt; do -+for table_type in bsd gpt msdos; do - - case $table_type in -+ bsd) primary_or_name='' -+ ;; - gpt) primary_or_name='PTNNAME' - ;; - msdos) primary_or_name='primary' --- -2.7.4 - diff --git a/0048-libparted-Fix-to-report-success-when-setting-lvm-fla.patch b/0048-libparted-Fix-to-report-success-when-setting-lvm-fla.patch deleted file mode 100644 index f66d772..0000000 --- a/0048-libparted-Fix-to-report-success-when-setting-lvm-fla.patch +++ /dev/null @@ -1,33 +0,0 @@ -From fa15f7d65ad76872f9019f34dd2a1db0f678b0f9 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sat, 1 Oct 2016 16:40:19 +0100 -Subject: [PATCH 48/53] libparted: Fix to report success when setting lvm flag - on bsd table - -bsd_partition_set_flag() was falling through in the lvm flag case and -returning failure. Fix this by adding missing return 1 (success) like -for the other flags. - -Found as a result of this bug reported by Timo Riikonen: -https://bugzilla.gnome.org/show_bug.cgi?id=769831 - -Signed-off-by: Brian C. Lane ---- - libparted/labels/bsd.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libparted/labels/bsd.c b/libparted/labels/bsd.c -index a8525a4..23daea8 100644 ---- a/libparted/labels/bsd.c -+++ b/libparted/labels/bsd.c -@@ -488,6 +488,7 @@ bsd_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state) - bsd_data->raid = 0; - } - bsd_data->lvm = state; -+ return 1; - default: - ; - } --- -2.7.4 - diff --git a/0049-libparted-Remove-commented-local-variable-from-bsd_p.patch b/0049-libparted-Remove-commented-local-variable-from-bsd_p.patch deleted file mode 100644 index da4e9bd..0000000 --- a/0049-libparted-Remove-commented-local-variable-from-bsd_p.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fe6d1478172071779135001e494afffb993a9068 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sat, 1 Oct 2016 16:40:20 +0100 -Subject: [PATCH 49/53] libparted: Remove commented local variable from - bsd_partition_set_flag() - -Signed-off-by: Brian C. Lane ---- - libparted/labels/bsd.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/libparted/labels/bsd.c b/libparted/labels/bsd.c -index 23daea8..f253a32 100644 ---- a/libparted/labels/bsd.c -+++ b/libparted/labels/bsd.c -@@ -464,7 +464,6 @@ bsd_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type) - static int - bsd_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state) - { --// PedPartition* walk; // since -Werror, this unused variable would break build - BSDPartitionData* bsd_data; - - PED_ASSERT (part != NULL); --- -2.7.4 - diff --git a/0050-tests-t3310-flags.sh-Add-test-for-mac-table-flags.patch b/0050-tests-t3310-flags.sh-Add-test-for-mac-table-flags.patch deleted file mode 100644 index c57e935..0000000 --- a/0050-tests-t3310-flags.sh-Add-test-for-mac-table-flags.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 81b397bbc9eb270ef0b3ed52d40c3a76ecd9ac80 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sat, 1 Oct 2016 16:40:21 +0100 -Subject: [PATCH 50/53] tests: t3310-flags.sh: Add test for mac table flags - -MAC partition table reserves partition 1 for the partition map -partition, so the created test partition will be number 2. Adapt -accordingly. - -Setting flags 'root' and 'swap' also sets the partition name to 'root' -and 'swap' respectively, so no longer match the partition name in -extract_flags(). - -Don't test lvm and raid flags as they fail to be cleared with a single -set off command. See FIXME comment in the test for more details. - -Signed-off-by: Brian C. Lane ---- - tests/print-flags.c | 12 +++++++----- - tests/t3310-flags.sh | 27 ++++++++++++++++++++++----- - 2 files changed, 29 insertions(+), 10 deletions(-) - -diff --git a/tests/print-flags.c b/tests/print-flags.c -index 3176ca6..db088e8 100644 ---- a/tests/print-flags.c -+++ b/tests/print-flags.c -@@ -12,11 +12,12 @@ main (int argc, char **argv) - PedDevice *dev; - PedDisk *disk; - PedPartition *part; -+ int partnum; - - set_program_name (argv[0]); - -- if (argc != 2 ) { -- fprintf (stderr, "Usage: %s \n", argv[0]); -+ if (argc != 3 ) { -+ fprintf (stderr, "Usage: %s \n", argv[0]); - return EXIT_FAILURE; - } - -@@ -38,11 +39,12 @@ main (int argc, char **argv) - return EXIT_FAILURE; - } - -- part = ped_disk_get_partition (disk, 1); -+ partnum = atoi (argv[2]); -+ part = ped_disk_get_partition (disk, partnum); - if (!part) { - fprintf (stderr, -- "Error: failed to get partition 1 from device %s\n", -- argv[1]); -+ "Error: failed to get partition %d from device %s\n", -+ partnum, argv[1]); - return EXIT_FAILURE; - } - -diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh -index 3f80213..672160d 100644 ---- a/tests/t3310-flags.sh -+++ b/tests/t3310-flags.sh -@@ -22,16 +22,22 @@ dev=dev-file - - extract_flags() - { -- perl -nle '/^1:2048s:4095s:2048s::(?:PTNNAME)?:(.+);$/ and print $1' "$@" -+ perl -nle '/^[^:]*:2048s:4095s:2048s::[^:]*:(.+);$/ and print $1' "$@" - } - --for table_type in bsd gpt msdos; do -+for table_type in bsd gpt mac msdos; do -+ ptn_num=1 - - case $table_type in - bsd) primary_or_name='' - ;; - gpt) primary_or_name='PTNNAME' - ;; -+ mac) primary_or_name='PTNNAME' -+ # MAC table has the partition map partition as the first -+ # partition so the created test partition will be number 2. -+ ptn_num=2 -+ ;; - msdos) primary_or_name='primary' - ;; - esac -@@ -45,14 +51,25 @@ for table_type in bsd gpt msdos; do - compare /dev/null out || fail=1 - - # Query libparted for the available flags for this test partition. -- flags=`print-flags $dev` \ -+ flags=`print-flags $dev $ptn_num` \ - || { warn_ "$ME_: $table_type: failed to get available flags"; - fail=1; continue; } -+ case $table_type in -+ mac) # FIXME: Setting root or swap flags also sets the partition -+ # name to root or swap respectively. Probably intended -+ # behaviour. Setting lvm or raid flags after root or swap -+ # takes two goes to clear the lvm or raid flag. Is this -+ # intended? For now don't test lvm or raid flags as this -+ # test only tries to clear the flags once which causes this -+ # test to fail. -+ flags=`echo "$flags" | egrep -v 'lvm|raid'` -+ ;; -+ esac - - for mode in on_only on_and_off ; do - for flag in $flags; do - # Turn on each flag, one at a time. -- parted -m -s $dev set 1 $flag on unit s print > raw 2> err || fail=1 -+ parted -m -s $dev set $ptn_num $flag on unit s print > raw 2> err || fail=1 - extract_flags raw > out - grep -w "$flag" out \ - || { warn_ "$ME_: $table_type: flag '$flag' not turned on: $(cat out)"; fail=1; } -@@ -60,7 +77,7 @@ for table_type in bsd gpt msdos; do - - if test $mode = on_and_off; then - # Turn it off -- parted -m -s $dev set 1 $flag off unit s print > raw 2> err || fail=1 -+ parted -m -s $dev set $ptn_num $flag off unit s print > raw 2> err || fail=1 - extract_flags raw > out - grep -w "$flag" out \ - && { warn_ "$ME_: $table_type: flag '$flag' not turned off: $(cat out)"; fail=1; } --- -2.7.4 - diff --git a/0051-tests-t3310-flags.sh-Add-test-for-dvh-table-flags.patch b/0051-tests-t3310-flags.sh-Add-test-for-dvh-table-flags.patch deleted file mode 100644 index a92a5a2..0000000 --- a/0051-tests-t3310-flags.sh-Add-test-for-dvh-table-flags.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 797dbba3bb86178e17ccac46d3619936f75df1d4 Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sat, 1 Oct 2016 16:40:22 +0100 -Subject: [PATCH 51/53] tests: t3310-flags.sh: Add test for dvh table flags - -DVH table reserves the first 4 MiB for the volume header information so -move the created test partition to immediately after that. - -Exclude testing the boot flag as that can only be set on logical -partitions and this test script only uses primary partitions so far. - -Signed-off-by: Brian C. Lane ---- - tests/t3310-flags.sh | 15 +++++++++++---- - 1 file changed, 11 insertions(+), 4 deletions(-) - -diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh -index 672160d..e449589 100644 ---- a/tests/t3310-flags.sh -+++ b/tests/t3310-flags.sh -@@ -22,15 +22,17 @@ dev=dev-file - - extract_flags() - { -- perl -nle '/^[^:]*:2048s:4095s:2048s::[^:]*:(.+);$/ and print $1' "$@" -+ perl -nle '/^[^:]*:4096s:6143s:2048s::[^:]*:(.+);$/ and print $1' "$@" - } - --for table_type in bsd gpt mac msdos; do -+for table_type in bsd dvh gpt mac msdos; do - ptn_num=1 - - case $table_type in - bsd) primary_or_name='' - ;; -+ dvh) primary_or_name='primary' -+ ;; - gpt) primary_or_name='PTNNAME' - ;; - mac) primary_or_name='PTNNAME' -@@ -42,11 +44,11 @@ for table_type in bsd gpt mac msdos; do - ;; - esac - -- n_sectors=5000 -+ n_sectors=8192 - dd if=/dev/null of=$dev bs=$ss seek=$n_sectors || fail=1 - - parted -s $dev mklabel $table_type \ -- mkpart $primary_or_name ext2 $((1*2048))s $((2*2048-1))s \ -+ mkpart $primary_or_name ext2 $((4*1024))s $((6*1024-1))s \ - > out 2> err || fail=1 - compare /dev/null out || fail=1 - -@@ -55,6 +57,11 @@ for table_type in bsd gpt mac msdos; do - || { warn_ "$ME_: $table_type: failed to get available flags"; - fail=1; continue; } - case $table_type in -+ dvh) # FIXME: Exclude boot flag as that can only be set on logical -+ # partitions in the DVH disk label and this test only uses -+ # primary partitions. -+ flags=`echo "$flags" | egrep -v 'boot'` -+ ;; - mac) # FIXME: Setting root or swap flags also sets the partition - # name to root or swap respectively. Probably intended - # behaviour. Setting lvm or raid flags after root or swap --- -2.7.4 - diff --git a/0052-tests-t3310-flags.sh-Add-tests-for-remaining-table-t.patch b/0052-tests-t3310-flags.sh-Add-tests-for-remaining-table-t.patch deleted file mode 100644 index a2b5051..0000000 --- a/0052-tests-t3310-flags.sh-Add-tests-for-remaining-table-t.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 1bd5c463377b0e54dc3bed840906a8df37bf6f7e Mon Sep 17 00:00:00 2001 -From: Mike Fleetwood -Date: Sat, 1 Oct 2016 16:40:23 +0100 -Subject: [PATCH 52/53] tests: t3310-flags.sh: Add tests for remaining table - types - -Add test of flags for remaining table types: aix, amiga, pc98, sun and -loop. Note that support of writing AIX tables is not yet implemented in -parted and LOOP tables don't support partitions nor flags. - -Signed-off-by: Brian C. Lane ---- - tests/t3310-flags.sh | 16 +++++++++++++++- - 1 file changed, 15 insertions(+), 1 deletion(-) - -diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh -index e449589..e97c3b9 100644 ---- a/tests/t3310-flags.sh -+++ b/tests/t3310-flags.sh -@@ -25,10 +25,16 @@ extract_flags() - perl -nle '/^[^:]*:4096s:6143s:2048s::[^:]*:(.+);$/ and print $1' "$@" - } - --for table_type in bsd dvh gpt mac msdos; do -+for table_type in aix amiga bsd dvh gpt mac msdos pc98 sun loop; do - ptn_num=1 - - case $table_type in -+ aix) # Support for writing AIX disk labels and adding partitions -+ # is not yet implemented. -+ continue -+ ;; -+ amiga) primary_or_name='PTNNAME' -+ ;; - bsd) primary_or_name='' - ;; - dvh) primary_or_name='primary' -@@ -42,6 +48,14 @@ for table_type in bsd dvh gpt mac msdos; do - ;; - msdos) primary_or_name='primary' - ;; -+ pc98) primary_or_name='PTNNAME' -+ ;; -+ sun) primary_or_name='' -+ ;; -+ loop) # LOOP table doesn't support creation of a partition nor any -+ # flags. -+ continue -+ ;; - esac - - n_sectors=8192 --- -2.7.4 - diff --git a/0053-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch b/0053-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch deleted file mode 100644 index eeee176..0000000 --- a/0053-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch +++ /dev/null @@ -1,31 +0,0 @@ -From a5f1b41b0a10fc1dc64f17b677ddf14e15f8d40e Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 23 Aug 2016 08:55:18 -0700 -Subject: [PATCH 53/53] tests: Set optimal blocks to 64 for scsi_debug devices - -The Linux kernel 4.5 changed the optimal blocks count from 64 to 1024 -This causes tests using scsi_debug devices to fail because of alignment -issues. Set the opt_blks to 64 so that we have consistent behavior -across kernels. - -(cherry picked from commit bd2664285e4014d2d4c80cee3e87609272e1fca9) ---- - tests/t-local.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/t-local.sh b/tests/t-local.sh -index a7d5226..13073d2 100644 ---- a/tests/t-local.sh -+++ b/tests/t-local.sh -@@ -98,7 +98,7 @@ scsi_debug_setup_() - # It is not trivial to determine the name of the device we're creating. - # Record the names of all /sys/block/sd* devices *before* probing: - touch stamp -- modprobe scsi_debug "$@" || { rm -f stamp; return 1; } -+ modprobe scsi_debug opt_blks=64 "$@" || { rm -f stamp; return 1; } - scsi_debug_modprobe_succeeded_=1 - test "$VERBOSE" = yes \ - && echo $ME_ modprobe scsi_debug succeeded 1>&2 --- -2.7.4 - diff --git a/0054-tests-t3310-flags.sh-skip-pc98-when-sector-size-512.patch b/0054-tests-t3310-flags.sh-skip-pc98-when-sector-size-512.patch deleted file mode 100644 index 5b993e3..0000000 --- a/0054-tests-t3310-flags.sh-skip-pc98-when-sector-size-512.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a6ba22e539ae5836326703cf4e6d549f6628b861 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 4 Oct 2016 16:11:25 -0700 -Subject: [PATCH] tests: t3310-flags.sh skip pc98 when sector size != 512 - ---- - tests/t3310-flags.sh | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh -index e97c3b9..10ac50d 100644 ---- a/tests/t3310-flags.sh -+++ b/tests/t3310-flags.sh -@@ -49,6 +49,8 @@ for table_type in aix amiga bsd dvh gpt mac msdos pc98 sun loop; do - msdos) primary_or_name='primary' - ;; - pc98) primary_or_name='PTNNAME' -+ # pc98 only supports 512b sectors -+ [ $ss -ne 512 ] && continue - ;; - sun) primary_or_name='' - ;; --- -2.7.4 - diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..0c1cc35 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy +product_versions: + - fedora-* +decision_contexts: [bodhi_update_push_stable] +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/parted.spec b/parted.spec index 0455185..7948ba4 100644 --- a/parted.spec +++ b/parted.spec @@ -1,97 +1,51 @@ -%define _sbindir /sbin -%define _libdir /%{_lib} - Summary: The GNU disk partition manipulation program Name: parted -Version: 3.2 -Release: 24%{?dist} -License: GPLv3+ -Group: Applications/System +Version: 3.6 +Release: 13%{?dist} +License: GPL-3.0-or-later URL: http://www.gnu.org/software/parted Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz Source1: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig -Source2: pubkey.jim.meyering -Source3: pubkey.phillip.susi +Source2: pubkey.phillip.susi +Source3: pubkey.brian.lane -Patch0001: 0001-tests-Try-several-UTF8-locales.patch -Patch0002: 0002-maint-post-release-administrivia.patch -Patch0003: 0003-libparted-also-link-to-UUID_LIBS.patch -Patch0004: 0004-lib-fs-resize-Prevent-crash-resizing-FAT16-file-syst.patch -Patch0005: 0005-tests-t3000-resize-fs.sh-Add-FAT16-resizing-test.patch -Patch0006: 0006-tests-t3000-resize-fs.sh-Add-requirement-on-mkfs.vfa.patch -Patch0007: 0007-tests-Change-minimum-size-to-256MiB.patch -Patch0008: 0008-parted-don-t-crash-in-disk_set-when-disk-label-not-f.patch -Patch0009: 0009-tests-Add-a-test-for-device-mapper-partition-sizes.patch -Patch0010: 0010-libparted-device-mapper-uses-512b-sectors.patch -Patch0011: 0011-Update-manpage-NAME-so-whatis-will-work.patch -Patch0012: 0012-tests-Make-sure-the-extended-partition-length-is-cor.patch -Patch0013: 0013-libparted-BLKPG_RESIZE_PARTITION-uses-bytes-not-sect.patch -Patch0014: 0014-parted-Fix-crash-with-name-command-and-no-disklabel-.patch -Patch0015: 0015-UI-Avoid-memory-leaks.patch -Patch0016: 0016-libparted-Fix-memory-leaks.patch -Patch0017: 0017-libparted-Fix-possible-memory-leaks.patch -Patch0018: 0018-libparted-Stop-converting-.-in-sys-path-to.patch -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 -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 -Patch0029: 0029-lib-fs-resize-Prevent-crash-resizing-FAT-with-very-d.patch -Patch0030: 0030-tests-t3000-resize-fs.sh-Add-very-deep-directory.patch -Patch0031: 0031-Use-BLKSSZGET-to-get-device-sector-size-in-_device_p.patch -Patch0032: 0032-parted-fix-the-rescue-command.patch -Patch0033: 0033-Use-disk-geometry-as-basis-for-ext2-sector-sizes.patch -Patch0034: 0034-docs-Add-list-of-filesystems-for-fs-type-1311596.patch -Patch0035: 0035-parted-Display-details-of-partition-alignment-failur.patch -Patch0036: 0036-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch -Patch0037: 0037-libparted-Fix-probing-AIX-disks-on-other-arches.patch -Patch0038: 0038-partprobe-Open-the-device-once-for-probing.patch -Patch0039: 0039-Cleanup-mkpart-manpage-entry-1183077.patch -Patch0040: 0040-doc-Add-information-about-quoting.patch -Patch0041: 0041-libparted-dasd-correct-the-offset-where-the-first-pa.patch -Patch0042: 0042-Add-support-for-NVMe-devices.patch -Patch0043: 0043-docs-Improve-partition-description-in-parted.texi.patch -Patch0044: 0044-libparted-only-IEC-units-are-treated-as-exact.patch -Patch0045: 0045-tests-t3310-flags.sh-Query-libparted-for-all-flags-t.patch -Patch0046: 0046-tests-t3310-flags.sh-Stop-excluding-certain-flags-fr.patch -Patch0047: 0047-tests-t3310-flags.sh-Add-test-for-bsd-table-flags.patch -Patch0048: 0048-libparted-Fix-to-report-success-when-setting-lvm-fla.patch -Patch0049: 0049-libparted-Remove-commented-local-variable-from-bsd_p.patch -Patch0050: 0050-tests-t3310-flags.sh-Add-test-for-mac-table-flags.patch -Patch0051: 0051-tests-t3310-flags.sh-Add-test-for-dvh-table-flags.patch -Patch0052: 0052-tests-t3310-flags.sh-Add-tests-for-remaining-table-t.patch -Patch0053: 0053-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch -Patch0054: 0054-tests-t3310-flags.sh-skip-pc98-when-sector-size-512.patch -Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch0001: 0001-parted-Print-the-Fixing.-message-to-stderr.patch +Patch0002: 0002-doc-Document-IEC-unit-behavior-in-the-manpage.patch +Patch0003: 0003-libparted-Fail-early-when-detecting-nilfs2.patch +Patch0004: 0004-bug-74444-PATCH-parted-fix-do_version-declaration.patch +Patch0005: 0005-libparted-Fix-sun-disklabel-unhandled-exception.patch +Patch0006: 0006-tests-Add-test-for-SUN-disklabel-handling.patch +Patch0007: 0007-libparted-Fix-dvh-disklabel-unhandled-exception.patch +Patch0008: 0008-tests-Add-test-for-dvh-with-a-bad-checksum.patch +Patch0009: 0009-tests-probing-ext4-without-journal-should-still-indi.patch +Patch0010: 0010-libparted-Do-not-detect-ext4-without-journal-as-ext2.patch +Patch0011: 0011-nilfs2-Fixed-possible-sigsegv-in-case-of-corrupted-s.patch +Patch0012: 0012-doc-Fix-some-groff-mandoc-linting-complaints.patch + +BuildRequires: gcc BuildRequires: e2fsprogs-devel BuildRequires: readline-devel BuildRequires: ncurses-devel BuildRequires: gettext-devel BuildRequires: texinfo BuildRequires: device-mapper-devel -BuildRequires: libselinux-devel BuildRequires: libuuid-devel BuildRequires: libblkid-devel >= 2.17 -BuildRequires: gnupg +BuildRequires: gnupg2 BuildRequires: git -BuildRequires: autoconf automake +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool BuildRequires: e2fsprogs BuildRequires: xfsprogs BuildRequires: dosfstools BuildRequires: perl-Digest-CRC BuildRequires: bc -Buildrequires: python2 - -Requires(post): /sbin/ldconfig -Requires(post): /sbin/install-info -Requires(preun): /sbin/install-info -Requires(postun): /sbin/ldconfig +BuildRequires: python3 +BuildRequires: gperf +BuildRequires: make +BuildRequires: check-devel # bundled gnulib library exception, as per packaging guidelines # https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries @@ -106,7 +60,6 @@ to new hard disks. %package devel Summary: Files for developing apps which will manipulate disk partitions -Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkgconfig @@ -118,32 +71,23 @@ Parted library, you need to install this package. %prep -%setup -q -gpg --import %{SOURCE2} %{SOURCE3} -gpg --verify %{SOURCE1} %{SOURCE0} -git init -git config user.email "parted-owner@fedoraproject.org" -git config user.name "Fedora Ninjas" -git add . -git commit -a -q -m "%{version} baseline." -[ -n "%{patches}" ] && git am %{patches} +%{gpgverify} --keyring='%{SOURCE3}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%autosetup -S git_am iconv -f ISO-8859-1 -t UTF8 AUTHORS > tmp; touch -r AUTHORS tmp; mv tmp AUTHORS -git commit -a -m "run iconv" %build -autoreconf -autoconf +autoreconf -fiv CFLAGS="$RPM_OPT_FLAGS -Wno-unused-but-set-variable"; export CFLAGS -%configure --enable-selinux --disable-static --disable-gcc-warnings +%configure --disable-static --disable-gcc-warnings # Don't use rpath! %{__sed} -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool %{__sed} -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool -V=1 %{__make} %{?_smp_mflags} +%make_build %install %{__rm} -rf %{buildroot} -%{__make} install DESTDIR=%{buildroot} +%make_install # Remove components we do not ship %{__rm} -rf %{buildroot}%{_libdir}/*.la @@ -158,42 +102,21 @@ V=1 %{__make} %{?_smp_mflags} export LD_LIBRARY_PATH=$(pwd)/libparted/.libs:$(pwd)/libparted/fs/.libs make check - -%clean -%{__rm} -rf %{buildroot} - - -%post -/sbin/ldconfig -if [ -f %{_infodir}/parted.info.gz ]; then - /sbin/install-info %{_infodir}/parted.info.gz %{_infodir}/dir || : -fi - -%preun -if [ $1 = 0 ]; then - /sbin/install-info --delete %{_infodir}/parted.info.gz %{_infodir}/dir >/dev/null 2>&1 || : -fi - -%postun -p /sbin/ldconfig - - %files -f %{name}.lang -%defattr(-,root,root,-) %doc AUTHORS NEWS README THANKS %{!?_licensedir:%global license %%doc} %license COPYING %{_sbindir}/parted %{_sbindir}/partprobe -%{_mandir}/man8/parted.8.gz -%{_mandir}/man8/partprobe.8.gz +%{_mandir}/man8/parted.8* +%{_mandir}/man8/partprobe.8* %{_libdir}/libparted.so.2 -%{_libdir}/libparted.so.2.0.1 +%{_libdir}/libparted.so.2.0.5 %{_libdir}/libparted-fs-resize.so.0 -%{_libdir}/libparted-fs-resize.so.0.0.1 -%{_infodir}/parted.info.gz +%{_libdir}/libparted-fs-resize.so.0.0.5 +%{_infodir}/parted.info* %files devel -%defattr(-,root,root,-) %doc TODO doc/API doc/FAT %{_includedir}/parted %{_libdir}/libparted.so @@ -203,1169 +126,101 @@ fi %changelog -* Sat Feb 11 2017 Fedora Release Engineering - 3.2-24 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild +* Thu Jul 24 2025 Fedora Release Engineering - 3.6-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild -* Thu Jan 12 2017 Igor Gnatenko - 3.2-23 -- Rebuild for readline 7.x +* Fri May 30 2025 Brian C. Lane - 3.6-12 +- doc: Fix some groff/mandoc linting complaints (bcl) +- nilfs2: Fixed possible sigsegv in case of corrupted superblock (abutenko) +- libparted: Do not detect ext4 without journal as ext2 (pascal) +- tests: probing ext4 without journal should still indicate ext4 (bcl) -* Tue Oct 04 2016 Brian C. Lane - 3.2-22 -- tests: t3310-flags.sh: skip pc98 when sector size != 512 (bcl) -- tests: Set optimal blocks to 64 for scsi_debug devices (bcl) -- tests: t3310-flags.sh: Add tests for remaining table types (mike.fleetwood) -- tests: t3310-flags.sh: Add test for dvh table flags (mike.fleetwood) -- tests: t3310-flags.sh: Add test for mac table flags (mike.fleetwood) -- libparted: Remove commented local variable from bsd_partition_set_flag() - (mike.fleetwood) -- libparted: Fix to report success when setting lvm flag on bsd table - (mike.fleetwood) -- tests: t3310-flags.sh: Add test for bsd table flags (mike.fleetwood) -- tests: t3310-flags.sh: Stop excluding certain flags from being tested - (mike.fleetwood) -- tests: t3310-flags.sh: Query libparted for all flags to be tested - (mike.fleetwood) -- libparted: only IEC units are treated as exact (petr.uzel) -- docs: Improve partition description in parted.texi (gareth.randall) -- Add support for NVMe devices (petr.uzel) -- libparted/dasd: correct the offset where the first partition begins - (dongdwdw) +* Fri Jan 17 2025 Fedora Release Engineering - 3.6-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild -* Wed Jun 15 2016 Brian C. Lane - 3.2-21 -- Cleanup mkpart manpage entry (#1183077) -- doc: Add information about quoting +* Wed Jan 15 2025 Brian C. Lane - 3.6-10 +- tests: Add test for dvh with a bad checksum (bcl) +- libparted: Fix dvh disklabel unhandled exception (bcl) +- tests: Add test for SUN disklabel handling (bcl) +- libparted: Fix sun disklabel unhandled exception (bcl) -* Thu May 26 2016 Brian C. Lane - 3.2-20 -- libparted: Fix probing AIX disks on other arches -- partprobe: Open the device once for probing +* Wed Nov 20 2024 Brian C. Lane - 3.6-9 +- parted: Fix do_version declaration (rudi) -* Tue Apr 12 2016 Brian C. Lane 3.2-19 -- libparted: Remove fdasd geometry code from alloc_metadata (#1244833) (bcl) -- parted: Display details of partition alignment failure (#726856) (bcl) -- docs: Add list of filesystems for fs-type (#1311596) (bcl) -- Use disk geometry as basis for ext2 sector sizes. (Steven.Lang) -- parted: fix the rescue command (psusi) +* Thu Oct 17 2024 Brian C. Lane - 3.6-8 +- libparted: Fail early when detecting nilfs2 (oldium.pro) -* Tue Mar 29 2016 Brian C. Lane 3.2-18 -- Use BLKSSZGET to get device sector size in _device_probe_geometry() +* Fri Aug 23 2024 Brian C. Lane - 3.6-7 +- tests: Move to tmt tests and switch to a functional test (bcl) -* Mon Mar 07 2016 Brian C. Lane 3.2-17 -- lib-fs-resize: Prevent crash resizing FAT with very deep directories -- Add libparted/fs/.libs/ to LD_LIBRARY_PATH during make check +* Thu Jul 18 2024 Fedora Release Engineering - 3.6-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild -* Mon Feb 29 2016 Brian C. Lane 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 Jul 16 2024 Brian C. Lane - 3.6-5 +- doc: Document IEC unit behavior in the manpage (bcl) +- parted: Print the Fixing... message to stderr (bcl) -* Tue Feb 09 2016 Brian C. Lane 3.2-15 -- fdasd.c Safeguard against geometry misprobing.patch (#1305931) +* Thu Jan 25 2024 Fedora Release Engineering - 3.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Thu Feb 04 2016 Fedora Release Engineering - 3.2-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild +* Sun Jan 21 2024 Fedora Release Engineering - 3.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Thu Oct 29 2015 Brian C. Lane 3.2-13 -- parted: fix build error on s390 +* Thu Jul 20 2023 Fedora Release Engineering - 3.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild -* Tue Oct 27 2015 Brian C. Lane 3.2-12 -- dasd: enhance device probing -- fdasd: geometry handling updated from upstream s390-tools +* Mon Apr 10 2023 Brian C. Lane - 3.6-1 +- Upstream 3.6 stable release +- Dropping pre-3.5 changelog entries -* Fri Aug 07 2015 Brian C. Lane 3.2-11 -- tests: Fix patch 0012 test for extended partition length -- UI: Avoid memory leaks -- libparted: Fix memory leaks.patch -- libparted: Fix possible memory leaks.patch -- libparted: Stop converting . in-sys-path-to / -- libparted: Use read-only when probing devices on linux -- tests: Use wait_for_dev_to_ functions +* Mon Mar 27 2023 Brian C. Lane - 3.5.28-1 +- Upstream 3.5.28 Alpha release +- Dropped all patches included in new upstream release +- Bumped minor version on libparted.so and libparted-fs-resize.so -* Mon Jul 13 2015 Brian C. Lane 3.2-10 -- parted: Fix crash with name command and no disklabel (#1226067) +* Fri Mar 17 2023 Brian C. Lane - 3.5-11 +- parted: Fix ending sector location when using kibi IEC suffix (bcl) +- tests: Fix formatting and snprintf warnings in tests. (bcl) +- ui: Add checks for prompt being NULL (bcl) +- strlist: Handle realloc error in wchar_to_str (bcl) +- libparted: Fix potential NULL dereference in ped_disk_next_partition (bcl) +- filesys: Check for null from close_fn (bcl) -* Thu Jun 18 2015 Fedora Release Engineering - 3.2-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild +* Tue Feb 07 2023 Brian C. Lane - 3.5-10 +- libparted: Fix problem with creating 1s partitions +- tests: Fixing libparted test framework usage -* Fri Jun 05 2015 Brian C. Lane 3.2-8 -- tests: Make sure the extended partition length is 2 (#1135493) -- libparted: BLKPG_RESIZE_PARTITION uses bytes not sectors (#1135493) +* Mon Jan 30 2023 Brian C. Lane - 3.5-9 +- SPDX migration -* Tue Apr 28 2015 Brian C. Lane 3.2-7 -- Add python2 as a BuildRequires, used in some of the tests +* Thu Jan 19 2023 Fedora Release Engineering - 3.5-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild -* Tue Apr 28 2015 Brian C. Lane 3.2-6 -- Update manpage NAME so whatis will work (bcl) -- libparted: device mapper uses 512b sectors (bcl) -- tests: Add a test for device-mapper partition sizes (bcl) -- parted: don't crash in disk_set when disk label not found (psusi) +* Wed Dec 14 2022 Brian C. Lane - 3.5-7 +- libparted: Fix handling of msdos partition types +- tests: Add a libparted test for ped_partition_set_system on msdos +- parted: Add display of GPT UUIDs in JSON output +- Add no_automount flag support +- increase xfs size to 300M -* Fri Nov 07 2014 Brian C. Lane 3.2-5 -- tests: Change minimum size to 256MiB for t1700-probe-fs +* Mon Aug 08 2022 Brian C. Lane - 3.5-6 +- Fix ped_partition_set_system handling of existing flags -* Fri Oct 31 2014 Brian C. Lane 3.2-4 -- Update to current master commit ac74b83 to fix fat16 resize (#1159083) -- tests: t3000-resize-fs.sh: Add requirement on mkfs.vfat (mike.fleetwood) -- tests: t3000-resize-fs.sh: Add FAT16 resizing test (mike.fleetwood) -- lib-fs-resize: Prevent crash resizing FAT16 file systems (mike.fleetwood) -- libparted: also link to UUID_LIBS (heirecka) +* Thu Aug 04 2022 Brian C. Lane - 3.5-5 +- Update enum patch description for upstream -* Sun Aug 17 2014 Fedora Release Engineering - 3.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild +* Fri Jul 22 2022 Fedora Release Engineering - 3.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild -* Wed Aug 13 2014 Brian C. Lane 3.2-2 -- Use a better patch to find the UTF8 locale for t0251 +* Mon Jun 20 2022 Adam Williamson - 3.5-3 +- Set _FIRST_ and _LAST_ macro values directly -* Wed Jul 30 2014 Brian C. Lane 3.2-1 -- Rebase on upstream stable release v3.2 -- Drop upstream patches. -- Patch t0251 to use en_US.UTF-8 if possible. Fedora doesn't have C.UTF-8 +* Tue May 17 2022 Brian C. Lane - 3.5-2 +- tests: t3200-type-change now passes (bcl) +- parted: Reset the filesystem type when changing the id/uuid (bcl) +- libparted: add swap flag for DASD label (aschnell) +- parted: add type command (aschnell) +- maint: post-release administrivia (bcl) -* Wed Jul 30 2014 Tom Callaway 3.1.90-2 -- fix license handling - -* Mon Jul 28 2014 Brian C. Lane 3.1.90-1 -- Rebase on upstream Alpha source release -- drop included patches (all but one) -- add Phillip Susi's GPG key -- make sure gcc warnings as errors remains disabled since we use git for patches - -* Mon Jul 14 2014 Brian C. Lane 3.1-29 -- Rebase on parted master commit 081ed98 -- libparted: Add support for partition resize -- parted: add resizepart command - -* Wed Jun 11 2014 Brian C. Lane 3.1-28 -- Rebase on parted master commit 1da239e2ebd2 -- libparted: Fix bug with dupe and empty name - -* Fri Jun 06 2014 Fedora Release Engineering - 3.1-27 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Sat May 31 2014 Peter Robinson 3.1-26 -- Move dev docs to devel -- Drop duplicated/outdated docs - -* Tue May 27 2014 Brian C. Lane 3.1-25 -- Use mkfs.xfs to create files (#1101112) - -* Thu May 22 2014 Brian C. Lane 3.1-24 -- Add some missing patches from master and the loop label fixes -- tests: test loop labels (psusi) -- libparted: don't trash filesystem when writing loop label (psusi) -- libparted: give correct partition device name on loop labels (psusi) -- partprobe: do not skip loop labels (psusi) -- libparted: don't create partition on loop label (psusi) -- libparted: fix loop labels to not vanish (psusi) -- libparted: remove all old partitions, even if new label allows less (psusi) -- libparted: remove old partitions *first* before adding new ones (psusi) -- libparted: don't detect fat and ntfs boot sectors as dos MBR (psusi) -- Fix filesystem detection on non 512 byte sectors (psusi) -- tests: fix t2310-dos-extended-2-sector-min-offset.sh (psusi) -- libparted: remove last_usable_if_grown (psusi) - -* Fri May 16 2014 Brian C. Lane 3.1-23 -- Fix partition naming patch for big endian systems. - -* Fri May 16 2014 Brian C. Lane 3.1-22 -- Fix a problem with GPT Partition names using. They are UCS-2LE not UTF-16 - -* Fri Apr 18 2014 Brian C. Lane 3.1-21 -- Fix t1700 probe patch -- remove loop before making new fs - -* Thu Apr 17 2014 Brian C. Lane 3.1-20 -- Use force for xfs in t1700 and a larger file -- Make t4100 xfs filesystem larger and sparse -- Fix part dupe with empty name -- check name when duplicating -- Add ntfs vfat hfsplus to t1700 probe test - -* Wed Apr 09 2014 Brian C. Lane 3.1-19 -- Use little endian packing in gpt tests -- Fix integer overflows with DVH disk label - -* Tue Apr 08 2014 Brian C. Lane 3.1-18 -- Rebase on new upstream master commit cc382c3 -- Drop patches incorporated into upstream -- Still adds the various DASD patches - -* Thu Feb 27 2014 Brian C. Lane 3.1-17 -- Drop hfs_esp patch. Idea didn't work. - -* Wed Sep 11 2013 Brian C. Lane 3.1-16 -- tests: Restrict gpt header munge to little-endian systems -- Add perl Digest::CRC as a build requirement so more tests will run - -* Wed Sep 04 2013 Brian C. Lane 3.1-15 -- libparted: Flush parent device on open (#962611) - -* Wed Aug 28 2013 Brian C. Lane 3.1-14 -- Rebasing Fedora patches with upstream master since v3.1 release -- Summary of important changes from upstream: - - add support for a new Linux-specific GPT partition type code - - partprobe: remove partitions when there is no partition table - - libparted: refactor device-mapper partition sync code - - libparted: remove extraneous blkpg add partition ped exception - - libparted: don't probe every dm device in probe_all -- New Fedora changes: - - libparted: Add Intel Rapid Start Technology partition flag. - - libparted: Add UEFI System Partition flag. - - libparted: Add hfs_esp partition flag to GPT. - - libparted: Recognize btrfs filesystem - - tests: Add btrfs and xfs to the fs probe test - -* Sat Aug 03 2013 Fedora Release Engineering - 3.1-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Wed Apr 17 2013 Brian C. Lane 3.1-12 -- libparted: mklabel to support EDEV DASD (#953146) -- tests: rewrite t6001 to use /dev/mapper - -* Thu Feb 14 2013 Fedora Release Engineering - 3.1-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Wed Dec 12 2012 Brian C. Lane 3.1-10 -- libparted: mklabel to support EAV DASD (#707032) -- libparted: Avoid dasd as default disk type while probe (#707032) - -* Thu Nov 01 2012 Brian C. Lane 3.1-9 -- don't canonicalize /dev/md/ paths (#872361) - -* Tue Oct 16 2012 Brian C. Lane 3.1-8 -- change partition UUID to use partX-UUID (#858704) -- fixup losetup usage in tests -- add support for implicit FBA DASD partitions (#707027) -- add support for EAV DASD partitions (#707032) - -* Tue Sep 04 2012 Brian C. Lane 3.1-7 -- reallocate buf after _disk_analyse_block_size (#835601) - -* Fri Aug 03 2012 Brian C. Lane 3.1-6 -- Use dm_udev_wait for dm operations (#844257) (bcl) -- use largest_partnum in _dm_reread_part_table (bcl) -- set uuid on dm partitions (#832145) (bcl) - -* Fri Jul 20 2012 Fedora Release Engineering - 3.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Fri Jun 08 2012 Brian C. Lane 3.1-4 -- Fix crash on ppc64 with GPT (#829960) (rwmj) - -* Tue May 15 2012 Brian C. Lane 3.1-3 -- Added Provides: bundled(gnulib) (#821782) - -* Wed Mar 21 2012 Brian C. Lane 3.1-2 -- libparted: check PMBR before GPT partition table (#805272) -- tests: add a test for the new behavior - -* Tue Mar 13 2012 Brian C. Lane 3.1-1 -- Rebase to upstream parted v3.1 -- removed merged patches -- add new libparted-fs-resize library - -* Fri Feb 03 2012 Brian C. Lane - 3.0-7 -- Update patch for copying flags so that it is generic -- Copy pmbr_boot flag in gpt_duplicate - -* Thu Feb 02 2012 Brian C. Lane - 3.0-6 -- gpt: add commands to manipulate pMBR boot flag (#754850) -- parted: when printing, also print the new disk flags -- tests: update tests for new disk flags output -- tests: add test for GPT PMBR pmbr_boot flag -- doc: update parted documentation - -* Fri Jan 13 2012 Fedora Release Engineering - 3.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Mon Oct 31 2011 Brian C. Lane - 3.0-4 -- Fix ped_disk_duplicate on GPT so that it copies the partition flags (#747947) -- Add new test to check ped_disk_duplicate on msdos, gpt, bsd disk labels -- Add e2fsprogs and dosfstools so that skipped tests will be run - -* Fri Oct 07 2011 Brian C. Lane - 3.0-3 -- Fix handling of zero-length gpt partitions (#728949) -- Fix bug in nilfs2 probe with short partitions (#728949) -- Fix bug in hfs probe code (#714758) -- Make pc98 detection depend on specific signatures (#646053) - -* Wed Jun 29 2011 Richard W.M. Jones - 3.0-2 -- (Re-)apply patch to fix Linux "3.0" problem. - -* Tue Jun 28 2011 Brian C. Lane - 3.0-1 -- Update to parted v3.0 -- Run autoreconf so that patches to .am files will work -- Add patch to Fix snap radius and don't allow values < 1 (#665496) -- Add tests for the snap radius fix. -- Drop patches included in upstream release - -* Sun Jun 5 2011 Richard W.M. Jones - 2.4-2 -- Apply patch which may fix Linux "3.0" problem. - -* Thu May 26 2011 Brian C. Lane - 2.4-1 -- Updating to latest upstream v2.4 -- Drop patches included in upstream - -* Fri Mar 11 2011 Brian C. Lane - 2.3-8 -- Add support for legacy_boot flag for GPT partitions (680562) -- Remove PED_ASSERT for dos geometry calculations (585468) - -* Wed Feb 09 2011 Brian C. Lane - 2.3-7 -- Tell GCC to stop treating unused variable warnings as errors - -* Tue Feb 08 2011 Fedora Release Engineering - 2.3-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Mon Dec 20 2010 Brian C. Lanr - 2.3-5 -- Document the align-check command - Resolves: #642476 -- Default to 1MiB partition alignment - Resolves: #618255 - -* Fri Dec 17 2010 Peter Jones - 2.3-4 -- Handle mac labels with differing physical/logical sector sizes better - -* Wed Sep 29 2010 jkeating - 2.3-3 -- Rebuilt for gcc bug 634757 - -* Fri Sep 17 2010 Brian C. Lane 2.3-2 -- Add patch to handle syncing partition changes when using blkext majors -- Resolves rhbz#634980 -- Related rhbz#629719 - -* Tue Jul 20 2010 Hans de Goede 2.3-1 -- Rebase to new upstream 2.3 release -- Drop all patches (all upstreamed) -- Recognize scsi disks with a high major as such (#611691) - -* Thu May 6 2010 Hans de Goede 2.2-5 -- Also recognize recovery partitions with id 27 / on gpt (#589451) - -* Fri Apr 23 2010 Hans de Goede 2.2-4 -- Properly check dm_task_run return value (#585158) -- Fix mkpartfs (ext2) on partitions >2TB (#585159) - -* Mon Apr 19 2010 Hans de Goede 2.2-3 -- Add a flag for detecting diagnostics / recovery partitions (#583626) - -* Tue Apr 6 2010 Hans de Goede 2.2-2 -- Parted should not canonicalize symlinks under /dev/mapper (#577824) - -* Tue Mar 30 2010 Hans de Goede 2.2-1 -- New upstream version 2.2 (#577478) -- Drop all our patches (all upstreamed) - -* Thu Feb 18 2010 Hans de Goede 2.1-5 -- Copy needs_clobber value in ped_disk_duplicate() (#561976) - -* Wed Feb 10 2010 Hans de Goede 2.1-4 -- Don't crash when reading a DASD disk with PV's on there (#563419) -- Don't overwrite the pmbr when merely printing a gpt table (#563211) - -* Sun Jan 31 2010 Hans de Goede 2.1-3 -- If a drive does not have alignment information available default - to an alignment of 1MiB (#559639) - -* Sun Jan 17 2010 Hans de Goede 2.1-2 -- Fix various memory leaks in error paths (#556012) -- Add %%check section to the specfile, invoking make check - -* Mon Jan 11 2010 Hans de Goede 2.1-1 -- New upstream release 2.1 -- Drop all our patches (all merged upstream) - -* Sun Dec 20 2009 Hans de Goede 1.9.0-25 -- Fix crash when partitioning loopback devices (#546622) -- Drop no-cylinder-align patch: - - its functionality is superseeded by the per disk flags - - its only user (pyparted) has been updated to use those - - this is not upstream so we don't want other programs to start using it - -* Fri Dec 18 2009 Hans de Goede 1.9.0-24 -- Allow partitioning of loopback devices (#546622) -- Add libparted function to query maximum partition length and start - addresses for a given disk (#533417) -- Add per disk flags functions from upstream, this is the way upstream - has implemented the disable cylinder alignment functionality -- Add --align cmdline option to specify how to align new partitions - see the parted man page for details (#361951) -- Make the default alignment for new partitions optimal (#361951) -- When cylinder alignment is disabled, allow use of the last (incomplete) - cylinder of the disk (#533328) -- Don't crash when printing partition tables in Russian (#543029) -- Make parted work correctly with new lvm (#525095) - -* Wed Nov 11 2009 Hans de Goede 1.9.0-23 -- Fix parted not building on s390 - -* Mon Nov 9 2009 Hans de Goede 1.9.0-22 -- Fix error when creating a fresh dasd disk on a dasd device - with a corrupted dasd label (#533808) - -* Fri Nov 6 2009 Hans de Goede 1.9.0-21 -- Fix a compiler warning which is causing build errors (#532425) - -* Tue Nov 3 2009 Hans de Goede 1.9.0-20 -- Fix error when creating a fresh dasd disk (#532425) -- Rewrite dasd disk duplication patches, as the old old ones conflicted - with fixing creating a fresh dasd disk - -* Fri Oct 30 2009 Hans de Goede 1.9.0-19 -- Fix a segfault introduced by -18 when operating on plain files - -* Thu Oct 29 2009 Hans de Goede 1.9.0-18 -- Add functions to query device / partition table alignments (#528030) - -* Thu Oct 8 2009 Hans de Goede 1.9.0-17 -- Only change the partition type to 82 when setting the swap flag on dos - labels, not when resetting it - -* Tue Oct 6 2009 Hans de Goede 1.9.0-16 -- Correctly handle GPT labels on big endian machines - -* Tue Oct 6 2009 Hans de Goede 1.9.0-15 -- ped_partition_is_busy() should not throw exceptions (#527035) -- msdos_partition_is_flag_available() should return 1 for swap flag (#513729) - -* Mon Aug 31 2009 Joel Granados 1.9.0-14 -- Patchs for 'commit to os' for linux. Thx to hansg. - -* Fri Aug 28 2009 Karsten Hopp 1.9.0-13 -- volkey is only 4 chars, don't overflow destination buffer with 84 chars - -* Fri Aug 21 2009 Joel Granados - 1.9.0-12 -- libuuid-devel is now valid for s390 builds. - -* Wed Aug 12 2009 Ville Skyttä - 1.9.0-11 -- Use xz compressed upstream tarball. - -* Wed Aug 12 2009 Joel Granados - 1.9.0-10 -- Make install with exclude docs work without an error message. - -* Wed Jul 29 2009 Joel Granados - 1.9.0-9 -- Add parenthesis where needed (#511907) - -* Mon Jul 27 2009 Joel Granados - 1.9.0-8 -- Add the swap flag to the dos type labels - -* Sat Jul 25 2009 Fedora Release Engineering - 1.9.0-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Thu Jul 23 2009 Joel Granados - 1.9.0-6 -- Rebuild usiing the official tar.gz at http://ftp.gnu.org/gnu/parted/parted-1.9.0.tar.gz - -* Wed Jul 22 2009 Joel Granados - 1.9.0-5.20090721git980c -- Better handle a duplicate error. - -* Tue Jul 21 2009 Joel Granados - 1.9.0-4.20090721git980c -- New snapshot. -- Add patches to make dasd duplicate disk work. - -* Sat Jul 18 2009 Lubomir Rintel - 1.9.0-3.20090610git32dc -- Fix a typo in the errno patch - -* Mon Jul 13 2009 Joel Granados - 1.9.0-2.20090610git32dc -- Correctly number the snapshot. - -* Fri Jul 10 2009 Joel Granados - 1.9.0-1 -- New version. - -* Thu Mar 26 2009 Joel Granados - 1.8.8-15 -- Begin to identify virtio devices. -- Actually change the partition type in msdos lables (dcantrell). - -* Mon Mar 23 2009 Joel Granados - 1.8.8-14 -- Correct the behavior of upated_mode functions when the ASSERT fails (thx to hansg). - -* Thu Feb 26 2009 Joel Granados - 1.8.8-13 -- Fix parted build for gcc-4.4 - -* Thu Feb 26 2009 Fedora Release Engineering - 1.8.8-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Thu Jan 22 2009 Joel Granados - 1.8.8-12 -- Avoid the calling of stat for strings that don't begin with the "/" char (#353191). - -* Sat Dec 13 2008 Tom "spot" Callaway - 1.8.8-11 -- fix typo in last patch - -* Sat Dec 13 2008 Tom "spot" Callaway - 1.8.8-10 -- enable RAID partition types on sun disklabels for sparc - -* Thu Nov 06 2008 Joel Granados - 1.8.8-9 -- Fix the build for the s390(x) archs (#470211). - -* Thu Jun 05 2008 Peter Jones - 1.8.8-8 -- Fix some of the atvrecv code (and the msftres code) so that the flags - actually stick. - -* Thu Jun 05 2008 Peter Jones - 1.8.8-7 -- Added "atvrecv" flag patch from atv-bootloader project. - -* Thu May 29 2008 Joel Granados - 1.8.8-6 -- Do a better job at recognizing the dos partition. (#246423) - -* Thu Apr 10 2008 David Cantrell - 1.8.8-5 -- Allow RAID or LVM partition types on BSD disklabels. - (jay.estabrook AT hp.com, #427114) - -* Thu Apr 10 2008 Peter Jones - 1.8.8-4 -- Don't interactively ask to fix an AlternateGPT's location when not - at the end of the disk; this is so that disk images written to a - usb-key can work reasonably. - -* Mon Feb 04 2008 David Cantrell - 1.8.8-3 -- Fixes so parted compiles with gcc-4.3 (#431397) - -* Sun Jan 13 2008 David Cantrell - 1.8.8-2 -- Move libparted libraries to /lib (#428420) - -* Wed Jan 02 2008 David Cantrell - 1.8.8-1 -- Upgraded to GNU parted-1.8.8 -- License for GNU parted is now GPLv3+ - -* Thu Dec 13 2007 David Cantrell - 1.8.6-13 -- Modify parted man page to indicate which flags are valid for which - disk labels (#242711) - -* Mon Nov 05 2007 David Cantrell - 1.8.6-12 -- Add KNOWN ISSUES section to parted(8) man page explaining that we cannot - currently do ext3 resizing inside parted (#367101) -- Update the xvd patch to include 'xvd' in the string table that parted - uses when printing device types (#366971) -- Do not install the linux.h or gnu.h headers - -* Tue Oct 30 2007 David Cantrell - 1.8.6-11 -- Do not install fdasd.h and vtoc.h header files - -* Thu Oct 04 2007 David Cantrell - 1.8.6-10 -- Do not install the testsuite tools - -* Thu Oct 04 2007 David Cantrell - 1.8.6-9 -- Always define PED_DEVICE_DM regardless of compile time options - -* Tue Aug 21 2007 David Cantrell - 1.8.6-8 -- Rebuild - -* Wed Aug 08 2007 David Cantrell - 1.8.6-7 -- Update License tag to GPLv2+ - -* Tue Aug 07 2007 David Cantrell - 1.8.6-6 -- Detect Xen virtual block devices and set model name appropriately - -* Thu Apr 19 2007 David Cantrell - 1.8.6-5 -- Spec file cleanups for merge review (#226230) - -* Fri Apr 13 2007 David Cantrell - 1.8.6-4 -- Fix primary partition cylinder alignment error for DOS disk labels (#229745) -- Do not build and package up libparted.a, only the shared library - -* Wed Apr 11 2007 David Cantrell - 1.8.6-3 -- Fix off-by-one bug in parted(8) when displaying disk label (#235901) - -* Wed Mar 21 2007 David Cantrell - 1.8.6-2 -- Do not translate partition name from disk label (#224182) - -* Tue Mar 20 2007 David Cantrell - 1.8.6-1 -- Upgrade to GNU parted-1.8.6, summary of major change(s): - a) Revert linux-swap(new) and linux-swap(old) fs types, it's - linux-swap for all swap types (#233085) - -* Tue Mar 20 2007 David Cantrell - 1.8.5-1 -- Upgrade to GNU parted-1.8.5 (added missing po files) - -* Fri Mar 16 2007 David Cantrell - 1.8.4-1 -- Upgrade to GNU parted-1.8.4, summary of major changes: - a) Update to use newest GNU developer tools - b) Use gnulib, the GNU portability library - c) HFS+ resize support - d) Windows Vista fixes - e) AIX disk label fixes - f) >512 byte logical sector read support on Linux -- Spec file cleanups per Fedora packaging guidelines - -* Thu Feb 08 2007 David Cantrell - 1.8.2-5 -- Remove period from end of summary line (package review) -- Use preferred BuildRoot (package review) -- BR device-mapper-devel - -* Tue Jan 30 2007 David Cantrell - 1.8.2-4 -- Patched parted.8 man page to show partition names apply to GPT disklabels - as well as Mac and PC98 disklabels (#221600) - -* Mon Jan 22 2007 David Cantrell - 1.8.2-3 -- Remove BR for libtermcap-devel -- Specifically preserve starting alignment of 0x800 on Windows Vista - (see http://support.microsoft.com/kb/923332 for details) -- Fix incorrect sector parameter used to initialize a new PedAlignment - -* Thu Jan 18 2007 David Cantrell - 1.8.2-2 -- Preserve starting sector for primary NTFS 3.1 partitions (Windows - Vista) when modifying the DOS disk label. NTFS 3.1 partitions do - not start on the 2nd head of the 1st cylinder at the beginning of - the drive. - -* Fri Jan 12 2007 David Cantrell - 1.8.2-1 -- Upgrade to GNU parted-1.8.2 - -* Fri Dec 15 2006 David Cantrell - 1.8.1-2 -- Fix a segfault when initializing new volumes (pjones) - -* Mon Dec 04 2006 David Cantrell - 1.8.1-1 -- Upgrade to GNU parted-1.8.1 - -* Fri Nov 17 2006 David Cantrell - 1.8.0-1 -- Upgrade to GNU parted-1.8.0 - -* Thu Nov 02 2006 David Cantrell - 1.7.1-18 -- Detect Apple_Boot partition types correctly (#204714) - -* Thu Oct 26 2006 David Cantrell - 1.7.1-17 -- For init_generic() failures on user-mode Linux block devices, goto - error_free_arch_specific instead of error_free_dev. - -* Wed Oct 04 2006 David Cantrell - 1.7.1-16 -- Don't throw PED_EXCEPTION_ERROR in ped_geometry_read() if accessing - sectors outside of partition boundary, since returning false will - shift ped_geometry_check() to the correct sectors. - -* Wed Aug 23 2006 David Cantrell - 1.7.1-15 -- Fixed gpt patch (*asked_already -> asked_already, whoops) - -* Tue Aug 22 2006 David Cantrell - 1.7.1-14 -- Improve error message returned by _parse_header() on GPT-labeled disks - so users actually have an idea of how to correct the problem -- Fix off-by-one error with LastUsableLBA and PartitionEntryLBA overlap - to prevent possible data corruption when using non-parted GPT editing - tools - -* Mon Aug 21 2006 Peter Jones - 1.7.1-13 -- Don't use the "volume name" as the device node name on dm device - partitions, it isn't really what we want at all. - -* Thu Aug 17 2006 David Cantrell - 1.7.1-12 -- Updated O_DIRECT patch to work around s390 problems -- Update LastUsableLBA on GPT-labeled disks after LUN resize (#194238) -- Fix exception when backup GPT table is not in the correction location - and parted tries to move it (#194238) - -* Tue Aug 15 2006 David Cantrell - 1.7.1-11 -- Expand error buffer to 8192 bytes in vtoc_error() -- Do not apply O_DIRECT patch on S/390 or S/390x platforms - -* Mon Aug 14 2006 David Cantrell - 1.7.1-10 -- Removed bad header file patch (#200577) - -* Wed Jul 12 2006 Jesse Keating - 1.7.1-9.1 -- rebuild - -* Wed Jul 5 2006 Peter Jones - 1.7.1-9 -- add ped_exception_get_handler() - -* Mon Jun 26 2006 Florian La Roche - 1.7.1-8 -- remove info files in preun - -* Thu Jun 22 2006 David Cantrell - 1.7.1-7 -- PED_SECTOR_SIZE -> PED_SECTOR_SIZE_DEFAULT - -* Thu Jun 22 2006 David Cantrell - 1.7.1-6 -- Roll dasd patches together -- Use O_DIRECT to prevent first partition corruption on GPT disks - -* Thu Jun 15 2006 Jeremy Katz - 1.7.1-5 -- fix segfaults with dasd devices - -* Wed Jun 7 2006 Jeremy Katz - 1.7.1-4 -- move .so symlink to -devel subpackage - -* Sun May 28 2006 David Cantrell - 1.7.1-3 -- Rebuild - -* Sun May 28 2006 David Cantrell - 1.7.1-2 -- Removed mac-swraid patch (added upstream) -- Updated device-mapper patch for parted-1.7.1 - -* Sat May 27 2006 David Cantrell - 1.7.1-1 -- Upgraded to parted-1.7.1 - -* Fri May 19 2006 David Cantrell - 1.7.0-1 -- Upgraded to parted-1.7.0 - -* Thu Apr 13 2006 David Cantrell - 1.6.25.1-1 -- Upgraded to parted-1.6.25.1 -- BuildRequires libtool - -* Tue Mar 14 2006 Jeremy Katz - 1.6.25-8 -- fix ppc swraid -- BR gettext-devel - -* Wed Feb 22 2006 Peter Jones - 1.6.25-7 -- close /proc/devices correctly - -* Fri Feb 10 2006 Jesse Keating - 1.6.25-6.1 -- bump again for double-long bug on ppc(64) - -* Tue Feb 7 2006 Peter Jones 1.6.25-6 -- Fix dm partition naming. - -* Tue Feb 7 2006 Jesse Keating 1.6.25-5.2 -- rebuilt for new gcc4.1 snapshot and glibc changes - -* Fri Dec 9 2005 Jesse Keating -- rebuilt - -* Fri Dec 2 2005 Peter Jones 1.6.25-5 -- rebuild for new device-mapper - -* Thu Dec 1 2005 Peter Jones 1.6.25-4 -- change device-mapper code to call dm_task_update_nodes() after - tasks which change device nodes. - -* Wed Nov 16 2005 Peter Jones 1.6.25-3 -- fix /proc/devices parser bug - -* Tue Nov 15 2005 Peter Jones 1.6.25-2 -- add support for partitions on dm devices - -* Wed Nov 09 2005 Chris Lumens 1.6.25-1 -- Updated to 1.6.25. -- Update DASD, iseries, and SX8 patches. - -* Tue Aug 30 2005 Chris Lumens 1.6.24-1 -- Updated to 1.6.24. - -* Mon Jul 18 2005 Chris Lumens 1.6.23-2 -- Add buildreq for texinfo. - -* Fri Jul 08 2005 Chris Lumens 1.6.23-1 -- Updated to 1.6.23. -- Get rid of separate Mac patches that are now included in upstream. -- Update DASD and AIX patches. - -* Tue Jun 07 2005 Chris Lumens 1.6.22-3 -- Modified Apple_Free patch to take care of the case where the partitions - are unnamed, causing many errors to be printed (#159047). - -* Thu May 05 2005 Chris Lumens 1.6.22-2 -- Added upstream patch to display certain Apple_Free partitions (#154479). - -* Wed Mar 23 2005 Chris Lumens 1.6.22-1 -- Updated to 1.6.22. -- Get rid of separate gc4 patch that's now included upstream. -- Take Mac LVM patch from parted CVS. - -* Mon Mar 14 2005 Chris Lumens 1.6.21-3 -- Include patches from parted CVS for new gcc4 warnings. - -* Sun Feb 20 2005 Paul Nasrat 1.6.21-2 -- Support lvm flags on mac partitions (#121266) - -* Fri Jan 21 2005 Chris Lumens 1.6.21-1 -- Updated to 1.6.21 - -* Wed Jan 12 2005 Tim Waugh 1.6.20-2 -- Rebuilt for new readline. - -* Fri Jan 07 2005 Chris Lumens 1.6.20-1 -- Updated to 1.6.20 (#139257, #142100). -- Updated DASD and AIX patches for 1.6.20. - -* Tue Dec 14 2004 Jeremy Katz - 1.6.19-2 -- add support for Promise SX8 devices - -* Sun Nov 28 2004 Jeremy Katz - 1.6.19-1 -- update to 1.6.19 (#138419) - -* Sun Nov 21 2004 Jeremy Katz - 1.6.18-1 -- update to 1.6.18 - -* Sat Nov 20 2004 Miloslav Trmac - 1.6.16-3 -- Convert pt_BR-parted.8 to UTF-8 - -* Thu Nov 11 2004 Jeremy Katz - 1.6.16-2 -- add patch from Matt Domsch to fix consistency of GPT disk labels - with the EFI specification for disks > 2TB (#138480) -- understand the new Sun UFS partition ID -- merge the new geometry probing from CVS to see if that helps the - assertions people are seeing (#138419) - -* Mon Nov 8 2004 Jeremy Katz - 1.6.16-1 -- update to 1.6.16 -- rebuild for python 2.4 - -* Mon Oct 18 2004 Jeremy Katz - 1.6.15-5 -- add patch from Matt Domsch to add a unique signature to new DOS labels - so that we can later determine which BIOS disk is which (#106674) - -* Fri Oct 15 2004 Phil Knirsch 1.6.15-4 -- Fixed dasd patch (had some duplicate file patches in it) -- Fixed problem with parted segfaulting on SCSI discs on s390 (#133997) - -* Tue Oct 12 2004 Jeremy Katz - 1.6.15-3 -- add patch from peterm to fix printing of the size of large devices (#135468) - -* Thu Oct 07 2004 Phil Knirsch 1.6.15-2 -- Fixed geometry calculation for bios_geo in dasd_init() - -* Mon Sep 20 2004 Jeremy Katz - 1.6.15-1 -- 1.6.15 - -* Fri Sep 10 2004 Jeremy Katz - 1.6.14-1 -- update to 1.6.14 - -* Tue Aug 24 2004 Jeremy Katz - 1.6.12-2 -- fix assertion error when checking flags on non-active partition (#130692) -- buildrequires: gettext-devel - -* Mon Aug 16 2004 Jeremy Katz - 1.6.12-1 -- update to 1.6.12 with major changes to CHS handling to hopefully fix #115980 -- adjust dasd patch accordingly, drop some included patches - -* Mon Jul 19 2004 Karsten Hopp 1.6.11-4 -- update dasd patch for dos-type partitions on mainframes (scsi disks) - -* Fri Jun 25 2004 Jeremy Katz - 1.6.11-3 -- install-info (#77687) - -* Tue Jun 15 2004 Elliot Lee - 1.6.11-2 -- rebuilt - -* Tue Jun 1 2004 Jeremy Katz -- -devel requires main package (#124938) - -* Thu May 13 2004 Jeremy Katz - 1.6.11-1 -- update to 1.6.11 - -* Tue May 11 2004 Jeremy Katz - 1.6.9-4 -- add patch from Matt Domsch to not use the get/set last sector ioctls - with a 2.6 kernel (#121455) - -* Thu Apr 15 2004 David Woodhouse - 1.6.9-3 -- Fix Mac partition detection to close #112937 - -* Tue Apr 13 2004 Jeremy Katz - 1.6.9-2 -- another minor tweak for 2.6's lack of sane geometry handling - -* Mon Apr 12 2004 Jeremy Katz - 1.6.9-1 -- update to 1.6.9 -- need automake17 -- python-devel is superfluous with pyparted as a separate package -- lose the fake-libtool stuff, 1.6.9 was disted with newer auto* - -* Mon Mar 15 2004 Elliot Lee 1.6.6-2 -- Fix parted's "part-static" option to close #118183. Woohoo, a fake-libtool.sh :) - -* Fri Mar 12 2004 Jeremy Katz - 1.6.6-1 -- update to 1.6.6 -- split dasd into a patch instead of included in the tarball -- python module is now in the pyparted package (separate src.rpm) -- ExcludeArch: ppc64 (#118183) - -* Tue Mar 02 2004 Elliot Lee -- rebuilt - -* Fri Feb 13 2004 Elliot Lee -- rebuilt - -* Fri Feb 6 2004 Jeremy Katz -- add automake buildrequires (#115063) - -* Thu Jan 22 2004 Jeremy Katz 1.6.3-33 -- 2.6 removes the geometry fixups that used to be present for IDE disks. - According to Andries, just follow what's in the partition table and don't - worry about what Linux "detects" - -* Thu Nov 6 2003 Jeremy Katz 1.6.3-32 -- rebuild for python 2.3 - -* Mon Oct 27 2003 Jeremy Katz 1.6.3-31 -- add patch from Michael Schwendt for segfault - -* Wed Sep 17 2003 Jeremy Katz 1.6.3-30 -- rebuild - -* Wed Sep 17 2003 Jeremy Katz 1.6.3-29 -- and don't barf on the old (broken) 1.02 gpt rev - -* Tue Sep 16 2003 Jeremy Katz 1.6.3-28 -- rebuild - -* Tue Sep 16 2003 Jeremy Katz 1.6.3-27 -- write out the correct gpt revision (#103664) -- add buildrequires on ncurses-devel - -* Thu Sep 4 2003 Bill Nottingham 1.6.3-26 -- rebuild - -* Thu Sep 4 2003 Bill Nottingham 1.6.3-25 -- don't buildreq libunicode-devel - -* Thu Aug 07 2003 Elliot Lee 1.6.3-24 -- Fix libtool - -* Wed Jul 09 2003 Phil Knirsch 1.6.3-23 -- Fixed dasd_write and dasd_read to support lvm and raid partitions. - -* Wed Jun 18 2003 Phil Knirsch 1.6.3-22 -- Fixed a small bug in VTOC fdasd_check_volume() (#97300). - -* Wed Jun 04 2003 Elliot Lee 1.6.3-21 -- rebuilt - -* Wed Jun 4 2003 Matt Wilson 1.6.3-20 -- don't detect AIX physical volumes as msdos partition tables (#91748) -- added stubbed code for manipulating AIX PVs, enough to clobber the - signature. (#91748) - -* Wed Jun 04 2003 Phil Knirsch 1.6.3-19 -- Added LDL disk layout support for s390(x). - -* Sun May 18 2003 Matt Wilson 1.6.3-18 -- use metadata partitions to protect DASD VTOC -- stash DASD specific data in disk specific areas, not arch specific - areas. - -* Fri May 16 2003 Matt Wilson 1.6.3-18 -- recongnize iseries viodasd (#90449) - -* Thu May 08 2003 Phil Knirsch 1.6.3-17 -- Fixed problem with probing partitions on s390(x) with new partition code. - -* Mon May 05 2003 Phil Knirsch 1.6.3-16 -- Fixed partiton reread code for s390(x). - -* Fri May 02 2003 Phil Knirsch 1.6.3-15 -- Rewrote partition handling for s390(x) dasd devices. No more empty partitions. - -* Wed Mar 12 2003 Phil Knirsch 1.6.3-13 -- Finished updating vtoc and fdasd code to latest s390-utils version. - -* Thu Mar 06 2003 Phil Knirsch 1.6.3-12 -- Fixed vtoc handling on s390(x) dasd devices. - -* Thu Feb 06 2003 Karsten Hopp 1.6.3-11 -- use different define to enable DASD debugging - Otherwise we'll get a lot of dasd debug output because DEBUG is - always defined - -* Wed Jan 22 2003 Tim Powers -- rebuilt - -* Wed Jan 22 2003 Karsten Hopp 1.6.3-9 -- missed one debug message - -* Tue Jan 21 2003 Karsten Hopp 1.6.3-8 -- add patch from CVS to disable debug messages on s390 - -* Tue Jan 14 2003 Matt Wilson 1.6.3-7 -- updated to a new tarball of parted that includes a fs.probe_specific binding - -* Sun Dec 1 2002 Matt Wilson 1.6.3-6 -- hack in partition.native_type (#78118) - -* Thu Nov 7 2002 Matt Wilson -- added a patch to avoid SIGFPE when fat sector size is 0 - -* Tue Nov 5 2002 Matt Wilson -- use --disable-dynamic-loading - -* Mon Nov 4 2002 Matt Wilson -- add device.disk_new_fresh() - -* Fri Nov 1 2002 Matt Wilson -- 1.6.3 - -* Fri Oct 4 2002 Jeremy Katz 1.4.24-7 -- use make LIBTOOL=/usr/bin/libtool instead of recreating everything -- add patch from Jack Howarth to self host properly -- add patch to treat GPT structs as little-endian always and treat GUIDS - as little-endian blobs -- add patch to recognize hp service partitions - -* Wed Sep 25 2002 Jeremy Katz 1.4.24-6hammer -- libtoolize, etc for x86_64 -- hack to get the python module in the right place until python.m4 - from automake is fixed - -* Fri Jun 21 2002 Tim Powers 1.4.24-6 -- automated rebuild - -* Sun May 26 2002 Tim Powers 1.4.24-5 -- automated rebuild - -* Wed May 22 2002 Jeremy Katz 1.4.24-4 -- rebuild in new environment - -* Fri Mar 22 2002 Matt Wilson 1.4.24-3 -- fixed the probe-with-open behavior (again) - -* Fri Feb 22 2002 Matt Wilson 1.4.24-1 -- rebuild - -* Tue Feb 12 2002 Matt Wilson 1.4.24-1 -- 1.4.24 - -* Wed Jan 09 2002 Tim Powers -- automated rebuild - -* Mon Jan 7 2002 Jeremy Katz 1.4.20-4 -- build with final python 2.2 - -* Wed Dec 12 2001 Jeremy Katz 1.4.20-3 -- update from CVS and rebuild in new environment - -* Thu Oct 25 2001 Jeremy Katz 1.4.20-2 -- build both python1.5 and python2 modules - -* Fri Oct 19 2001 Matt Wilson 1.4.20-1 -- 1.4.20 final - -* Thu Oct 11 2001 Matt Wilson 1.4.20-0.1pre3 -- new dist from CVS with new autoconf and automake -- gpt is in 1.4.20, removed patch1 (gpt support) -- partstatic is in 1.4.20, removed patch2 (partstatic patch) - -* Tue Aug 28 2001 Matt Wilson 1.4.16-8 -- new dist from cvs with changes to the python binding: register - DEVICE_I20 and DEVICE_ATARAID, check to make sure that a partition - exists in the PedDisk when using it to find ped_disk_next_partition - -* Tue Aug 21 2001 Matt Wilson 1.4.16-7 -- really disable pc98 support (SF #51632) - -* Fri Aug 17 2001 Matt Wilson 1.4.16-6 -- added a patch (Patch1) to link the c library in dynamically, the - rest of the libs statically for the parted binary (MF #49358) - -* Tue Aug 7 2001 Matt Wilson -- made a new dist from CVS that includes binding for - disk.get_partition_by_sector and accessing the name of a disk type - -* Mon Aug 6 2001 Matt Wilson 1.4.16-4 -- created a new dist from CVS that fixes ext3 detection when - _probe_with_open is needed (#50292) - -* Fri Jul 20 2001 Matt Wilson -- rewrite scsi id code (#49533) - -* Fri Jul 20 2001 Matt Wilson -- added build requires (#49549) - -* Tue Jul 17 2001 Matt Wilson -- 1.4.16 -- regenerated gpt patch against 1.4.16, incorporated - parted-1.4.15-pre1-gpt-printf.patch into the same patch, removed Patch1 - -* Tue Jul 10 2001 Matt Wilson -- added a new dist tarball that contains python wrappers to get disk types - -* Tue Jul 10 2001 Tim Powers -- run ldconfig on un/install - -* Tue Jul 10 2001 Matt Wilson -- added a fix from clausen for border case when there is an extended - on the last cyl - -* Mon Jul 9 2001 Matt Wilson -- 1.4.15 - -* Thu Jul 5 2001 Matt Wilson -- added patch from Arjan to enable ataraid support - -* Wed Jul 4 2001 Matt Wilson -- imported 1.4.15-pre2 into CVS and made a new dist tarball - -* Tue Jun 26 2001 Matt Wilson -- added a new dist tarball that contains a check in python code to - make sure that a partition exists within a disk before trying to - remove it from the disk -- also changed _probe_with_open to make the first probed filesystem win - -* Tue Jun 26 2001 Bill Nottingham -- fix filesystem type reading on GPT disks - -* Tue Jun 26 2001 Matt Wilson -- added another fix for ext2/ext3 -- added Patch4 to move the crc32 function into its own namespace so - we don't colide with zlib when both are in the same executable space - -* Mon Jun 25 2001 Matt Wilson -- added a new dist tarball from CVS that includes - ext3 probing - -* Wed Jun 6 2001 Matt Wilson -- updated dist with binding for partition.geom.disk - -* Tue Jun 5 2001 Matt Wilson -- make a new dist tarball that has new python binding changes - -* Tue May 29 2001 Bill Nottingham -- add major numbers for cciss -- add libunicode-devel buildprereq - -* Sun May 27 2001 Matthew Wilson -- added type, heads, and sectors to the python binding for PedDevice - -* Fri May 4 2001 Matt Wilson -- added parted-1.4.11-gpt-pmbralign.patch from Matt Domsch - -* Wed May 2 2001 Matt Wilson -- include python binding -- enable shared library (for python binding, we want fpic code) - with --enable-shared -- build parted binary static with --enable-all-static -- don't run libtoolize on this. - -* Wed May 02 2001 Bill Nottingham -- update to 1.4.11 -- add EFI GPT patch from Matt Domsch () -- don't run autoconf, it relies on a newer non-released version - of autoconf... - -* Fri Feb 23 2001 Trond Eivind Glomsrød -- langify - -* Wed Jan 17 2001 Florian La Roche -- update to 1.4.7 - -* Thu Dec 14 2000 Bill Nottingham -- rebuild because of broken fileutils - -* Fri Nov 03 2000 Florian La Roche -- update to 1.2.12 - -* Wed Nov 01 2000 Florian La Roche -- update to 1.2.11 - -* Tue Oct 17 2000 Florian La Roche -- update to 1.2.10 - -* Sun Sep 10 2000 Florian La Roche -- update to 1.2.9 - -* Tue Aug 29 2000 Florian La Roche -- fix bug when just hitting "return" with no user input - -* Sun Aug 20 2000 Florian La Roche -- 1.2.8 -- blksize patch not needed anymore -- move changelog to the end of the spec file - -* Wed Aug 16 2000 Matt Wilson -- 1.2.7 -- patched configure script to ignore the 2.4 blkpg.h header (fixes #15835). - -* Fri Aug 4 2000 Florian La Roche -- update to 1.2.6 - -* Sat Jul 22 2000 Florian La Roche -- update to 1.2.5 -- add more docu - -* Wed Jul 12 2000 Prospector -- automatic rebuild - -* Mon Jun 12 2000 Matt Wilson -- initialization of spec file. +* Mon Apr 18 2022 Brian C. Lane - 3.5-1 +- Upstream 3.5 stable release diff --git a/plans/test-parted.fmf b/plans/test-parted.fmf new file mode 100644 index 0000000..2b22c58 --- /dev/null +++ b/plans/test-parted.fmf @@ -0,0 +1,8 @@ +summary: Run a basic parted test +prepare: + how: install + package: + - parted + - jq +execute: + script: ./tests/scripts/run_tests.sh diff --git a/pubkey.brian.lane b/pubkey.brian.lane new file mode 100644 index 0000000..210282c --- /dev/null +++ b/pubkey.brian.lane @@ -0,0 +1,108 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQENBEt+xXMBCACkA1ZtcO4H7ZUG/0aL4RlZIozsorXzFrrTAsJEHvdy+rHCH3xR +cFz6IMbfCOdV+oKxlDP7PS0vWKfqxwkenOUut5o9b32uDdFMW4IbFXEQ94AuSQpS +jo8PlVMm/51pmmRxdJzyPnr0YD38mVK6qUEYLI/4zXSgFk493GT8Y4m3N18O/+ye +PnOOItj7qbrCMASoBx1TG8Zdg8ufehMnfb85x4xxAebXkqJQpEVTjt4lj4p6BhrW +R+pIW/nBUrz3OsV7WwPKjSLjJtTJFxYX+RFSCqOdfusuysoOxpIHOx1WxjGUOB5j +fnhmq41nWXf8ozb58zSpjDrJ7jGQ9pdUpAtRABEBAAG0HkJyaWFuIEMuIExhbmUg +PGJjbEByZWRoYXQuY29tPokBVAQTAQoAPgIbAwIeAQIXgAULCQgHAwUVCgkICwUW +AgMBABYhBLTGtFHk+otCMsoZHhF+jBaO/jp/BQJglc7SBQkW+DzfAAoJEBF+jBaO +/jp/H4sH/A/92VVmfKssdC41fIO2iBIokLLfAAYzw75unKS84ovjeussUHqgDVCt +ZzXcHixo6oiYGgtyb5/EXTgEK6blZiUgsiWLFcFAo3tvCpMz9xa3XcaSw7MKwHCI +lmcdZalnQD47cu3E0CjFRoo9p3yueDYh3ZjMEzAFilGiZOBeoMwKxCofVqQCstp0 +0XZVMjAD/ZvhuNyXmqYykAcjORY2eVq92tOAdW6cAqv963hlDs6GRdYxBbx6Jorx +8bqpTQA9o/y3g6clt/oPmjAXtBPnHQFH6XlVIXodCPc5iuEe6gFmvL29JDARTkee +hIsqNbrPy11JQkD6EfC6vaWQ5G1DbsWIRgQQEQIABgUCS37G6QAKCRAh+2P+lxLC +zbmrAJ9ENIweBGv/eRERFJAhU5vS+pzqQACfbUM8Bl4ayxWcznUVmIlnAkG1+f+J +AhwEEAEKAAYFAlVhGI8ACgkQ0phFpw9QF94AEBAAj9g/cR2fv6ognKbd3noTz7zt +8unMKD33s4evHaLQCaeqZLa26RPg2LDlPBmUbyAT75KMqEnAo5Mm5cLTrQY0k3mF +/Ngz3B4FzGisQeD73i0J5Pu9nNqp3h2j1cn/mm9FsbWmTSvxEKsIUIbmSC+vsTNg +Wte9Uw2QuRpFlxUPL8VkCgY94cHBtH1ths+ZdWP9c5FQm4C+f1ZFpWvxD5ISLLXH +YEChsB/wzZYsBtOu8PuHj7Po7jKjpKiG9tF1HK2naD2b2nTtwaJWzBgidfWjJGXn +wViwozEU+DrWH1XRaqiKtAgKQq8ggtduHsQ2SPjYC4FuQ+cwIUPJPB+Xox7e+S01 +2utBsK32tGkCa1ACjDrwePbs65c+/krz3oSRaPPzCTakboGUVL0qxk+nWNvjdxls +iL0SCFgRRS6bxokLrb4xBmBX3qiHP7TIcEDu4WYNBLwsGtV+g89Yh8gXquizDo9H +UU5/+/f4wJmXr6o86R/QqjGj5MAUOUZTHyBTPtEDOYnEOQSYPBnZfxAeH/zKVnLz +TbL6fsB4juddE084bY08gM0utYVuKNudkykHMFLzO5Iou2te3lMKGlePSau/eAi0 +xHpsy4s/Ykls+KBXHYWghBouZJ18RkPwbQ6WFH18B3frh6ge4lAJ+HprXAEPk6Ag +pJxRGbLxdozB6ZSOrsaJATgEEwECACIFAkt+xXMCGwMGCwkIBwMCBhUIAgkKCwQW +AgMBAh4BAheAAAoJEBF+jBaO/jp/XYAH/R4titTCnJi5A3klCF5FyAMNJwM5dlAx +i1hHQ6gIBcT+lGglbTiEQq+8+BAzkKMQ+5pHXpGx9luRnEzuIfDEAR2A/RJGOx/5 +UynIZRX7JmnzqAN2P7QyzyrvjiHx/TKp9jH+8DGBq51kkTSmILwuc5DIJIaD1Jkj +zx8gWm7HUvyoOWQH+N2nPzF2PVfDJOs6mwZY+kGKoydJwQ+r8KM6w0OYCbQ1C5kI +aNd8z5+JQSZfWCVY3IEQdlm84EmTpZ9A31dtknmouur56+TcmjiMOQfUC0jYTRGj +xbMBAyygrJ7PXZA7hhV+dvzLf4uyckr8ITAahxJT81psAh3mOOTPIAWJAT0EEwEK +ACcCGwMCHgECF4AFCwkIBwMFFQoJCAsFFgIDAQAFAlVYGtMFCQu6iNwACgkQEX6M +Fo7+On8IuggAj6souVSKFq26OaRPhV1L7kaKBI+1NO/s8G4tCNDu9x+M1dS1uGBP +K4L/ojAKiE8KTdrV8PIo/8O95TRMzVvBNXxtvwKkcL+/E8OCIEN/IDfQ16kj69iJ +5mpZ3cOjQ8QTqsqITXsNZseyKRd3Z1bUKmUXlROErH9zHgHu4u+t/HVxTq8dAqvy +vdq9B+KHdO8QuJWV889i92McrGGnzfV8m40tGXhxeaXpVRAdk7fl+Uy0vyv9gCyL ++Zc76i+Ol+18iG96sHNrAse2fcrPMQci9GBJ/zHyYImJzyNOdO3e6KDUAWm1kRth +tC2LbT91uLq5f2l1WF3taNy5rjmvjANFBIkBPQQTAQoAJwIbAwIeAQIXgAULCQgH +AwUVCgkICwUWAgMBAAUCVz5PnQUJDaC9pQAKCRARfowWjv46f6JrB/4oC8tTjYV+ +htspYII6nhAMyAhLq6ooaZthDAoekLOdXVv1m4+unn1fSHO3dptksuhAXlrcclDf +Da8itF625ZbkuN0tAaj6eeIRqV4cYd77UYrd8tF4DGIjJTn/4e6sM+ssRm03Lo2s +OPE5HFbv5q3X4K9+zxI3md3nepUenLZhVKFG1xKtpw+nxkgj/i7oaEknMDq59Jx/ +YgYswCozAHwN61S/XyFyh3DgVSVmZOi+ut/QJRio8vti+6KUwHAkD+s43oKF1I1m +EB455DZQqNs/z+ThIRfCCeftDtECB58o1n7KQ0OHf607Qina9OtPECufgIcXYFC4 +BhaF1E9XjkmmiQE9BBMBCgAnAhsDAh4BAheABQsJCAcDBRUKCQgLBRYCAwEABQJZ +JKWdBQkPjvyYAAoJEBF+jBaO/jp/XtcH/RrsPIyfUmQwRLMxCqy35yh0yePsE2zZ +WKocpZ4TaVe83hKCbDdFLEPclezY5v8j9hq1a2uYdlmQJHESfksNT9qTqLv6djWh +74UDVnzyyQ1zQ7mjrNwUu14zBt8pUJF/rJX5v6jqCWVwgWvWmbUDvn5faTqRdxoN +3sx2Z0/V/dKHXCa5+UxGYqm8KjM2+pcjYFNOh3XK4DWR6kiwkX3RnQwKs5Ptijqv +PXERCn4FRP8gP+UBTUUY/cE4dD5jxcz5LjDR7teqvYnPOKGVLjHMXLFV+QeAJyMZ +DNfqPdPxdcrfez1ncdVk8L0qkzTGd+UKu1y1AUH807kaEZOi+onJRPmJAT0EEwEK +ACcCGwMCHgECF4AFCwkIBwMFFQoJCAsFFgIDAQAFAlsAUi4FCRFcKLcACgkQEX6M +Fo7+On/cBAf/ewi1vMBCSuafD+OUQxidePAo9QvgGFMbIHgyVGm2kL2fxjIt4QAZ +XL+s4pm5hTMF1s+HcfQ/sa8oLfJD02CPz/aaDo2EEFQd6s4mJEtWJwsMHwktc1lm +Gt8IpwVYxC7EGsFgXXZQE6yNy6OhfxAcIHQopbBs7eQedoqIP/4LlOj2cjqjEAAS +XlhJgYAao72wAuglbRlBOhsYAmyhW19I+dzlslCvM082ui0S1ps/tMTbDyXrTGib +wlek733G+6h/09JDp1GzVPHwGigh9auB4W+5Emh6AtwnwAynbJr+QCcDft4PXZUW +ew9kgHk0lwawPXa6WsJ+MxZAx8QVYJduFYkBPgQTAQIAKAIbAwYLCQgHAwIGFQgC +CQoLBBYCAwECHgECF4AFAlVYFjwFCQu6hEUACgkQEX6MFo7+On/aogf/fiBGl5jN +UuY17p4sFlqfdNtKdbfubFPesQtE9BpRy2DNd0Y3QrDUnrLZr9UE7umN2lx8PrJJ +Y33hLj6DbcVuBvbxJxrhGD9hWgBzren4xzGW2dX1WqPLupg3zrmbNOeoUbR1iKUA +s+rO6/lsr+9j6hLWuCADDusOe4pSLfwvU3UDZEV3D11kE+5I9HLR1JEyuJpIp9cf +jFjKY55V/t/vO9UiNK9djSTGuwlBG5BbfQYSKqidvWcd5OswiZ0GRA4vjd5Hg50R +8bh8JpD8ILLYjpL4C2juDjSuiI84+SvC7eXJ+wuMDBvNe2btzuELgFElKmikgeK1 +fNT3G7eKXQq8kLkBDQRLfsVzAQgAvN5jr95pJthv2w9co9/7omhM5rAnr9WJfbML +LiUfPPUvpL24RGO6SKy03aiVTUjlaHc+cGqOciwnNKMCSt+noyG2kNnAESTDtCiv +psjonaFP8jA3TqL0QK+yzBRKJnMnLEY1nWE1FtkMRccXvzi0Z/XQVhiWQyTvDFoK +tepBFrH9UqWbNHyki22aighumUsW01pcPH2ogSj+HR01r7SfI/y2EkE6loHQfCDy +cHmlqYV+X6GZEvf1qu2+EHEQChsHIAxWyshsxM/ZPmx/8e5S3Xmjl7h/6E9wcsIp +vnf504sLX5j4Km9I5HgJSRxHxgRPpqJ2/XiClAJanO5gCw0RdQARAQABiQE8BBgB +CgAmAhsMFiEEtMa0UeT6i0IyyhkeEX6MFo7+On8FAmCVzrsFCRb4PMgACgkQEX6M +Fo7+On/svQgAnigeMeQPF3mDhjy88yNwL2cIdP8IPNU/lx70e5IJfL0cOWX8xX7n +n446Tj7KvACWLlFyhCNI3Wm9a2WMTsTKA8gG/WgDFgOONFN+2KyrCza1fgvzgv89 +ybovdksM5PGtS660O8SsMAIa7HUyObnTJHWJIUQxyzZrw9EQ6kX/JB1NHEX/zKfN +n5E0CPeBXfDYvNzUnBuJkTyBBk0zMF/k05RQ0FrA08SkF/YMAWWrzBbMQTnooSuP +7AHuVudX+P3XIqtVLL3S55HMag0hSA0aW0ghSFqiqabmvtLmJOHL7Ai3/FKCafou +SEd7AfZKfWLGgBslnLrcST5ytRNs4LI9KZkBDQRLfsVzAQgApANWbXDuB+2VBv9G +i+EZWSKM7KK18xa60wLCRB73cvqxwh98UXBc+iDG3wjnVfqCsZQz+z0tL1in6scJ +HpzlLreaPW99rg3RTFuCGxVxEPeALkkKUo6PD5VTJv+daZpkcXSc8j569GA9/JlS +uqlBGCyP+M10oBZOPdxk/GOJtzdfDv/snj5zjiLY+6m6wjAEqAcdUxvGXYPLn3oT +J32/OceMcQHm15KiUKRFU47eJY+KegYa1kfqSFv5wVK89zrFe1sDyo0i4ybUyRcW +F/kRUgqjnX7rLsrKDsaSBzsdVsYxlDgeY354ZquNZ1l3/KM2+fM0qYw6ye4xkPaX +VKQLUQARAQABtB5CcmlhbiBDLiBMYW5lIDxiY2xAcmVkaGF0LmNvbT6JAT0EEwEK +ACcCGwMCHgECF4AFCwkIBwMFFQoJCAsFFgIDAQAFAlVYGtMFCQu6iNwACgkQEX6M +Fo7+On8IuggAj6souVSKFq26OaRPhV1L7kaKBI+1NO/s8G4tCNDu9x+M1dS1uGBP +K4L/ojAKiE8KTdrV8PIo/8O95TRMzVvBNXxtvwKkcL+/E8OCIEN/IDfQ16kj69iJ +5mpZ3cOjQ8QTqsqITXsNZseyKRd3Z1bUKmUXlROErH9zHgHu4u+t/HVxTq8dAqvy +vdq9B+KHdO8QuJWV889i92McrGGnzfV8m40tGXhxeaXpVRAdk7fl+Uy0vyv9gCyL ++Zc76i+Ol+18iG96sHNrAse2fcrPMQci9GBJ/zHyYImJzyNOdO3e6KDUAWm1kRth +tC2LbT91uLq5f2l1WF3taNy5rjmvjANFBLkBDQRLfsVzAQgAvN5jr95pJthv2w9c +o9/7omhM5rAnr9WJfbMLLiUfPPUvpL24RGO6SKy03aiVTUjlaHc+cGqOciwnNKMC +St+noyG2kNnAESTDtCivpsjonaFP8jA3TqL0QK+yzBRKJnMnLEY1nWE1FtkMRccX +vzi0Z/XQVhiWQyTvDFoKtepBFrH9UqWbNHyki22aighumUsW01pcPH2ogSj+HR01 +r7SfI/y2EkE6loHQfCDycHmlqYV+X6GZEvf1qu2+EHEQChsHIAxWyshsxM/ZPmx/ +8e5S3Xmjl7h/6E9wcsIpvnf504sLX5j4Km9I5HgJSRxHxgRPpqJ2/XiClAJanO5g +Cw0RdQARAQABiQElBBgBAgAPAhsMBQJVWBYHBQkLuoQNAAoJEBF+jBaO/jp/S90H +/i/evVsbDpDexbwy2Smg/Kv1ymdqYDsRKhsXln7+nQJteryTwLtIQUHpe0255vTR +4rjvHKYK+JvyjTuuyg5XEEIarqokwlyNiSq3qi5PGCYRkUBzQXxs+lEFoitiRTWr +UH6H0kR9up567mQO3xy6Rw4NdiLwpGpBjofH8u69vkFMNXxWYwlscM70Ye3uCP6E +TFYYdlnD+KHlXtaCKqu4vh9QEVV9lx6qx3Gh4gNcKYQwsGBtNi+QcGlR+cQZnIfQ +yNDmEqwON6sW2LqKSrkBjwN18jK3kDSSTMXKAEIM4OTTayqD9jdoA+j6pJ3QF8m5 +MupQVzWmw8NNbNuPfGmsE/s= +=Frrv +-----END PGP PUBLIC KEY BLOCK----- diff --git a/sources b/sources index fce77d9..aed1bd4 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -0247b6a7b314f8edeb618159fa95f9cb parted-3.2.tar.xz -1b7304b51580d7121a890376ea7406d7 parted-3.2.tar.xz.sig +SHA512 (parted-3.6.tar.xz) = 034a44b25718acba175212019d24f092972a791c5bd1d921ae91e17478657a77c5c5dd0c832bed7968c3a07ec6c65c0785acfac2f90c1ca5e1692f3c141693ef +SHA512 (parted-3.6.tar.xz.sig) = 7c845026937b29fb49085ef9e3354226b73a1c3b5f9082d440d9a8ac13d76b1d07dae0bc10d8c974d4e57bc582f38c0a908e80718dd1ff1adfad3b04699c672c diff --git a/tests/.fmf/version b/tests/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh new file mode 100755 index 0000000..0161a84 --- /dev/null +++ b/tests/scripts/run_tests.sh @@ -0,0 +1,30 @@ +#!/usr/bin/bash +set -eux + +DISK=/var/tmp/parted-disk.img + +# Make a temporary disk image to use for tests +fallocate -l 100MiB $DISK + +# Make a disklabel and a couple of partitions +parted -s $DISK mklabel gpt +parted -s $DISK mkpart vfat 1MiB 10MiB +parted -s $DISK mkpart ext4 10MiB 50MiB +parted -s $DISK mkpart ext4 50MiB 75MiB +parted -s $DISK set 1 boot +parted -s $DISK set 3 linux-home + +# Check p1 for ESP UUID c12a7328-f81f-11d2-ba4b-00a0c93ec93b +P1_TYPE=$(parted -s $DISK --json u MiB p | jq -r '.disk.partitions[0]."type-uuid"') +[ "$P1_TYPE" == "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" ] || exit 1 + +# Check p2 for linux data type 0fc63daf-8483-4772-8e79-3d69d8477de4 +P2_TYPE=$(parted -s $DISK --json u MiB p | jq -r '.disk.partitions[1]."type-uuid"') +[ "$P2_TYPE" == "0fc63daf-8483-4772-8e79-3d69d8477de4" ] || exit 1 + +# Check p3 for linux home type 933ac7e1-2eb4-4f13-b844-0e14e2aef915 +P3_TYPE=$(parted -s $DISK --json u MiB p | jq -r '.disk.partitions[2]."type-uuid"') +[ "$P3_TYPE" == "933ac7e1-2eb4-4f13-b844-0e14e2aef915" ] || exit 1 + +echo "PASS" +exit 0