From 5f2a33e9785f125ba44d65cd43ef4aa2fe8053ee Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Wed, 3 Feb 2021 21:04:02 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/parted.git#4ff1a768b478de8adbcf9799a900f1df726b154d --- ...er-move-and-msdos-overlap-to-python3.patch | 34 -- ...parted-add-fix-to-fix-in-script-mode.patch | 123 ++++++ 0002-doc-Document-fix-flag.patch | 47 +++ 0003-tests-Add-tests-for-fix.patch | 135 +++++++ ...s-Test-incomplete-resizepart-command.patch | 25 -- ...Fix-end_input-usage-in-do_resizepart.patch | 34 -- 0004-tests-Fix-test-t1700-probe-fs.patch | 35 ++ ...d-Add-ChromeOS-Kernel-partition-flag.patch | 283 -------------- ...041-undetected-in-use-16th-partition.patch | 33 ++ ...pport-for-MSDOS-partition-type-bls_b.patch | 139 ------- ...dd-support-for-bls_boot-to-GPT-disks.patch | 248 ------------- ...-reference-to-ped_file_system_create.patch | 29 -- ...-Add-support-for-the-F2FS-filesystem.patch | 201 ---------- ...-tests-Add-f2fs-to-the-fs-probe-test.patch | 27 -- ...resizepart-End-when-prompted-for-bus.patch | 53 --- ...t-for-resizepart-on-a-busy-partition.patch | 85 ----- ...o-not-link-to-libsepol-or-libselinux.patch | 143 ------- ...dify-device-manage-support-detection.patch | 30 -- ...-the-dmsetup-tests-to-use-ENABLE_DEV.patch | 59 --- ...GCC-warning-Wunused-but-set-variable.patch | 51 --- ...rnings-from-GCC-8-Wunused-variable-a.patch | 67 ---- ...rnings-from-GCC-s-Wimplicit-fallthro.patch | 44 --- ...d-a-GCC-warning-for-unused-functions.patch | 61 --- ...rnings-from-GCC-8-Wsuggest-attribute.patch | 248 ------------- ...rnings-from-GCC-8-Wsuggest-attribute.patch | 104 ------ ...plaints-when-using-boot_code-pointer.patch | 41 -- ...plaints-when-using-boot_code-pointer.patch | 25 -- ...mplains-about-signed-sccanf-variable.patch | 38 -- ...-Fix-unsigned-warning-in-duplicate.c.patch | 25 -- ...-hfs-Fix-gcc-10-bounds-check-warning.patch | 41 -- ...gcc-10-warnings-about-cast-alignment.patch | 74 ---- ...ix-gcc-10-warnings-about-cast-alignm.patch | 75 ---- ...gcc-10-warnings-about-cast-alignment.patch | 33 -- ...gcc-10-warnings-about-cast-alignment.patch | 47 --- ...gcc-10-warnings-about-cast-alignment.patch | 49 --- ...gcc-10-warnings-about-cast-alignment.patch | 39 -- ...gcc-10-warnings-about-cast-alignment.patch | 51 --- ...ssert-Fix-incorrect-exception-option.patch | 27 -- 0035-ui-Fix-command_line_get_disk_flag.patch | 27 -- ...rning-about-snprintf-truncating-an-i.patch | 31 -- ...gcc-10-warnings-about-cast-alignment.patch | 98 ----- ...ix-gcc-10-warnings-about-cast-alignm.patch | 103 ------ 0039-fs-r-fat-Remove-disabled-code.patch | 350 ------------------ 0040-fs-r-hfs-Remove-disabled-code.patch | 228 ------------ 0041-libparted-Remove-disabled-code.patch | 108 ------ ...-GCC-warnings-suggesting-pure-for-PE.patch | 112 ------ parted.spec | 254 +------------ 47 files changed, 384 insertions(+), 3830 deletions(-) delete mode 100644 0001-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch create mode 100644 0001-parted-add-fix-to-fix-in-script-mode.patch create mode 100644 0002-doc-Document-fix-flag.patch create mode 100644 0003-tests-Add-tests-for-fix.patch delete mode 100644 0003-tests-Test-incomplete-resizepart-command.patch delete mode 100644 0004-Fix-end_input-usage-in-do_resizepart.patch create mode 100644 0004-tests-Fix-test-t1700-probe-fs.patch delete mode 100644 0005-libparted-Add-ChromeOS-Kernel-partition-flag.patch create mode 100644 0005-tests-Fix-t9041-undetected-in-use-16th-partition.patch delete mode 100644 0006-libparted-Add-support-for-MSDOS-partition-type-bls_b.patch delete mode 100644 0007-libparted-Add-support-for-bls_boot-to-GPT-disks.patch delete mode 100644 0008-Removed-reference-to-ped_file_system_create.patch delete mode 100644 0009-Add-support-for-the-F2FS-filesystem.patch delete mode 100644 0010-tests-Add-f2fs-to-the-fs-probe-test.patch delete mode 100644 0011-parted-Preserve-resizepart-End-when-prompted-for-bus.patch delete mode 100644 0012-tests-Add-a-test-for-resizepart-on-a-busy-partition.patch delete mode 100644 0013-Do-not-link-to-libsepol-or-libselinux.patch delete mode 100644 0014-t6001-psep-modify-device-manage-support-detection.patch delete mode 100644 0015-tests-Update-all-the-dmsetup-tests-to-use-ENABLE_DEV.patch delete mode 100644 0016-libparted-Fix-a-GCC-warning-Wunused-but-set-variable.patch delete mode 100644 0017-libparted-Fix-warnings-from-GCC-8-Wunused-variable-a.patch delete mode 100644 0018-libparted-Fix-warnings-from-GCC-s-Wimplicit-fallthro.patch delete mode 100644 0019-libparted-Avoid-a-GCC-warning-for-unused-functions.patch delete mode 100644 0020-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch delete mode 100644 0021-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch delete mode 100644 0022-bsd-Fix-gcc-complaints-when-using-boot_code-pointer.patch delete mode 100644 0023-dos-Fix-gcc-complaints-when-using-boot_code-pointer.patch delete mode 100644 0024-linux-Fix-gcc-complains-about-signed-sccanf-variable.patch delete mode 100644 0025-tests-Fix-unsigned-warning-in-duplicate.c.patch delete mode 100644 0026-hfs-Fix-gcc-10-bounds-check-warning.patch delete mode 100644 0027-hfs-advfs-Fix-gcc-10-warnings-about-cast-alignment.patch delete mode 100644 0028-hfs-advfs_plus-Fix-gcc-10-warnings-about-cast-alignm.patch delete mode 100644 0029-hfs-hfs-Fix-gcc-10-warnings-about-cast-alignment.patch delete mode 100644 0030-ext2-Fix-gcc-10-warnings-about-cast-alignment.patch delete mode 100644 0031-nilfs2-Fix-gcc-10-warnings-about-cast-alignment.patch delete mode 100644 0032-ntfs-Fix-gcc-10-warnings-about-cast-alignment.patch delete mode 100644 0033-ufs-Fix-gcc-10-warnings-about-cast-alignment.patch delete mode 100644 0034-ped_assert-Fix-incorrect-exception-option.patch delete mode 100644 0035-ui-Fix-command_line_get_disk_flag.patch delete mode 100644 0036-ui-Fix-gcc-10-warning-about-snprintf-truncating-an-i.patch delete mode 100644 0037-hfs-reloc-Fix-gcc-10-warnings-about-cast-alignment.patch delete mode 100644 0038-hfs-reloc_plus-Fix-gcc-10-warnings-about-cast-alignm.patch delete mode 100644 0039-fs-r-fat-Remove-disabled-code.patch delete mode 100644 0040-fs-r-hfs-Remove-disabled-code.patch delete mode 100644 0041-libparted-Remove-disabled-code.patch delete mode 100644 0042-libparted-fs-Fix-GCC-warnings-suggesting-pure-for-PE.patch diff --git a/0001-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch b/0001-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch deleted file mode 100644 index 90bf71a..0000000 --- a/0001-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 22a4baba11ab299722e68f9ea37a53869afef7e1 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Wed, 27 Jun 2018 13:47:33 -0700 -Subject: [PATCH 1/4] Switch gpt-header-move and msdos-overlap to python3 - -python2 is EOL on January 1, 2020 so it is time to switch to python3. ---- - tests/gpt-header-move | 2 +- - tests/msdos-overlap | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tests/gpt-header-move b/tests/gpt-header-move -index 3dda5cb..18f58d0 100755 ---- a/tests/gpt-header-move -+++ b/tests/gpt-header-move -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python3 - - # open img file, subtract 33 from altlba address, and move the last 33 sectors - # back by 33 sectors -diff --git a/tests/msdos-overlap b/tests/msdos-overlap -index d6ae8d6..b2b03e6 100755 ---- a/tests/msdos-overlap -+++ b/tests/msdos-overlap -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python3 - """ - Write an overlapping partition to a msdos disk - --- -2.23.0 - diff --git a/0001-parted-add-fix-to-fix-in-script-mode.patch b/0001-parted-add-fix-to-fix-in-script-mode.patch new file mode 100644 index 0000000..be907eb --- /dev/null +++ b/0001-parted-add-fix-to-fix-in-script-mode.patch @@ -0,0 +1,123 @@ +From 7c9a96209af2b84e1eec98ad3527f82ddd966cdf Mon Sep 17 00:00:00 2001 +From: Cristian Klein +Date: Fri, 11 Dec 2020 22:19:22 +0100 +Subject: [PATCH 1/5] parted: add --fix to "fix" in script mode + +Use-case: VMs are booted from images that are smaller than their virtual +disk. This means that -- almost by definition -- the secondary GPT +header will be "misplaced", i.e., not at the end of the virtual disk. + +Without this patch, parted cannot be used for custom/exotic partitioning +when the VM boots (e.g., in cloud-init's `bootcmd`). Specifically, it +will fail as follows: + +``` +$ sudo parted --script /dev/vda "mkpart 2 10GB -1" +Warning: Not all of the space available to /dev/vda appears to be used, +you can fix the GPT to use all of the space (an extra 500 blocks) or continue with the current setting? +Error: Unable to satisfy all constraints on the partition. +``` + +This happens because, in script mode, exceptions are usually not +resolved. + +This patch adds `--fix`. This allows exceptions to be automatically +resolved with Fix. As a result, the following command will work: + +``` +$ sudo parted --fix --script /dev/vda "mkpart 2 10GB -1" +``` + +Signed-off-by: Brian C. Lane +--- + parted/parted.c | 8 ++++++-- + parted/ui.c | 7 +++++++ + parted/ui.h | 1 + + 3 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/parted/parted.c b/parted/parted.c +index e84e66d..41edb7f 100644 +--- a/parted/parted.c ++++ b/parted/parted.c +@@ -116,6 +116,7 @@ static struct option const options[] = { + {"list", 0, NULL, 'l'}, + {"machine", 0, NULL, 'm'}, + {"script", 0, NULL, 's'}, ++ {"fix", 0, NULL, 'f'}, + {"version", 0, NULL, 'v'}, + {"align", required_argument, NULL, 'a'}, + {"-pretend-input-tty", 0, NULL, PRETEND_INPUT_TTY}, +@@ -127,12 +128,14 @@ static const char *const options_help [][2] = { + {"list", N_("lists partition layout on all block devices")}, + {"machine", N_("displays machine parseable output")}, + {"script", N_("never prompts for user intervention")}, ++ {"fix", N_("in script mode, fix instead of abort when asked")}, + {"version", N_("displays the version")}, + {"align=[none|cyl|min|opt]", N_("alignment for new partitions")}, + {NULL, NULL} + }; + + int opt_script_mode = 0; ++int opt_fix_mode = 0; + int pretend_input_tty = 0; + int opt_machine_mode = 0; + int disk_is_modified = 0; +@@ -2191,7 +2194,7 @@ int opt, help = 0, list = 0, version = 0, wrong = 0; + + while (1) + { +- opt = getopt_long (*argc_ptr, *argv_ptr, "hlmsva:", ++ opt = getopt_long (*argc_ptr, *argv_ptr, "hlmsfva:", + options, NULL); + if (opt == -1) + break; +@@ -2201,6 +2204,7 @@ while (1) + case 'l': list = 1; break; + case 'm': opt_machine_mode = 1; break; + case 's': opt_script_mode = 1; break; ++ case 'f': opt_fix_mode = 1; break; + case 'v': version = 1; break; + case 'a': + alignment = XARGMATCH ("--align", optarg, +@@ -2217,7 +2221,7 @@ while (1) + + if (wrong == 1) { + fprintf (stderr, +- _("Usage: %s [-hlmsv] [-a] [DEVICE [COMMAND [PARAMETERS]]...]\n"), ++ _("Usage: %s [-hlmsfv] [-a] [DEVICE [COMMAND [PARAMETERS]]...]\n"), + program_name); + return 0; + } +diff --git a/parted/ui.c b/parted/ui.c +index 973bd26..b5948d3 100644 +--- a/parted/ui.c ++++ b/parted/ui.c +@@ -644,6 +644,13 @@ exception_handler (PedException* ex) + if (!option_get_next (ex->options, opt)) + return opt; + ++ /* 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"); ++ return PED_EXCEPTION_FIX; ++ } ++ + /* script-mode: don't handle the exception */ + if (opt_script_mode || (!isatty (0) && !pretend_input_tty)) + return PED_EXCEPTION_UNHANDLED; +diff --git a/parted/ui.h b/parted/ui.h +index 3b07782..e4e88b6 100644 +--- a/parted/ui.h ++++ b/parted/ui.h +@@ -89,6 +89,7 @@ extern void print_using_dev (PedDevice* dev); + + /* in parted.c */ + extern int opt_script_mode; ++extern int opt_fix_mode; + extern int pretend_input_tty; + + extern void print_options_help (); +-- +2.26.2 + diff --git a/0002-doc-Document-fix-flag.patch b/0002-doc-Document-fix-flag.patch new file mode 100644 index 0000000..0961dda --- /dev/null +++ b/0002-doc-Document-fix-flag.patch @@ -0,0 +1,47 @@ +From 8aa569aa60c37526a8c37b06e88a833745a7a6ef Mon Sep 17 00:00:00 2001 +From: Cristian Klein +Date: Fri, 11 Dec 2020 22:19:23 +0100 +Subject: [PATCH 2/5] doc: Document --fix flag + +Also fix copyright year, to please `make syntax-check`. + +Signed-off-by: Brian C. Lane +--- + doc/C/parted.8 | 3 +++ + doc/parted.texi | 6 ++++++ + 2 files changed, 9 insertions(+) + +diff --git a/doc/C/parted.8 b/doc/C/parted.8 +index 297c39a..d8e556e 100644 +--- a/doc/C/parted.8 ++++ b/doc/C/parted.8 +@@ -27,6 +27,9 @@ displays machine parseable output + .B -s, --script + never prompts for user intervention + .TP ++.B -f, --fix ++automatically answer "fix" to exceptions in script mode ++.TP + .B -v, --version + displays the version + .TP +diff --git a/doc/parted.texi b/doc/parted.texi +index d89d74d..33212f0 100644 +--- a/doc/parted.texi ++++ b/doc/parted.texi +@@ -406,6 +406,12 @@ display a help message + @itemx --script + never prompt the user + ++@item -f ++@itemx --fix ++automatically answer exceptions with "fix" in script mode, whcih is useful for: ++GPT header not including full disk size; moving the backup GPT table to the end of the disk; ++MAC fix missing partition map entry; etc. ++ + @item -a alignment-type + @itemx --align alignment-type + Set alignment for newly created partitions, valid alignment types are: +-- +2.26.2 + diff --git a/0003-tests-Add-tests-for-fix.patch b/0003-tests-Add-tests-for-fix.patch new file mode 100644 index 0000000..4fe4ef9 --- /dev/null +++ b/0003-tests-Add-tests-for-fix.patch @@ -0,0 +1,135 @@ +From 6b2c8806b42a7214d726cc2b3dac6b96013a6cce Mon Sep 17 00:00:00 2001 +From: Cristian Klein +Date: Fri, 11 Dec 2020 22:19:24 +0100 +Subject: [PATCH 3/5] tests: Add tests for --fix + +Signed-off-by: Brian C. Lane +--- + tests/Makefile.am | 3 +- + tests/t9060-gpt-grow-script-fix.sh | 100 +++++++++++++++++++++++++++++ + 2 files changed, 102 insertions(+), 1 deletion(-) + create mode 100755 tests/t9060-gpt-grow-script-fix.sh + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 0d7c022..3473e6b 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -89,7 +89,8 @@ TESTS = \ + t9040-many-partitions.sh \ + t9041-undetected-in-use-16th-partition.sh \ + t9042-dos-partition-limit.sh \ +- t9050-partition-table-types.sh ++ t9050-partition-table-types.sh \ ++ t9060-gpt-grow-script-fix.sh + + EXTRA_DIST = \ + $(TESTS) t-local.sh t-lvm.sh \ +diff --git a/tests/t9060-gpt-grow-script-fix.sh b/tests/t9060-gpt-grow-script-fix.sh +new file mode 100755 +index 0000000..4a3a8a9 +--- /dev/null ++++ b/tests/t9060-gpt-grow-script-fix.sh +@@ -0,0 +1,100 @@ ++#!/bin/sh ++# grow a gpt disk, ensure that parted offers to update the gpt size ++# do this in script mode with fix ++ ++# Copyright (C) 2009-2012, 2014, 2019 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_ ++dev=loop-file ++ ++ss=$sector_size_ ++n_sectors=5000 ++ ++dd if=/dev/null of=$dev bs=$ss seek=$n_sectors || fail=1 ++ ++# create gpt label ++parted -s $dev mklabel gpt > empty 2>&1 || fail=1 ++compare /dev/null empty || fail=1 ++ ++# print the empty table ++parted -m -s $dev unit s print > t 2>&1 || fail=1 ++sed "s,.*/$dev:,$dev:," t > out || fail=1 ++ ++# check for expected output ++printf "BYT;\n$dev:${n_sectors}s:file:$sector_size_:$sector_size_:gpt::;\n" \ ++ > exp || fail=1 ++compare exp out || fail=1 ++ ++# grow disk ++n_sectors=5500 ++dd if=/dev/null of=$dev bs=$ss seek=$n_sectors || fail=1 ++ ++# printing must warn, but not fix in script mode ++parted -s $dev print > out 2>&1 || fail=1 ++ ++# 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,/.*/$dev,DEVICE,;s, * ,,g;s, $,," \ ++ -e "s,^.*/lt-parted: ,parted: ," o2 > out ++ ++# check for expected diagnostic ++cat < exp || fail=1 ++Warning: Not all of the space available to DEVICE appears to be used, you can fix the GPT to use all of the space (an extra 500 blocks) or continue with the current setting? ++Model: (file) ++Disk DEVICE: 2816kB ++Sector size (logical/physical): 512B/512B ++Partition Table: gpt ++Disk Flags: ++ ++Number Start End Size File system Name Flags ++ ++EOF ++compare exp out || fail=1 ++ ++# now we fix ++parted --script --fix $dev print > out 2>&1 || fail=1 ++ ++# 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,/.*/$dev,DEVICE,;s, * ,,g;s, $,," \ ++ -e "s,^.*/lt-parted: ,parted: ," o2 > out ++ ++# check for expected diagnostic ++cat < exp || fail=1 ++Warning: Not all of the space available to DEVICE appears to be used, you can fix the GPT to use all of the space (an extra 500 blocks) or continue with the current setting? ++Fixing, due to --fix ++Model: (file) ++Disk DEVICE: 2816kB ++Sector size (logical/physical): 512B/512B ++Partition Table: gpt ++Disk Flags: ++ ++Number Start End Size File system Name Flags ++ ++EOF ++compare exp out || fail=1 ++ ++ ++# Now should not warn ++ ++parted -s $dev print > err 2>&1 || fail=1 ++grep Warning: err > k ; mv k err ++compare /dev/null err || fail=1 ++ ++Exit $fail +-- +2.26.2 + diff --git a/0003-tests-Test-incomplete-resizepart-command.patch b/0003-tests-Test-incomplete-resizepart-command.patch deleted file mode 100644 index cbea90a..0000000 --- a/0003-tests-Test-incomplete-resizepart-command.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 679da92c54c75d7fca1fd825f1d42a750d115f2d Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 23 Apr 2019 10:25:20 -0700 -Subject: [PATCH 3/4] tests: Test incomplete resizepart command - ---- - tests/t3200-resize-partition.sh | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/tests/t3200-resize-partition.sh b/tests/t3200-resize-partition.sh -index 4565e99..06dbe68 100755 ---- a/tests/t3200-resize-partition.sh -+++ b/tests/t3200-resize-partition.sh -@@ -63,6 +63,8 @@ parted -m -s $dev u s p > out 2>&1 || fail=1 - wait_for_dev_to_appear_ ${dev}1 || { warn_ "${dev}1 did not appear" fail=1; } - sleep 1 - -+# Running it without end should not core-dump or prompt -+parted -s $dev resizepart 1 > out 2> err || fail=1 - - # extend the filesystem to end on sector 4096 - new_end=4096s --- -2.23.0 - diff --git a/0004-Fix-end_input-usage-in-do_resizepart.patch b/0004-Fix-end_input-usage-in-do_resizepart.patch deleted file mode 100644 index 2d570fd..0000000 --- a/0004-Fix-end_input-usage-in-do_resizepart.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ca845aeeddb17343c9289816833ca352f7c0d87b Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 23 Apr 2019 13:52:25 -0700 -Subject: [PATCH 4/4] Fix end_input usage in do_resizepart - -It needs to be set to NULL, since it may not get set by the call to -command_line_get_sector ---- - parted/parted.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/parted/parted.c b/parted/parted.c -index 9dcdb05..df0c7ed 100644 ---- a/parted/parted.c -+++ b/parted/parted.c -@@ -1545,6 +1545,7 @@ do_resizepart (PedDevice** dev, PedDisk** diskp) - PedGeometry *range_end = NULL; - PedConstraint* constraint; - int rc = 0; -+ char* end_input = NULL; - - if (!disk) { - disk = ped_disk_new (*dev); -@@ -1565,7 +1566,6 @@ do_resizepart (PedDevice** dev, PedDisk** diskp) - - start = part->geom.start; - end = oldend = part->geom.end; -- char *end_input; - if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, &end_input)) - goto error; - _adjust_end_if_iec(&start, &end, range_end, end_input); --- -2.23.0 - diff --git a/0004-tests-Fix-test-t1700-probe-fs.patch b/0004-tests-Fix-test-t1700-probe-fs.patch new file mode 100644 index 0000000..d96b771 --- /dev/null +++ b/0004-tests-Fix-test-t1700-probe-fs.patch @@ -0,0 +1,35 @@ +From 9bb4afe61426419c8bb83a25aa9822e00611c8f3 Mon Sep 17 00:00:00 2001 +From: Cristian Klein +Date: Fri, 11 Dec 2020 22:19:25 +0100 +Subject: [PATCH 4/5] tests: Fix test t1700-probe-fs + +mkfs.ext3 (see version below) was complaining that the filesystem is too small +for a journal, which made the test fail. + +``` +$ mkfs.ext3 -V +mke2fs 1.45.5 (07-Jan-2020) + Using EXT2FS Library version 1.45.5 +``` + +Signed-off-by: Brian C. Lane +--- + 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 848d3e3..5c08e97 100755 +--- a/tests/t1700-probe-fs.sh ++++ b/tests/t1700-probe-fs.sh +@@ -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 || skip_ "dd failed" ++ dd if=/dev/null of=$dev bs=1024 seek=8192 >/dev/null || skip_ "dd failed" + mkfs.ext3 -F $dev >/dev/null || skip_ "mkfs.ext3 failed" + + # set the feature +-- +2.26.2 + diff --git a/0005-libparted-Add-ChromeOS-Kernel-partition-flag.patch b/0005-libparted-Add-ChromeOS-Kernel-partition-flag.patch deleted file mode 100644 index 7a4605a..0000000 --- a/0005-libparted-Add-ChromeOS-Kernel-partition-flag.patch +++ /dev/null @@ -1,283 +0,0 @@ -From e29dfafcf2d9a6886a66506bc84efb4badc5f6d6 Mon Sep 17 00:00:00 2001 -From: Alper Nebi Yasak -Date: Thu, 10 Oct 2019 21:03:22 +0300 -Subject: [PATCH] libparted: Add ChromeOS Kernel partition flag - -This adds a GPT-only partition type flag, chromeos_kernel, for use on -Chrome OS machines, with GUID FE3A2A5D-4F32-41A7-B725-ACCC3285A309. - -The firmware/bootloader in these machines relies on special images being -written to partitions of this type. Among multiple such partitions, it -decides which one it will boot from based on the GUID-specific partition -attributes. This patch is not intended to and does not manipulate these -bits. - -Google refers to these partitions as "ChromeOS kernel" partitions. They -also define partitions for rootfs, firmware, and a reserved one; but -these are not necessary for the boot flow and are not included here. - -Relevant ChromiumOS documentation: -https://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format - -Signed-off-by: Alper Nebi Yasak ---- - doc/C/parted.8 | 2 +- - doc/parted.texi | 4 ++++ - include/parted/disk.in.h | 5 +++-- - libparted/disk.c | 2 ++ - libparted/labels/gpt.c | 45 ++++++++++++++++++++++++++++++++++++++++ - 5 files changed, 55 insertions(+), 3 deletions(-) - -diff --git a/doc/C/parted.8 b/doc/C/parted.8 -index 15932c2..d40279e 100644 ---- a/doc/C/parted.8 -+++ b/doc/C/parted.8 -@@ -112,7 +112,7 @@ 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" and "palo". -+"legacy_boot", "irst", "msftres", "esp", "chromeos_kernel" and "palo". - \fIstate\fP should be either "on" or "off". - .TP - .B unit \fIunit\fP -diff --git a/doc/parted.texi b/doc/parted.texi -index 77c9628..f983d2c 100644 ---- a/doc/parted.texi -+++ b/doc/parted.texi -@@ -874,6 +874,10 @@ partition. - (MS-DOS, GPT) - this flag identifies a UEFI System Partition. On GPT - it is an alias for boot. - -+@item chromeos_kernel -+(GPT) - this flag indicates a partition that can be used with the Chrome OS -+bootloader and verified boot implementation. -+ - @item lba - (MS-DOS) - this flag can be enabled to tell MS DOS, MS Windows 9x and - MS Windows ME based operating systems to use Linear (LBA) mode. -diff --git a/include/parted/disk.in.h b/include/parted/disk.in.h -index a3b380d..b257c27 100644 ---- a/include/parted/disk.in.h -+++ b/include/parted/disk.in.h -@@ -75,10 +75,11 @@ enum _PedPartitionFlag { - PED_PARTITION_LEGACY_BOOT=15, - PED_PARTITION_MSFT_DATA=16, - PED_PARTITION_IRST=17, -- PED_PARTITION_ESP=18 -+ PED_PARTITION_ESP=18, -+ PED_PARTITION_CHROMEOS_KERNEL=19 - }; - #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT --#define PED_PARTITION_LAST_FLAG PED_PARTITION_ESP -+#define PED_PARTITION_LAST_FLAG PED_PARTITION_CHROMEOS_KERNEL - - enum _PedDiskTypeFeature { - PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ -diff --git a/libparted/disk.c b/libparted/disk.c -index 5aaac5a..d1f1077 100644 ---- a/libparted/disk.c -+++ b/libparted/disk.c -@@ -2407,6 +2407,8 @@ ped_partition_flag_get_name (PedPartitionFlag flag) - return N_("irst"); - case PED_PARTITION_ESP: - return N_("esp"); -+ case PED_PARTITION_CHROMEOS_KERNEL: -+ return N_("chromeos_kernel"); - - default: - ped_exception_throw ( -diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c -index 8e9500b..b8b58cd 100644 ---- a/libparted/labels/gpt.c -+++ b/libparted/labels/gpt.c -@@ -156,6 +156,10 @@ typedef struct - ((efi_guid_t) { PED_CPU_TO_LE32 (0xD3BFE2DE), PED_CPU_TO_LE16 (0x3DAF), \ - PED_CPU_TO_LE16 (0x11DF), 0xba, 0x40, \ - { 0xE3, 0xA5, 0x56, 0xD8, 0x95, 0x93 }}) -+#define PARTITION_CHROMEOS_KERNEL_GUID \ -+ ((efi_guid_t) { PED_CPU_TO_LE32 (0xfe3a2a5d), PED_CPU_TO_LE16 (0x4f32), \ -+ PED_CPU_TO_LE16 (0x41a7), 0xb7, 0x25, \ -+ { 0xac, 0xcc, 0x32, 0x85, 0xa3, 0x09 }}) - - struct __attribute__ ((packed)) _GuidPartitionTableHeader_t - { -@@ -303,6 +307,7 @@ typedef struct _GPTPartitionData - int legacy_boot; - int prep; - int irst; -+ int chromeos_kernel; - } GPTPartitionData; - - static PedDiskType gpt_disk_type; -@@ -826,6 +831,7 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte) - = gpt_part_data->legacy_boot - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->bios_grub = gpt_part_data->atvrecv = 0; - - if (pte->Attributes.RequiredToFunction & 0x1) -@@ -857,6 +863,8 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte) - gpt_part_data->prep = 1; - else if (!guid_cmp (gpt_part_data->type, PARTITION_IRST_GUID)) - gpt_part_data->irst = 1; -+ else if (!guid_cmp (gpt_part_data->type, PARTITION_CHROMEOS_KERNEL_GUID)) -+ gpt_part_data->chromeos_kernel = 1; - - return part; - } -@@ -1377,6 +1385,7 @@ gpt_partition_new (const PedDisk *disk, - gpt_part_data->prep = 0; - gpt_part_data->translated_name = 0; - gpt_part_data->irst = 0; -+ gpt_part_data->chromeos_kernel = 0; - uuid_generate ((unsigned char *) &gpt_part_data->uuid); - swap_uuid_and_efi_guid (&gpt_part_data->uuid); - memset (gpt_part_data->name, 0, sizeof gpt_part_data->name); -@@ -1507,6 +1516,11 @@ gpt_partition_set_system (PedPartition *part, - gpt_part_data->type = PARTITION_IRST_GUID; - return 1; - } -+ if (gpt_part_data->chromeos_kernel) -+ { -+ gpt_part_data->type = PARTITION_CHROMEOS_KERNEL_GUID; -+ return 1; -+ } - - if (fs_type) - { -@@ -1653,6 +1667,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_BIOS_GRUB: -@@ -1668,6 +1683,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_RAID: -@@ -1683,6 +1699,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_LVM: -@@ -1698,6 +1715,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_SWAP: -@@ -1713,6 +1731,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_HPSERVICE: -@@ -1728,6 +1747,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_MSFT_RESERVED: -@@ -1743,6 +1763,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_MSFT_DATA: -@@ -1758,6 +1779,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - gpt_part_data->msftdata = 1; - } else { -@@ -1777,6 +1799,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftres - = gpt_part_data->prep - = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_APPLE_TV_RECOVERY: -@@ -1791,6 +1814,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftres - = gpt_part_data->msftdata - = gpt_part_data->prep -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->msftrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_PREP: -@@ -1805,6 +1829,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftres - = gpt_part_data->irst - = gpt_part_data->atvrecv -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->msftrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_IRST: -@@ -1820,8 +1845,25 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftdata - = gpt_part_data->msftrecv - = gpt_part_data->prep -+ = gpt_part_data->chromeos_kernel - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); -+ case PED_PARTITION_CHROMEOS_KERNEL: -+ gpt_part_data->chromeos_kernel = state; -+ if (state) -+ gpt_part_data->boot -+ = gpt_part_data->bios_grub -+ = gpt_part_data->raid -+ = gpt_part_data->lvm -+ = gpt_part_data->swap -+ = gpt_part_data->hp_service -+ = gpt_part_data->msftres -+ = gpt_part_data->msftdata -+ = gpt_part_data->msftrecv -+ = gpt_part_data->atvrecv -+ = gpt_part_data->prep -+ = gpt_part_data->irst = 0; -+ return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_HIDDEN: - gpt_part_data->hidden = state; - return 1; -@@ -1874,6 +1916,8 @@ gpt_partition_get_flag (const PedPartition *part, PedPartitionFlag flag) - return gpt_part_data->irst; - case PED_PARTITION_SWAP: - return gpt_part_data->swap; -+ case PED_PARTITION_CHROMEOS_KERNEL: -+ return gpt_part_data->chromeos_kernel; - case PED_PARTITION_LBA: - case PED_PARTITION_ROOT: - default: -@@ -1903,6 +1947,7 @@ gpt_partition_is_flag_available (const PedPartition *part, - case PED_PARTITION_PREP: - case PED_PARTITION_IRST: - case PED_PARTITION_ESP: -+ case PED_PARTITION_CHROMEOS_KERNEL: - return 1; - case PED_PARTITION_ROOT: - case PED_PARTITION_LBA: --- -2.24.1 - diff --git a/0005-tests-Fix-t9041-undetected-in-use-16th-partition.patch b/0005-tests-Fix-t9041-undetected-in-use-16th-partition.patch new file mode 100644 index 0000000..a998543 --- /dev/null +++ b/0005-tests-Fix-t9041-undetected-in-use-16th-partition.patch @@ -0,0 +1,33 @@ +From 6ed9c9e82ea6cfbee93a47e82e92a90abdb82343 Mon Sep 17 00:00:00 2001 +From: Cristian Klein +Date: Fri, 11 Dec 2020 22:19:26 +0100 +Subject: [PATCH 5/5] tests: Fix t9041-undetected-in-use-16th-partition + +Sometimes fails with: +``` ++ mkfs.ext3 /dev/sda15 +mke2fs 1.45.5 (07-Jan-2020) +/dev/sda15: Not enough space to build proposed filesystem while setting up superblock +``` + +Signed-off-by: Brian C. Lane +--- + tests/t9041-undetected-in-use-16th-partition.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/t9041-undetected-in-use-16th-partition.sh b/tests/t9041-undetected-in-use-16th-partition.sh +index a4a3020..129bf15 100644 +--- a/tests/t9041-undetected-in-use-16th-partition.sh ++++ b/tests/t9041-undetected-in-use-16th-partition.sh +@@ -25,7 +25,7 @@ grep '^#define USE_BLKID 1' "$CONFIG_HEADER" > /dev/null || + skip_ 'this system lacks a new-enough libblkid' + + ss=$sector_size_ +-partition_sectors=256 # sectors per partition ++partition_sectors=512 # sectors per partition + n_partitions=17 # how many partitions to create + start=2048 # start sector for the first partition + gpt_slop=34 # sectors at end of disk reserved for GPT +-- +2.26.2 + diff --git a/0006-libparted-Add-support-for-MSDOS-partition-type-bls_b.patch b/0006-libparted-Add-support-for-MSDOS-partition-type-bls_b.patch deleted file mode 100644 index 7bba38a..0000000 --- a/0006-libparted-Add-support-for-MSDOS-partition-type-bls_b.patch +++ /dev/null @@ -1,139 +0,0 @@ -From d6056299028f60b96802487de0d1d65e51e1fd33 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 19 Dec 2019 16:05:59 -0800 -Subject: [PATCH 6/7] libparted: Add support for MSDOS partition type bls_boot - (0xea) - -This type is used by the Boot Loader Specification to identify a -compatible /boot boot partition. ---- - doc/C/parted.8 | 2 +- - libparted/labels/dos.c | 33 ++++++++++++++++++++------------- - 2 files changed, 21 insertions(+), 14 deletions(-) - -diff --git a/doc/C/parted.8 b/doc/C/parted.8 -index d40279e..297c39a 100644 ---- a/doc/C/parted.8 -+++ b/doc/C/parted.8 -@@ -112,7 +112,7 @@ 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" and "palo". -+"legacy_boot", "irst", "msftres", "esp", "chromeos_kernel", "bls_boot" and "palo". - \fIstate\fP should be either "on" or "off". - .TP - .B unit \fIunit\fP -diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c -index ed1341e..d859b33 100644 ---- a/libparted/labels/dos.c -+++ b/libparted/labels/dos.c -@@ -92,6 +92,7 @@ static const char MBR_BOOT_CODE[] = { - #define PARTITION_HFS 0xaf - #define PARTITION_SUN_UFS 0xbf - #define PARTITION_DELL_DIAG 0xde -+#define PARTITION_BLS_BOOT 0xea - #define PARTITION_GPT 0xee - #define PARTITION_ESP 0xef - #define PARTITION_PALO 0xf0 -@@ -165,6 +166,7 @@ typedef struct { - int diag; - int irst; - int esp; -+ int bls_boot; - OrigState* orig; /* used for CHS stuff */ - } DosPartitionData; - -@@ -961,6 +963,7 @@ raw_part_parse (const PedDisk* disk, const DosRawPartition* raw_part, - dos_data->prep = raw_part->type == PARTITION_PREP; - dos_data->irst = raw_part->type == PARTITION_IRST; - dos_data->esp = raw_part->type == PARTITION_ESP; -+ dos_data->bls_boot = raw_part->type == PARTITION_BLS_BOOT; - dos_data->orig = ped_malloc (sizeof (OrigState)); - if (!dos_data->orig) { - ped_partition_destroy (part); -@@ -1340,22 +1343,10 @@ msdos_partition_new (const PedDisk* disk, PedPartitionType part_type, - - if (ped_partition_is_active (part)) { - part->disk_specific -- = dos_data = ped_malloc (sizeof (DosPartitionData)); -+ = dos_data = ped_calloc (sizeof (DosPartitionData)); - if (!dos_data) - goto error_free_part; -- dos_data->orig = NULL; - dos_data->system = PARTITION_LINUX; -- dos_data->hidden = 0; -- dos_data->msftres = 0; -- dos_data->boot = 0; -- dos_data->diag = 0; -- dos_data->raid = 0; -- dos_data->lvm = 0; -- dos_data->lba = 0; -- dos_data->palo = 0; -- dos_data->prep = 0; -- dos_data->irst = 0; -- dos_data->esp = 0; - } else { - part->disk_specific = NULL; - } -@@ -1394,6 +1385,7 @@ msdos_partition_duplicate (const PedPartition* part) - new_dos_data->prep = old_dos_data->prep; - new_dos_data->irst = old_dos_data->irst; - new_dos_data->esp = old_dos_data->esp; -+ new_dos_data->bls_boot = old_dos_data->bls_boot; - - if (old_dos_data->orig) { - new_dos_data->orig = ped_malloc (sizeof (OrigState)); -@@ -1492,6 +1484,10 @@ msdos_partition_set_system (PedPartition* part, - dos_data->system = PARTITION_ESP; - return 1; - } -+ if (dos_data->bls_boot) { -+ dos_data->system = PARTITION_BLS_BOOT; -+ return 1; -+ } - - if (!fs_type) - dos_data->system = PARTITION_LINUX; -@@ -1534,6 +1530,7 @@ clear_flags (DosPartitionData *dos_data) - dos_data->irst = 0; - dos_data->esp = 0; - dos_data->raid = 0; -+ dos_data->bls_boot = 0; - } - - static int -@@ -1635,6 +1632,12 @@ msdos_partition_set_flag (PedPartition* part, - dos_data->esp = state; - return ped_partition_set_system (part, part->fs_type); - -+ case PED_PARTITION_BLS_BOOT: -+ if (state) -+ clear_flags (dos_data); -+ dos_data->bls_boot = state; -+ return ped_partition_set_system (part, part->fs_type); -+ - default: - return 0; - } -@@ -1689,6 +1692,9 @@ msdos_partition_get_flag (const PedPartition* part, PedPartitionFlag flag) - case PED_PARTITION_ESP: - return dos_data->esp; - -+ case PED_PARTITION_BLS_BOOT: -+ return dos_data->bls_boot; -+ - default: - return 0; - } -@@ -1719,6 +1725,7 @@ msdos_partition_is_flag_available (const PedPartition* part, - case PED_PARTITION_PREP: - case PED_PARTITION_IRST: - case PED_PARTITION_ESP: -+ case PED_PARTITION_BLS_BOOT: - case PED_PARTITION_DIAG: - return 1; - --- -2.24.1 - diff --git a/0007-libparted-Add-support-for-bls_boot-to-GPT-disks.patch b/0007-libparted-Add-support-for-bls_boot-to-GPT-disks.patch deleted file mode 100644 index d46742f..0000000 --- a/0007-libparted-Add-support-for-bls_boot-to-GPT-disks.patch +++ /dev/null @@ -1,248 +0,0 @@ -From e5fe9328c890a266544a7ef0d272150519fdfc5d Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 20 Dec 2019 10:52:35 -0800 -Subject: [PATCH 7/7] libparted: Add support for bls_boot to GPT disks - -This sets the partition GUID to bc13c2ff-59e6-4262-a352-b275fd6f7172 to -indicate that the partition is a Boot Loader Specification compatible -/boot partition. ---- - doc/parted.texi | 4 ++++ - include/parted/disk.in.h | 5 +++-- - libparted/disk.c | 2 ++ - libparted/labels/gpt.c | 47 +++++++++++++++++++++++++++++++++++++++- - 4 files changed, 55 insertions(+), 3 deletions(-) - -diff --git a/doc/parted.texi b/doc/parted.texi -index f983d2c..213fc84 100644 ---- a/doc/parted.texi -+++ b/doc/parted.texi -@@ -844,6 +844,10 @@ GRUB BIOS partition. - (GPT) - this flag is used to tell special purpose software that the GPT - partition may be bootable. - -+@item bls_boot -+(MS-DOS, GPT) - Enable this to indicate that the selected partition is a -+Linux Boot Loader Specification compatible /boot partition. -+ - @item boot - (Mac, MS-DOS, PC98) - should be enabled if you want to boot off the - partition. The semantics vary between disk labels. For MS-DOS disk -diff --git a/include/parted/disk.in.h b/include/parted/disk.in.h -index b257c27..fadb995 100644 ---- a/include/parted/disk.in.h -+++ b/include/parted/disk.in.h -@@ -76,10 +76,11 @@ enum _PedPartitionFlag { - PED_PARTITION_MSFT_DATA=16, - PED_PARTITION_IRST=17, - PED_PARTITION_ESP=18, -- PED_PARTITION_CHROMEOS_KERNEL=19 -+ PED_PARTITION_CHROMEOS_KERNEL=19, -+ PED_PARTITION_BLS_BOOT=20 - }; - #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT --#define PED_PARTITION_LAST_FLAG PED_PARTITION_CHROMEOS_KERNEL -+#define PED_PARTITION_LAST_FLAG PED_PARTITION_BLS_BOOT - - enum _PedDiskTypeFeature { - PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ -diff --git a/libparted/disk.c b/libparted/disk.c -index d1f1077..099837b 100644 ---- a/libparted/disk.c -+++ b/libparted/disk.c -@@ -2409,6 +2409,8 @@ ped_partition_flag_get_name (PedPartitionFlag flag) - return N_("esp"); - case PED_PARTITION_CHROMEOS_KERNEL: - return N_("chromeos_kernel"); -+ case PED_PARTITION_BLS_BOOT: -+ return N_("bls_boot"); - - default: - ped_exception_throw ( -diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c -index b8b58cd..93f7add 100644 ---- a/libparted/labels/gpt.c -+++ b/libparted/labels/gpt.c -@@ -160,6 +160,10 @@ typedef struct - ((efi_guid_t) { PED_CPU_TO_LE32 (0xfe3a2a5d), PED_CPU_TO_LE16 (0x4f32), \ - PED_CPU_TO_LE16 (0x41a7), 0xb7, 0x25, \ - { 0xac, 0xcc, 0x32, 0x85, 0xa3, 0x09 }}) -+#define PARTITION_BLS_BOOT_GUID \ -+ ((efi_guid_t) { PED_CPU_TO_LE32 (0xbc13c2ff), PED_CPU_TO_LE16 (0x59e6), \ -+ PED_CPU_TO_LE16 (0x4262), 0xa3, 0x52, \ -+ { 0xb2, 0x75, 0xfd, 0x6f, 0x71, 0x72 }}) - - struct __attribute__ ((packed)) _GuidPartitionTableHeader_t - { -@@ -308,6 +312,7 @@ typedef struct _GPTPartitionData - int prep; - int irst; - int chromeos_kernel; -+ int bls_boot; - } GPTPartitionData; - - static PedDiskType gpt_disk_type; -@@ -832,6 +837,7 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte) - = gpt_part_data->prep - = gpt_part_data->irst - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->bios_grub = gpt_part_data->atvrecv = 0; - - if (pte->Attributes.RequiredToFunction & 0x1) -@@ -865,6 +871,8 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte) - gpt_part_data->irst = 1; - else if (!guid_cmp (gpt_part_data->type, PARTITION_CHROMEOS_KERNEL_GUID)) - gpt_part_data->chromeos_kernel = 1; -+ else if (!guid_cmp (gpt_part_data->type, PARTITION_BLS_BOOT_GUID)) -+ gpt_part_data->bls_boot = 1; - - return part; - } -@@ -1386,6 +1394,7 @@ gpt_partition_new (const PedDisk *disk, - gpt_part_data->translated_name = 0; - gpt_part_data->irst = 0; - gpt_part_data->chromeos_kernel = 0; -+ gpt_part_data->bls_boot = 0; - uuid_generate ((unsigned char *) &gpt_part_data->uuid); - swap_uuid_and_efi_guid (&gpt_part_data->uuid); - memset (gpt_part_data->name, 0, sizeof gpt_part_data->name); -@@ -1521,6 +1530,11 @@ gpt_partition_set_system (PedPartition *part, - gpt_part_data->type = PARTITION_CHROMEOS_KERNEL_GUID; - return 1; - } -+ if (gpt_part_data->bls_boot) -+ { -+ gpt_part_data->type = PARTITION_BLS_BOOT_GUID; -+ return 1; -+ } - - if (fs_type) - { -@@ -1668,6 +1682,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->prep - = gpt_part_data->irst - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_BIOS_GRUB: -@@ -1684,6 +1699,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->prep - = gpt_part_data->irst - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_RAID: -@@ -1700,6 +1716,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->prep - = gpt_part_data->irst - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_LVM: -@@ -1716,6 +1733,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->prep - = gpt_part_data->irst - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_SWAP: -@@ -1732,6 +1750,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->prep - = gpt_part_data->irst - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_HPSERVICE: -@@ -1748,6 +1767,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->prep - = gpt_part_data->irst - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_MSFT_RESERVED: -@@ -1764,6 +1784,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->prep - = gpt_part_data->irst - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_MSFT_DATA: -@@ -1780,6 +1801,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->prep - = gpt_part_data->irst - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->atvrecv = 0; - gpt_part_data->msftdata = 1; - } else { -@@ -1830,6 +1852,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->irst - = gpt_part_data->atvrecv - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->msftrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_IRST: -@@ -1846,6 +1869,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->prep - = gpt_part_data->chromeos_kernel -+ = gpt_part_data->bls_boot - = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_CHROMEOS_KERNEL: -@@ -1862,7 +1886,25 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) - = gpt_part_data->msftrecv - = gpt_part_data->atvrecv - = gpt_part_data->prep -- = gpt_part_data->irst = 0; -+ = gpt_part_data->irst -+ = gpt_part_data->bls_boot = 0; -+ return gpt_partition_set_system (part, part->fs_type); -+ case PED_PARTITION_BLS_BOOT: -+ gpt_part_data->bls_boot = state; -+ if (state) -+ gpt_part_data->boot -+ = gpt_part_data->raid -+ = gpt_part_data->lvm -+ = gpt_part_data->swap -+ = gpt_part_data->bios_grub -+ = gpt_part_data->hp_service -+ = gpt_part_data->msftres -+ = gpt_part_data->msftdata -+ = gpt_part_data->msftrecv -+ = gpt_part_data->prep -+ = gpt_part_data->irst -+ = gpt_part_data->chromeos_kernel -+ = gpt_part_data->atvrecv = 0; - return gpt_partition_set_system (part, part->fs_type); - case PED_PARTITION_HIDDEN: - gpt_part_data->hidden = state; -@@ -1914,6 +1956,8 @@ gpt_partition_get_flag (const PedPartition *part, PedPartitionFlag flag) - return gpt_part_data->prep; - case PED_PARTITION_IRST: - return gpt_part_data->irst; -+ case PED_PARTITION_BLS_BOOT: -+ return gpt_part_data->bls_boot; - case PED_PARTITION_SWAP: - return gpt_part_data->swap; - case PED_PARTITION_CHROMEOS_KERNEL: -@@ -1948,6 +1992,7 @@ gpt_partition_is_flag_available (const PedPartition *part, - case PED_PARTITION_IRST: - case PED_PARTITION_ESP: - case PED_PARTITION_CHROMEOS_KERNEL: -+ case PED_PARTITION_BLS_BOOT: - return 1; - case PED_PARTITION_ROOT: - case PED_PARTITION_LBA: --- -2.24.1 - diff --git a/0008-Removed-reference-to-ped_file_system_create.patch b/0008-Removed-reference-to-ped_file_system_create.patch deleted file mode 100644 index 5307d5a..0000000 --- a/0008-Removed-reference-to-ped_file_system_create.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8c50fec522f475c51e2aaa3c972ce4c6690dda92 Mon Sep 17 00:00:00 2001 -From: Max Campbell -Date: Thu, 12 Dec 2019 16:54:29 +0100 -Subject: [PATCH 08/12] Removed reference to ped_file_system_create - -Removed a reference to the removed function ped_file_system_create in -the docs for ped_file_system_clobber. - -Signed-off-by: Brian C. Lane ---- - libparted/fs/r/filesys.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/libparted/fs/r/filesys.c b/libparted/fs/r/filesys.c -index d57447c..dd316aa 100644 ---- a/libparted/fs/r/filesys.c -+++ b/libparted/fs/r/filesys.c -@@ -213,8 +213,6 @@ error_close_dev: - * file system occupies a given region described by \p geom. - * After this operation ped_file_system_probe() won't detect any file system. - * -- * \note ped_file_system_create() calls this before creating a new file system. -- * - * \return \c 1 on success, \c 0 on failure - */ - static int --- -2.26.2 - diff --git a/0009-Add-support-for-the-F2FS-filesystem.patch b/0009-Add-support-for-the-F2FS-filesystem.patch deleted file mode 100644 index c0578fd..0000000 --- a/0009-Add-support-for-the-F2FS-filesystem.patch +++ /dev/null @@ -1,201 +0,0 @@ -From c6b61814cd4cf958e12d35a36184ff7d767e57d9 Mon Sep 17 00:00:00 2001 -From: Romain Perier -Date: Fri, 20 Mar 2020 17:43:16 +0100 -Subject: [PATCH 09/12] Add support for the F2FS filesystem - -This adds a basic support for the Flash-Friendly File System. So -we can manipulate the file system by using the PedFileSystem API and we -can do basic device probing for autodetecting the current fs. - -Signed-off-by: Romain Perier -Signed-off-by: Brian C. Lane ---- - libparted/fs/Makefile.am | 2 ++ - libparted/fs/f2fs/f2fs.c | 60 ++++++++++++++++++++++++++++++++++++++++ - libparted/fs/f2fs/f2fs.h | 57 ++++++++++++++++++++++++++++++++++++++ - libparted/libparted.c | 4 +++ - 4 files changed, 123 insertions(+) - create mode 100644 libparted/fs/f2fs/f2fs.c - create mode 100644 libparted/fs/f2fs/f2fs.h - -diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am -index 74f275a..e40eee8 100644 ---- a/libparted/fs/Makefile.am -+++ b/libparted/fs/Makefile.am -@@ -32,6 +32,8 @@ libfs_la_SOURCES = \ - fat/count.h \ - fat/fat.c \ - fat/fat.h \ -+ f2fs/f2fs.c \ -+ f2fs/f2fs.h \ - hfs/hfs.c \ - hfs/hfs.h \ - hfs/probe.c \ -diff --git a/libparted/fs/f2fs/f2fs.c b/libparted/fs/f2fs/f2fs.c -new file mode 100644 -index 0000000..64883e9 ---- /dev/null -+++ b/libparted/fs/f2fs/f2fs.c -@@ -0,0 +1,60 @@ -+/* -+ libparted/fs/f2fs - Flash-Friendly File System -+ Copyright (C) 2020 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 . -+*/ -+ -+#include -+ -+#include -+#include -+ -+#include "f2fs.h" -+ -+static PedGeometry* -+f2fs_probe (PedGeometry* geom) -+{ -+ struct f2fs_super_block *sb = alloca(geom->dev->sector_size); -+ -+ if (!ped_geometry_read (geom, sb, F2FS_SB_OFFSET, 1)) -+ return NULL; -+ -+ if (PED_LE32_TO_CPU(sb->magic) == F2FS_MAGIC) -+ return ped_geometry_new (geom->dev, geom->start, geom->length); -+ -+ return NULL; -+} -+ -+static PedFileSystemOps f2fs_ops = { -+ probe: f2fs_probe, -+}; -+ -+static PedFileSystemType f2fs_type = { -+ next: NULL, -+ ops: &f2fs_ops, -+ name: "f2fs", -+}; -+ -+void -+ped_file_system_f2fs_init () -+{ -+ ped_file_system_type_register (&f2fs_type); -+} -+ -+void -+ped_file_system_f2fs_done () -+{ -+ ped_file_system_type_unregister (&f2fs_type); -+} -diff --git a/libparted/fs/f2fs/f2fs.h b/libparted/fs/f2fs/f2fs.h -new file mode 100644 -index 0000000..c96b88f ---- /dev/null -+++ b/libparted/fs/f2fs/f2fs.h -@@ -0,0 +1,57 @@ -+/* -+ libparted/fs/f2fs - Flash-Friendly File System -+ Copyright (C) 2020 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 . -+*/ -+#ifndef _F2FS_H -+#define _F2FS_H -+ -+#define F2FS_MAGIC 0xF2F52010 -+#define F2FS_MAX_VOLUME_NAME 512 -+#define F2FS_SB_OFFSET 0x02 -+ -+struct f2fs_super_block { -+ uint32_t magic; /* Magic Number */ -+ uint16_t major_ver; /* Major Version */ -+ uint16_t minor_ver; /* Minor Version */ -+ uint32_t log_sectorsize; /* log2 sector size in bytes */ -+ uint32_t log_sectors_per_block; /* log2 # of sectors per block */ -+ uint32_t log_blocksize; /* log2 block size in bytes */ -+ uint32_t log_blocks_per_seg; /* log2 # of blocks per segment */ -+ uint32_t segs_per_sec; /* # of segments per section */ -+ uint32_t secs_per_zone; /* # of sections per zone */ -+ uint32_t checksum_offset; /* checksum offset inside super block */ -+ uint64_t block_count; /* total # of user blocks */ -+ uint32_t section_count; /* total # of sections */ -+ uint32_t segment_count; /* total # of segments */ -+ uint32_t segment_count_ckpt; /* # of segments for checkpoint */ -+ uint32_t segment_count_sit; /* # of segments for SIT */ -+ uint32_t segment_count_nat; /* # of segments for NAT */ -+ uint32_t segment_count_ssa; /* # of segments for SSA */ -+ uint32_t segment_count_main; /* # of segments for main area */ -+ uint32_t segment0_blkaddr; /* start block address of segment 0 */ -+ uint32_t cp_blkaddr; /* start block address of checkpoint */ -+ uint32_t sit_blkaddr; /* start block address of SIT */ -+ uint32_t nat_blkaddr; /* start block address of NAT */ -+ uint32_t ssa_blkaddr; /* start block address of SSA */ -+ uint32_t main_blkaddr; /* start block address of main area */ -+ uint32_t root_ino; /* root inode number */ -+ uint32_t node_ino; /* node inode number */ -+ uint32_t meta_ino; /* meta inode number */ -+ uint8_t uuid[16]; /* 128-bit uuid for volume */ -+ uint16_t volume_name[F2FS_MAX_VOLUME_NAME]; /* volume name */ -+} __attribute__((packed)); -+ -+#endif -diff --git a/libparted/libparted.c b/libparted/libparted.c -index 00f5ff8..4a57a80 100644 ---- a/libparted/libparted.c -+++ b/libparted/libparted.c -@@ -109,6 +109,7 @@ extern void ped_file_system_linux_swap_init (void); - extern void ped_file_system_jfs_init (void); - extern void ped_file_system_hfs_init (void); - extern void ped_file_system_fat_init (void); -+extern void ped_file_system_f2fs_init (void); - extern void ped_file_system_ext2_init (void); - extern void ped_file_system_nilfs2_init (void); - extern void ped_file_system_btrfs_init (void); -@@ -126,6 +127,7 @@ init_file_system_types () - ped_file_system_jfs_init (); - ped_file_system_hfs_init (); - ped_file_system_fat_init (); -+ ped_file_system_f2fs_init (); - ped_file_system_ext2_init (); - ped_file_system_nilfs2_init (); - ped_file_system_btrfs_init (); -@@ -186,6 +188,7 @@ _init() - extern void ped_file_system_nilfs2_done (void); - extern void ped_file_system_ext2_done (void); - extern void ped_file_system_fat_done (void); -+extern void ped_file_system_f2fs_done (void); - extern void ped_file_system_hfs_done (void); - extern void ped_file_system_jfs_done (void); - extern void ped_file_system_linux_swap_done (void); -@@ -202,6 +205,7 @@ done_file_system_types () - { - ped_file_system_nilfs2_done (); - ped_file_system_ext2_done (); -+ ped_file_system_f2fs_done (); - ped_file_system_fat_done (); - ped_file_system_hfs_done (); - ped_file_system_jfs_done (); --- -2.26.2 - diff --git a/0010-tests-Add-f2fs-to-the-fs-probe-test.patch b/0010-tests-Add-f2fs-to-the-fs-probe-test.patch deleted file mode 100644 index cf376ad..0000000 --- a/0010-tests-Add-f2fs-to-the-fs-probe-test.patch +++ /dev/null @@ -1,27 +0,0 @@ -From eaada0bc9e1cc8adb3a0260707d9474a3e01b835 Mon Sep 17 00:00:00 2001 -From: Romain Perier -Date: Fri, 20 Mar 2020 17:43:17 +0100 -Subject: [PATCH 10/12] tests: Add f2fs to the fs probe test - -Signed-off-by: Romain Perier -Signed-off-by: Brian C. Lane ---- - 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 1fe3309..9150a37 100755 ---- a/tests/t1700-probe-fs.sh -+++ b/tests/t1700-probe-fs.sh -@@ -23,7 +23,7 @@ dev=loop-file - ss=$sector_size_ - n_sectors=$((512*1024)) - --for type in ext2 ext3 ext4 btrfs xfs nilfs2 ntfs vfat hfsplus udf; do -+for type in ext2 ext3 ext4 btrfs xfs nilfs2 ntfs vfat hfsplus udf f2fs; do - - ( mkfs.$type 2>&1 | grep -i '^usage' ) > /dev/null \ - || { warn_ "$ME: no $type support"; continue; } --- -2.26.2 - diff --git a/0011-parted-Preserve-resizepart-End-when-prompted-for-bus.patch b/0011-parted-Preserve-resizepart-End-when-prompted-for-bus.patch deleted file mode 100644 index 292cc69..0000000 --- a/0011-parted-Preserve-resizepart-End-when-prompted-for-bus.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 691dabc930a6d544dfd8da787cddd159bab34b1e Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Mon, 31 Aug 2020 16:40:07 -0700 -Subject: [PATCH 11/12] parted: Preserve resizepart End when prompted for busy - partition - -Resizing busy partitions is allowed, but the user is prompted, which -erases the cmdline. It is annoying to have to re-end the ending location -after answering Yes. This saves the word and pushes it back onto the -cmdline after the user agrees to resize the busy partition. ---- - parted/parted.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/parted/parted.c b/parted/parted.c -index df0c7ed..dbd38d0 100644 ---- a/parted/parted.c -+++ b/parted/parted.c -@@ -1546,6 +1546,7 @@ do_resizepart (PedDevice** dev, PedDisk** diskp) - PedConstraint* constraint; - int rc = 0; - char* end_input = NULL; -+ char* end_size = NULL; - - if (!disk) { - disk = ped_disk_new (*dev); -@@ -1561,9 +1562,23 @@ do_resizepart (PedDevice** dev, PedDisk** diskp) - - if (!command_line_get_partition (_("Partition number?"), disk, &part)) - goto error; -+ -+ /* Save the optional End value if the partition is busy. */ -+ if (ped_partition_is_busy(part)) { -+ if (command_line_get_word_count()) -+ end_size = command_line_pop_word(); -+ } -+ -+ /* If the partition is busy this may clear the command_line and prompt the user */ - if (!_partition_warn_busy (part)) - goto error; - -+ /* Push the End value back onto the command_line, if it exists */ -+ if (end_size) { -+ command_line_push_word(end_size); -+ free(end_size); -+ } -+ - start = part->geom.start; - end = oldend = part->geom.end; - if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, &end_input)) --- -2.26.2 - diff --git a/0012-tests-Add-a-test-for-resizepart-on-a-busy-partition.patch b/0012-tests-Add-a-test-for-resizepart-on-a-busy-partition.patch deleted file mode 100644 index 327d872..0000000 --- a/0012-tests-Add-a-test-for-resizepart-on-a-busy-partition.patch +++ /dev/null @@ -1,85 +0,0 @@ -From dfc611bd5126840d68493ad0e761511a71325af7 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 1 Sep 2020 14:51:54 -0700 -Subject: [PATCH 12/12] tests: Add a test for resizepart on a busy partition - -This makes sure that the resizepart on a busy partition with the size on -the cmdline will work. ---- - tests/t3200-resize-partition.sh | 44 ++++++++++++++++++++++++++++++--- - 1 file changed, 40 insertions(+), 4 deletions(-) - -diff --git a/tests/t3200-resize-partition.sh b/tests/t3200-resize-partition.sh -index 06dbe68..2200977 100755 ---- a/tests/t3200-resize-partition.sh -+++ b/tests/t3200-resize-partition.sh -@@ -2,7 +2,7 @@ - # exercise the resize sub-command - # based on t3000-resize-fs.sh test - --# Copyright (C) 2009-2011, 2019 Free Software Foundation, Inc. -+# Copyright (C) 2009-2020 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 -@@ -66,8 +66,8 @@ sleep 1 - # Running it without end should not core-dump or prompt - parted -s $dev resizepart 1 > out 2> err || fail=1 - --# extend the filesystem to end on sector 4096 --new_end=4096s -+# extend the filesystem to end on sector 2048 -+new_end=2048s - parted -s $dev resizepart 1 $new_end > out 2> err || fail=1 - # expect no output - compare /dev/null out || fail=1 -@@ -77,9 +77,45 @@ compare /dev/null err || 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:::$ms;\n" > exp || fail=1 -+printf "1:$default_start:$new_end:1025s:::$ms;\n" > exp || fail=1 - compare exp out || fail=1 - -+## Make sure resizing a busy partition works when user answers 'yes' -+# Format the partition and mount it for the busy check -+mkfs.ext4 "${dev}1" || skip_ mkfs.ext4 failed -+ -+# be sure to unmount upon interrupt, failure, etc. -+cleanup_fn_() { umount "${dev}1" > /dev/null 2>&1; } -+ -+mount_point=$(pwd)/mnt -+ -+mkdir $mount_point || fail=1 -+mount "${dev}1" "$mount_point" || fail=1 -+ -+# extend the filesystem to end on sector 4096 -+new_end=4096s -+echo yes | parted ---pretend-input-tty $dev resizepart 1 $new_end > out 2>&1 -+cat > exp < out -+compare exp out || fail=1 -+ -+# print partition table -+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 -+compare exp out || fail=1 -+ -+umount "${dev}1" || fail=1 -+ - # Remove the partition explicitly, so that mklabel doesn't evoke a warning. - parted -s $dev rm 1 || fail=1 - --- -2.26.2 - diff --git a/0013-Do-not-link-to-libsepol-or-libselinux.patch b/0013-Do-not-link-to-libsepol-or-libselinux.patch deleted file mode 100644 index 196732b..0000000 --- a/0013-Do-not-link-to-libsepol-or-libselinux.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 2a2e05f09be4dd350bc91747f03378e7c534265d Mon Sep 17 00:00:00 2001 -From: Petr Lautrbach -Date: Tue, 3 Nov 2020 15:06:34 +0100 -Subject: [PATCH] Do not link to libsepol or libselinux - -Given that there's no code which would use it there's no reason to link -to libsepol or libselinux even when they are available. - -Signed-off-by: Brian C. Lane ---- - AUTHORS | 8 ++++---- - configure.ac | 12 ------------ - libparted/Makefile.am | 1 - - parted.spec.in | 15 ++------------- - 4 files changed, 6 insertions(+), 30 deletions(-) - -diff --git a/AUTHORS b/AUTHORS -index 530a28b..8119934 100644 ---- a/AUTHORS -+++ b/AUTHORS -@@ -72,7 +72,7 @@ Matthew Wilson - * Don't detect AIX physical volumes as msdos partition tables - * Code for manipulating AIX PVs - --Martin von Löwis -+Martin von Löwis - * German translations - - Baty Jean-Marc -@@ -113,7 +113,7 @@ Ben Collins - * Sun disk label support (libparted/disk_sun.c) - * stubs for UFS - --Vincent Stelhé -+Vincent Stelhé - * move syntax patch (make END specification optional). Trivial - for copyright purposes (no disclaimer needed) - -@@ -132,7 +132,7 @@ Matt Domsch - Kjetil Torgrim Homme - * Norweigen translations - --Jörgen Tegnér -+Jörgen Tegnér - * Swedish translations - - Keld Simonsen -@@ -153,7 +153,7 @@ Vicente E. Llorens - Yury Umanets - * basis of libparted/fs_reiserfs - --Bernardo João Torres da Silveira -+Bernardo João Torres da Silveira - - * pt_BR translation of FAQ and parted.texi - -diff --git a/configure.ac b/configure.ac -index c46a3ff..ef78600 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -89,11 +89,6 @@ if test $ENABLE_DEVICE_MAPPER = yes; then - 1, [device mapper (libdevmapper) support]) - fi - --AC_ARG_ENABLE([selinux], -- [ --enable-selinux enable SELinux support [default=no]], , -- enable_selinux=no --) -- - AC_ARG_ENABLE([discover-only], - [ --enable-discover-only support only reading/probing [default=no]], , - enable_discover_only=no -@@ -320,13 +315,6 @@ package as well (it may be called device-mapper-devel or something similar).] - fi - AC_SUBST([DM_LIBS]) - --dnl Check for SELinux --SELINUX_LIBS="" --if test "$enable_selinux" = yes; then -- SELINUX_LIBS="-lselinux -lsepol" --fi --AC_SUBST([SELINUX_LIBS]) -- - dnl Check for termcap - if test "$with_readline" = yes; then - OLD_LIBS="$LIBS" -diff --git a/libparted/Makefile.am b/libparted/Makefile.am -index bcdde77..e52aa2a 100644 ---- a/libparted/Makefile.am -+++ b/libparted/Makefile.am -@@ -55,7 +55,6 @@ libparted_la_LIBADD = \ - $(top_builddir)/lib/libgnulib.la \ - $(OS_LIBS) \ - $(DM_LIBS) \ -- $(SELINUX_LIBS) \ - $(LIB_BLKID) \ - $(UUID_LIBS) \ - $(INTLLIBS) -diff --git a/parted.spec.in b/parted.spec.in -index bdbe218..d0e2b11 100644 ---- a/parted.spec.in -+++ b/parted.spec.in -@@ -1,15 +1,9 @@ --# Default to disabling device-mapper and SELinux -+# Default to disabling device-mapper - %define use_devmapper 0 --%define use_selinux 0 --%define use_sepol 0 - - # Enable device-mapper support if we find devmapper - %define use_devmapper %(pkg-config --libs devmapper >/dev/null 2>&1; [ $? -eq 0 ] && echo 1) - --# Enable SELinux if we find libselinux and libsepol --%define use_selinux %([ -r %{_libdir}/libselinux.a ] && echo 1) --%define use_sepol %([ -r %{_libdir}/libsepol.so ] && echo 1) -- - Summary: The GNU disk partition manipulation program - Name: @PACKAGE@ - Version: @VERSION@ -@@ -22,7 +16,7 @@ Group: Applications/System - BuildRequires: e2fsprogs-devel readline-devel ncurses-devel gperf - BuildRequires: automake libtool gettext-devel texinfo pkgconfig - --BuildRequires: device-mapper-devel, libselinux-devel libsepol-devel -+BuildRequires: device-mapper-devel - - Prereq: /sbin/install-info - -@@ -52,11 +46,6 @@ Parted library, you need to install this package. - --enable-device-mapper \ - %else - --disable-devmapper \ --%endif --%if "%{use_selinux}" == "1" && "%{use_sepol}" == "1" -- --enable-selinux \ --%else -- --disable-selinux \ - %endif - --enable-part-static \ - --enable-pc98=no \ --- -2.26.2 - diff --git a/0014-t6001-psep-modify-device-manage-support-detection.patch b/0014-t6001-psep-modify-device-manage-support-detection.patch deleted file mode 100644 index cbadbae..0000000 --- a/0014-t6001-psep-modify-device-manage-support-detection.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0eef2b04caad4a7b251ecf5e1c58ad33582da6e5 Mon Sep 17 00:00:00 2001 -From: Joe Slater -Date: Thu, 20 Jun 2019 14:33:04 -0700 -Subject: [PATCH 14/42] t6001-psep: modify device manage support detection - -Use the method other tests use -- test an environment variable. - -Signed-off-by: Joe Slater -Signed-off-by: Brian C. Lane ---- - tests/t6001-psep.sh | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tests/t6001-psep.sh b/tests/t6001-psep.sh -index e350bd2..73f2d1c 100644 ---- a/tests/t6001-psep.sh -+++ b/tests/t6001-psep.sh -@@ -21,7 +21,8 @@ - require_root_ - require_udevadm_settle_ - --(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed" -+test "x$ENABLE_DEVICE_MAPPER" = xyes \ -+ || skip_ "no device-mapper support" - - # Device maps names - should be random to not conflict with existing ones on - # the system --- -2.26.2 - diff --git a/0015-tests-Update-all-the-dmsetup-tests-to-use-ENABLE_DEV.patch b/0015-tests-Update-all-the-dmsetup-tests-to-use-ENABLE_DEV.patch deleted file mode 100644 index 539b29d..0000000 --- a/0015-tests-Update-all-the-dmsetup-tests-to-use-ENABLE_DEV.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 04ca93351a4e25c35562ef705b3d96c3743609ff Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 25 Jun 2019 09:37:32 -0700 -Subject: [PATCH 15/42] tests: Update all the dmsetup tests to use - ENABLE_DEVICE_MAPPER - ---- - tests/t6004-dm-many-partitions.sh | 4 +++- - tests/t6005-dm-uuid.sh | 4 +++- - tests/t6006-dm-512b-sectors.sh | 3 ++- - 3 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/tests/t6004-dm-many-partitions.sh b/tests/t6004-dm-many-partitions.sh -index b4be975..636c837 100755 ---- a/tests/t6004-dm-many-partitions.sh -+++ b/tests/t6004-dm-many-partitions.sh -@@ -21,7 +21,9 @@ - - require_root_ - require_udevadm_settle_ --(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed" -+ -+test "x$ENABLE_DEVICE_MAPPER" = xyes \ -+ || skip_ "no device-mapper support" - - ss=$sector_size_ - ns=300 -diff --git a/tests/t6005-dm-uuid.sh b/tests/t6005-dm-uuid.sh -index 4266747..790c23f 100755 ---- a/tests/t6005-dm-uuid.sh -+++ b/tests/t6005-dm-uuid.sh -@@ -21,7 +21,9 @@ - - require_root_ - require_udevadm_settle_ --(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed" -+ -+test "x$ENABLE_DEVICE_MAPPER" = xyes \ -+ || skip_ "no device-mapper support" - - ss=$sector_size_ - ns=300 -diff --git a/tests/t6006-dm-512b-sectors.sh b/tests/t6006-dm-512b-sectors.sh -index bf32135..c0de382 100644 ---- a/tests/t6006-dm-512b-sectors.sh -+++ b/tests/t6006-dm-512b-sectors.sh -@@ -25,7 +25,8 @@ 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" -+test "x$ENABLE_DEVICE_MAPPER" = xyes \ -+ || skip_ "no device-mapper support" - - # Device maps names - should be random to not conflict with existing ones on - # the system --- -2.26.2 - diff --git a/0016-libparted-Fix-a-GCC-warning-Wunused-but-set-variable.patch b/0016-libparted-Fix-a-GCC-warning-Wunused-but-set-variable.patch deleted file mode 100644 index 6edef57..0000000 --- a/0016-libparted-Fix-a-GCC-warning-Wunused-but-set-variable.patch +++ /dev/null @@ -1,51 +0,0 @@ -From f75af2cfbbd1a2d82ed3df4955014f73737ae13e Mon Sep 17 00:00:00 2001 -From: Shin'ichiro Kawasaki -Date: Wed, 14 Aug 2019 10:59:18 +0900 -Subject: [PATCH 16/42] libparted: Fix a GCC warning -Wunused-but-set-variable - -GCC warns that a variable 'prealloc' defined for _generic_affs_probe() in -fs/amiga/affs.c is set but its value is never used. - - CC amiga/affs.lo -amiga/affs.c: In function '_generic_affs_probe': -amiga/affs.c:54:35: warning: variable 'prealloc' set but not used [-Wunused-but-set-variable] - 54 | int blocksize = 1, reserved = 2, prealloc = 0; - | ^~~~~~~~ -Remove the variable for simplicity and to avoid the warning. - -Signed-off-by: Shin'ichiro Kawasaki -Signed-off-by: Brian C. Lane ---- - libparted/fs/amiga/affs.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/libparted/fs/amiga/affs.c b/libparted/fs/amiga/affs.c -index 1fde17c..e7c2e47 100644 ---- a/libparted/fs/amiga/affs.c -+++ b/libparted/fs/amiga/affs.c -@@ -52,20 +52,19 @@ _generic_affs_probe (PedGeometry* geom, uint32_t kind) - uint32_t *block; - PedSector root, len, pos; - struct PartitionBlock * part; -- int blocksize = 1, reserved = 2, prealloc = 0; -+ int blocksize = 1, reserved = 2; - - PED_ASSERT (geom != NULL); - PED_ASSERT (geom->dev != NULL); - if (geom->dev->sector_size != 512) - return NULL; -- /* Finds the blocksize, prealloc and reserved values of the partition block */ -+ /* Finds the blocksize and reserved values of the partition block */ - if (!(part = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) { - ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, - _("%s : Failed to allocate partition block\n"), __func__); - goto error_part; - } - if (amiga_find_part(geom, part) != NULL) { -- prealloc = PED_BE32_TO_CPU (part->de_PreAlloc); - reserved = PED_BE32_TO_CPU (part->de_Reserved); - reserved = reserved == 0 ? 1 : reserved; - blocksize = PED_BE32_TO_CPU (part->de_SizeBlock) --- -2.26.2 - diff --git a/0017-libparted-Fix-warnings-from-GCC-8-Wunused-variable-a.patch b/0017-libparted-Fix-warnings-from-GCC-8-Wunused-variable-a.patch deleted file mode 100644 index 51278e6..0000000 --- a/0017-libparted-Fix-warnings-from-GCC-8-Wunused-variable-a.patch +++ /dev/null @@ -1,67 +0,0 @@ -From d51921b05c32287238b1b0447d7e952884f63eb5 Mon Sep 17 00:00:00 2001 -From: Shin'ichiro Kawasaki -Date: Wed, 14 Aug 2019 10:59:19 +0900 -Subject: [PATCH 17/42] libparted: Fix warnings from GCC 8 -Wunused-variable - and -Warray-bounds - -GCC 8 reports two warnings as follows. - -r/fat/bootsector.c: In function 'fat_boot_sector_set_boot_code': -r/fat/bootsector.c:274:15: warning: unused variable 'fs_info' [-Wunused-variable] - FatSpecific* fs_info = FAT_SPECIFIC (fs); - ^~~~~~~ -In function 'memcpy', - inlined from 'fat_boot_sector_set_boot_code' at r/fat/bootsector.c:283:2: -/usr/include/bits/string_fortified.h:34:10: warning: '__builtin_memcpy' forming offset [126, 128] is out of the bounds [0, 125] [-Warray-bounds] - return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest)); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To avoid the warnings, remove the unused variable. Use strcpy in place of -memcpy checking copy length. - -Signed-off-by: Shin'ichiro Kawasaki -Signed-off-by: Brian C. Lane ---- - libparted/fs/r/fat/bootsector.c | 5 ++--- - libparted/fs/r/fat/bootsector.h | 2 -- - 2 files changed, 2 insertions(+), 5 deletions(-) - -diff --git a/libparted/fs/r/fat/bootsector.c b/libparted/fs/r/fat/bootsector.c -index 46d5926..9130900 100644 ---- a/libparted/fs/r/fat/bootsector.c -+++ b/libparted/fs/r/fat/bootsector.c -@@ -271,8 +271,6 @@ fat_boot_sector_analyse (FatBootSector* bs, PedFileSystem* fs) - int - fat_boot_sector_set_boot_code (FatBootSector** bsp, const PedFileSystem* fs) - { -- FatSpecific* fs_info = FAT_SPECIFIC (fs); -- - PED_ASSERT (bsp != NULL); - *bsp = ped_malloc (fs->geom->dev->sector_size); - FatBootSector *bs = *bsp; -@@ -280,7 +278,8 @@ fat_boot_sector_set_boot_code (FatBootSector** bsp, const PedFileSystem* fs) - - memset (bs, 0, 512); - memcpy (bs->boot_jump, FAT_BOOT_JUMP, 3); -- memcpy (bs->u.fat32.boot_code, FAT_BOOT_CODE, FAT_BOOT_CODE_LENGTH); -+ PED_ASSERT (sizeof(FAT_BOOT_CODE) < sizeof(bs->u.fat32.boot_code)); -+ strcpy (bs->u.fat32.boot_code, FAT_BOOT_CODE); - return 1; - } - -diff --git a/libparted/fs/r/fat/bootsector.h b/libparted/fs/r/fat/bootsector.h -index 6b0363f..42fc3f2 100644 ---- a/libparted/fs/r/fat/bootsector.h -+++ b/libparted/fs/r/fat/bootsector.h -@@ -57,8 +57,6 @@ typedef struct _FatInfoSector FatInfoSector; - /* message: */ \ - FAT_BOOT_MESSAGE - --#define FAT_BOOT_CODE_LENGTH 128 -- - struct __attribute__ ((packed)) _FatBootSector { - uint8_t boot_jump[3]; /* 00: Boot strap short or near jump */ - uint8_t system_id[8]; /* 03: system name */ --- -2.26.2 - diff --git a/0018-libparted-Fix-warnings-from-GCC-s-Wimplicit-fallthro.patch b/0018-libparted-Fix-warnings-from-GCC-s-Wimplicit-fallthro.patch deleted file mode 100644 index 739cbb1..0000000 --- a/0018-libparted-Fix-warnings-from-GCC-s-Wimplicit-fallthro.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 5449d1b1ee763e8ae1057fb7d18f7fbccb7a6fe0 Mon Sep 17 00:00:00 2001 -From: Shin'ichiro Kawasaki -Date: Wed, 14 Aug 2019 10:59:17 +0900 -Subject: [PATCH 18/42] libparted: Fix warnings from GCC's - -Wimplicit-fallthrough - -Two case statements have intentional fall-throughs but do not have -comments to note it. GCC detects and warns those case statements. To -avoid the warning, add fall-through comments. - -Signed-off-by: Shin'ichiro Kawasaki -Signed-off-by: Brian C. Lane ---- - libparted/fs/amiga/amiga.c | 1 + - libparted/fs/r/hfs/reloc.c | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/libparted/fs/amiga/amiga.c b/libparted/fs/amiga/amiga.c -index be10dae..eb63f24 100644 ---- a/libparted/fs/amiga/amiga.c -+++ b/libparted/fs/amiga/amiga.c -@@ -217,6 +217,7 @@ _amiga_read_block (PedDevice *dev, struct AmigaBlock *blk, PedSector block, stru - return NULL; - } - } -+ /* FALLTHROUGH */ - case PED_EXCEPTION_IGNORE : - case PED_EXCEPTION_UNHANDLED : - default : -diff --git a/libparted/fs/r/hfs/reloc.c b/libparted/fs/r/hfs/reloc.c -index 0b8ddc1..d0477ae 100644 ---- a/libparted/fs/r/hfs/reloc.c -+++ b/libparted/fs/r/hfs/reloc.c -@@ -224,6 +224,7 @@ hfs_do_move (PedFileSystem* fs, unsigned int *ptr_src, - priv_data->catalog_file - ->cache[ref->ref_index].start_block = - PED_CPU_TO_BE16(new_start); -+ /* FALLTHROUGH */ - case CR_BTREE_EXT_0 : - file = priv_data->extent_file; - goto CR_BTREE; --- -2.26.2 - diff --git a/0019-libparted-Avoid-a-GCC-warning-for-unused-functions.patch b/0019-libparted-Avoid-a-GCC-warning-for-unused-functions.patch deleted file mode 100644 index 3e0af16..0000000 --- a/0019-libparted-Avoid-a-GCC-warning-for-unused-functions.patch +++ /dev/null @@ -1,61 +0,0 @@ -From bed9c6a17ee82c87bf47981149e224f2e34baedb Mon Sep 17 00:00:00 2001 -From: Shin'ichiro Kawasaki -Date: Wed, 14 Aug 2019 10:59:23 +0900 -Subject: [PATCH 19/42] libparted: Avoid a GCC warning for unused functions - -libparted/fs/r/hfs/hfs.c has a '#if 0' block. The block refers two -functions hfsplus_clobber() and hfs_clobber(). It have GCC report a -warning below. - - CC r/hfs/hfs.lo -r/hfs/hfs.c:343:1: warning: 'hfsplus_clobber' defined but not used [-Wunused-function] - 343 | hfsplus_clobber (PedGeometry* geom) - | ^~~~~~~~~~~~~~~ - -To avoid the warning, add two more '#if 0' to disable the two functions. - -Signed-off-by: Shin'ichiro Kawasaki -Signed-off-by: Brian C. Lane ---- - libparted/fs/r/hfs/hfs.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c -index 6be0390..0aababd 100644 ---- a/libparted/fs/r/hfs/hfs.c -+++ b/libparted/fs/r/hfs/hfs.c -@@ -59,6 +59,7 @@ static PedFileSystemType hfsplus_type; - - /* ----- HFS ----- */ - -+#if 0 - /* This is a very unundoable operation */ - /* Maybe I shouldn't touch the alternate MDB ? */ - /* Anyway clobber is call before other fs creation */ -@@ -78,6 +79,7 @@ hfs_clobber (PedGeometry* geom) - (!!ped_geometry_write (geom, buf, geom->length - 1, 1)) & - (!!ped_geometry_sync (geom)); - } -+#endif - - PedFileSystem * - hfs_open (PedGeometry* geom) -@@ -339,6 +341,7 @@ hfs_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer) - #include "reloc_plus.h" - #include "journal.h" - -+#if 0 - static int - hfsplus_clobber (PedGeometry* geom) - { -@@ -374,6 +377,7 @@ hfsplus_clobber (PedGeometry* geom) - /* non-embedded or envelop destroy as hfs */ - return ( hfs_clobber (geom) && i ); - } -+#endif - - int - hfsplus_close (PedFileSystem *fs) --- -2.26.2 - diff --git a/0020-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch b/0020-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch deleted file mode 100644 index 60c7900..0000000 --- a/0020-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch +++ /dev/null @@ -1,248 +0,0 @@ -From 20c136159b37f11822b591941c077bb2be6ede05 Mon Sep 17 00:00:00 2001 -From: Shin'ichiro Kawasaki -Date: Wed, 14 Aug 2019 10:59:21 +0900 -Subject: [PATCH 20/42] libparted: Fix warnings from GCC 8 - -Wsuggest-attribute=pure - -As GCC 8 suggests, add 'pure' attribute to 17 functions. After adding -pure attributes, GCC suggested three more functions to add pure -attributes. Add pure attribute to those functions also. In total, add -pure attributes to 20 functions. - -I read code of the functions and confirmed the 20 functions are pure: -they have no effect except the return value, and their return value -depend only on the parameters and/or global variables. - -Signed-off-by: Shin'ichiro Kawasaki -Signed-off-by: Brian C. Lane ---- - libparted/fs/fat/bootsector.c | 2 +- - libparted/fs/r/fat/bootsector.c | 2 +- - libparted/fs/r/fat/calc.c | 4 ++-- - libparted/fs/r/fat/context.c | 4 ++-- - libparted/fs/r/fat/count.c | 4 ++-- - libparted/fs/r/fat/table.c | 2 +- - libparted/fs/r/fat/traverse.c | 14 +++++++------- - libparted/fs/r/hfs/advfs.c | 4 ++-- - libparted/fs/r/hfs/advfs_plus.c | 4 ++-- - 9 files changed, 20 insertions(+), 20 deletions(-) - -diff --git a/libparted/fs/fat/bootsector.c b/libparted/fs/fat/bootsector.c -index 0c3ae77..2a03696 100644 ---- a/libparted/fs/fat/bootsector.c -+++ b/libparted/fs/fat/bootsector.c -@@ -86,7 +86,7 @@ fat_boot_sector_read (FatBootSector** bsp, const PedGeometry *geom) - /* - Don't trust the FAT12, FAT16 or FAT32 label string. - */ --FatType -+FatType _GL_ATTRIBUTE_PURE - fat_boot_sector_probe_type (const FatBootSector* bs, const PedGeometry* geom) - { - PedSector logical_sector_size; -diff --git a/libparted/fs/r/fat/bootsector.c b/libparted/fs/r/fat/bootsector.c -index 9130900..34134cc 100644 ---- a/libparted/fs/r/fat/bootsector.c -+++ b/libparted/fs/r/fat/bootsector.c -@@ -85,7 +85,7 @@ fat_boot_sector_read (FatBootSector** bsp, const PedGeometry *geom) - /* - Don't trust the FAT12, FAT16 or FAT32 label string. - */ --FatType -+FatType _GL_ATTRIBUTE_PURE - fat_boot_sector_probe_type (const FatBootSector* bs, const PedGeometry* geom) - { - PedSector logical_sector_size; -diff --git a/libparted/fs/r/fat/calc.c b/libparted/fs/r/fat/calc.c -index e524007..60c6bac 100644 ---- a/libparted/fs/r/fat/calc.c -+++ b/libparted/fs/r/fat/calc.c -@@ -314,7 +314,7 @@ fat_calc_resize_sizes ( - friends, to allow room for this space. If too much of this space is left - over, everyone will complain, so we have to be greedy, and use it all up... - */ --PedSector -+PedSector _GL_ATTRIBUTE_PURE - fat_calc_align_sectors (const PedFileSystem* new_fs, - const PedFileSystem* old_fs) - { -@@ -359,7 +359,7 @@ fat_calc_align_sectors (const PedFileSystem* new_fs, - return align; - } - --int -+int _GL_ATTRIBUTE_PURE - fat_is_sector_in_clusters (const PedFileSystem* fs, PedSector sector) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -diff --git a/libparted/fs/r/fat/context.c b/libparted/fs/r/fat/context.c -index 5c27d09..170094c 100644 ---- a/libparted/fs/r/fat/context.c -+++ b/libparted/fs/r/fat/context.c -@@ -124,7 +124,7 @@ fat_op_context_destroy (FatOpContext* ctx) - free (ctx); - } - --FatFragment -+FatFragment _GL_ATTRIBUTE_PURE - fat_op_context_map_static_fragment (const FatOpContext* ctx, FatFragment frag) - { - FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs); -@@ -160,7 +160,7 @@ fat_op_context_map_static_cluster (const FatOpContext* ctx, FatCluster clst) - return 0; - } - --FatFragment -+FatFragment _GL_ATTRIBUTE_PURE - fat_op_context_map_fragment (const FatOpContext* ctx, FatFragment frag) - { - return ctx->remap [frag]; -diff --git a/libparted/fs/r/fat/count.c b/libparted/fs/r/fat/count.c -index 250e80d..2b65e72 100644 ---- a/libparted/fs/r/fat/count.c -+++ b/libparted/fs/r/fat/count.c -@@ -338,7 +338,7 @@ fat_collect_cluster_info (PedFileSystem* fs) { - return 1; - } - --FatClusterFlag -+FatClusterFlag _GL_ATTRIBUTE_PURE - fat_get_cluster_flag (PedFileSystem* fs, FatCluster cluster) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -@@ -346,7 +346,7 @@ fat_get_cluster_flag (PedFileSystem* fs, FatCluster cluster) - return fs_info->cluster_info [cluster].flag; - } - --PedSector -+PedSector _GL_ATTRIBUTE_PURE - fat_get_cluster_usage (PedFileSystem* fs, FatCluster cluster) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -diff --git a/libparted/fs/r/fat/table.c b/libparted/fs/r/fat/table.c -index fe8e040..98b0499 100644 ---- a/libparted/fs/r/fat/table.c -+++ b/libparted/fs/r/fat/table.c -@@ -371,7 +371,7 @@ fat_table_is_bad (const FatTable* ft, FatCluster cluster) - /* - returns true if represents an EOF marker - */ --int -+int _GL_ATTRIBUTE_PURE - fat_table_is_eof (const FatTable* ft, FatCluster cluster) - { - return _test_code_eof (ft, cluster); -diff --git a/libparted/fs/r/fat/traverse.c b/libparted/fs/r/fat/traverse.c -index fc8a795..50b94bd 100644 ---- a/libparted/fs/r/fat/traverse.c -+++ b/libparted/fs/r/fat/traverse.c -@@ -31,7 +31,7 @@ - - static char tmp_buffer [4096]; - --int -+int _GL_ATTRIBUTE_PURE - fat_traverse_entries_per_buffer (FatTraverseInfo* trav_info) - { - return trav_info->buffer_size / sizeof (FatDirEntry); -@@ -226,7 +226,7 @@ fat_traverse_next_dir_entry (FatTraverseInfo *trav_info) - return trav_info->dir_entries + trav_info->current_entry; - } - --FatCluster -+FatCluster _GL_ATTRIBUTE_PURE - fat_dir_entry_get_first_cluster (FatDirEntry* dir_entry, PedFileSystem *fs) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -@@ -269,7 +269,7 @@ fat_dir_entry_set_first_cluster (FatDirEntry* dir_entry, PedFileSystem* fs, - } - } - --uint32_t -+uint32_t _GL_ATTRIBUTE_PURE - fat_dir_entry_get_length (FatDirEntry* dir_entry) - { - return PED_LE32_TO_CPU (dir_entry->length); -@@ -284,7 +284,7 @@ fat_dir_entry_is_null_term (const FatDirEntry* dir_entry) - return memcmp (&null_entry, dir_entry, sizeof (null_entry)) == 0; - } - --int -+int _GL_ATTRIBUTE_PURE - fat_dir_entry_is_active (FatDirEntry* dir_entry) - { - if ((unsigned char) dir_entry->name[0] == DELETED_FLAG) return 0; -@@ -293,7 +293,7 @@ fat_dir_entry_is_active (FatDirEntry* dir_entry) - return 1; - } - --int -+int _GL_ATTRIBUTE_PURE - fat_dir_entry_is_file (FatDirEntry* dir_entry) { - if (dir_entry->attributes == VFAT_ATTR) return 0; - if (dir_entry->attributes & VOLUME_LABEL_ATTR) return 0; -@@ -302,7 +302,7 @@ fat_dir_entry_is_file (FatDirEntry* dir_entry) { - return 1; - } - --int -+int _GL_ATTRIBUTE_PURE - fat_dir_entry_is_system_file (FatDirEntry* dir_entry) - { - if (!fat_dir_entry_is_file (dir_entry)) return 0; -@@ -310,7 +310,7 @@ fat_dir_entry_is_system_file (FatDirEntry* dir_entry) - || (dir_entry->attributes & HIDDEN_ATTR); - } - --int -+int _GL_ATTRIBUTE_PURE - fat_dir_entry_is_directory (FatDirEntry* dir_entry) - { - if (dir_entry->attributes == VFAT_ATTR) return 0; -diff --git a/libparted/fs/r/hfs/advfs.c b/libparted/fs/r/hfs/advfs.c -index d0afa30..0a39960 100644 ---- a/libparted/fs/r/hfs/advfs.c -+++ b/libparted/fs/r/hfs/advfs.c -@@ -239,7 +239,7 @@ errbb: hfs_free_bad_blocks_list(priv_data->bad_blocks_xtent_list); - } - - /* This function check if fblock is a bad block */ --int -+int _GL_ATTRIBUTE_PURE - hfs_is_bad_block (const PedFileSystem *fs, unsigned int fblock) - { - HfsPrivateFSData* priv_data = (HfsPrivateFSData*) -@@ -304,7 +304,7 @@ hfs_get_empty_end (const PedFileSystem *fs) - - /* return the block which should be used to pack data to have at - least free fblock blocks at the end of the volume */ --unsigned int -+unsigned int _GL_ATTRIBUTE_PURE - hfs_find_start_pack (const PedFileSystem *fs, unsigned int fblock) - { - HfsPrivateFSData* priv_data = (HfsPrivateFSData*) -diff --git a/libparted/fs/r/hfs/advfs_plus.c b/libparted/fs/r/hfs/advfs_plus.c -index 5453c25..2b6fd87 100644 ---- a/libparted/fs/r/hfs/advfs_plus.c -+++ b/libparted/fs/r/hfs/advfs_plus.c -@@ -247,7 +247,7 @@ errbbp: hfsplus_free_bad_blocks_list(priv_data->bad_blocks_xtent_list); - } - - /* This function check if fblock is a bad block */ --int -+int _GL_ATTRIBUTE_PURE - hfsplus_is_bad_block (const PedFileSystem *fs, unsigned int fblock) - { - HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*) -@@ -358,7 +358,7 @@ hfsplus_get_min_size (const PedFileSystem *fs) - - /* return the block which should be used to pack data to have - at least free fblock blocks at the end of the volume */ --unsigned int -+unsigned int _GL_ATTRIBUTE_PURE - hfsplus_find_start_pack (const PedFileSystem *fs, unsigned int fblock) - { - HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*) --- -2.26.2 - diff --git a/0021-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch b/0021-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch deleted file mode 100644 index 8951e18..0000000 --- a/0021-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 34347779d3235186a68a040d3f3166ff45e65dac Mon Sep 17 00:00:00 2001 -From: Shin'ichiro Kawasaki -Date: Wed, 14 Aug 2019 10:59:20 +0900 -Subject: [PATCH 21/42] libparted: Fix warnings from GCC 8 - -Wsuggest-attribute=const - -As GCC 8 suggests, add 'const' attribute to six functions. After adding -const attributes, GCC suggested two more functions to add const -attributes. Add const attributes to those functions also. In total, add -const attributes to 8 functions. - -I read code of the functions and confirmed they are const: they examine -only their arguments and have no effect other than return value. - -Signed-off-by: Shin'ichiro Kawasaki -Signed-off-by: Brian C. Lane ---- - libparted/fs/r/fat/calc.c | 14 +++++++------- - libparted/fs/r/fat/table.c | 2 +- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/libparted/fs/r/fat/calc.c b/libparted/fs/r/fat/calc.c -index 60c6bac..18e0455 100644 ---- a/libparted/fs/r/fat/calc.c -+++ b/libparted/fs/r/fat/calc.c -@@ -23,7 +23,7 @@ - #ifndef DISCOVER_ONLY - - /* returns the minimum size of clusters for a given file system type */ --PedSector -+PedSector _GL_ATTRIBUTE_CONST - fat_min_cluster_size (FatType fat_type) { - switch (fat_type) { - case FAT_TYPE_FAT12: return 1; -@@ -33,7 +33,7 @@ fat_min_cluster_size (FatType fat_type) { - return 0; - } - --static PedSector -+static PedSector _GL_ATTRIBUTE_CONST - _smallest_power2_over (PedSector ceiling) - { - PedSector result = 1; -@@ -45,7 +45,7 @@ _smallest_power2_over (PedSector ceiling) - } - - /* returns the minimum size of clusters for a given file system type */ --PedSector -+PedSector _GL_ATTRIBUTE_CONST - fat_recommend_min_cluster_size (FatType fat_type, PedSector size) { - switch (fat_type) { - case FAT_TYPE_FAT12: return 1; -@@ -59,7 +59,7 @@ fat_recommend_min_cluster_size (FatType fat_type, PedSector size) { - } - - /* returns the maxmimum size of clusters for a given file system type */ --PedSector -+PedSector _GL_ATTRIBUTE_CONST - fat_max_cluster_size (FatType fat_type) { - switch (fat_type) { - case FAT_TYPE_FAT12: return 1; /* dunno... who cares? */ -@@ -70,7 +70,7 @@ fat_max_cluster_size (FatType fat_type) { - } - - /* returns the minimum number of clusters for a given file system type */ --FatCluster -+FatCluster _GL_ATTRIBUTE_CONST - fat_min_cluster_count (FatType fat_type) { - switch (fat_type) { - case FAT_TYPE_FAT12: -@@ -83,7 +83,7 @@ fat_min_cluster_count (FatType fat_type) { - } - - /* returns the maximum number of clusters for a given file system type */ --FatCluster -+FatCluster _GL_ATTRIBUTE_CONST - fat_max_cluster_count (FatType fat_type) { - switch (fat_type) { - case FAT_TYPE_FAT12: return 0xff0; -@@ -94,7 +94,7 @@ fat_max_cluster_count (FatType fat_type) { - } - - /* what is this supposed to be? What drugs are M$ on? (Can I have some? :-) */ --PedSector -+PedSector _GL_ATTRIBUTE_CONST - fat_min_reserved_sector_count (FatType fat_type) - { - return (fat_type == FAT_TYPE_FAT32) ? 32 : 1; -diff --git a/libparted/fs/r/fat/table.c b/libparted/fs/r/fat/table.c -index 98b0499..394a519 100644 ---- a/libparted/fs/r/fat/table.c -+++ b/libparted/fs/r/fat/table.c -@@ -462,7 +462,7 @@ fat_table_set_avail (FatTable* ft, FatCluster cluster) - - #endif /* !DISCOVER_ONLY */ - --int -+int _GL_ATTRIBUTE_CONST - fat_table_entry_size (FatType fat_type) - { - switch (fat_type) { --- -2.26.2 - diff --git a/0022-bsd-Fix-gcc-complaints-when-using-boot_code-pointer.patch b/0022-bsd-Fix-gcc-complaints-when-using-boot_code-pointer.patch deleted file mode 100644 index 822ce58..0000000 --- a/0022-bsd-Fix-gcc-complaints-when-using-boot_code-pointer.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b11bbb5a0b5c357816bff424c2a325806d60f20b Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Mon, 9 Nov 2020 14:33:37 -0800 -Subject: [PATCH 22/42] bsd: Fix gcc complaints when using boot_code pointer - ---- - libparted/labels/bsd.c | 13 +++++-------- - 1 file changed, 5 insertions(+), 8 deletions(-) - -diff --git a/libparted/labels/bsd.c b/libparted/labels/bsd.c -index 6946563..8483641 100644 ---- a/libparted/labels/bsd.c -+++ b/libparted/labels/bsd.c -@@ -307,19 +307,16 @@ error: - static void - _probe_and_add_boot_code (const PedDisk* disk) - { -- char *old_boot_code; -- BSDRawLabel *old_label; -+ BSDDiskData *old_data; - - void *s0; - if (!ptt_read_sector (disk->dev, 0, &s0)) - return; -- old_boot_code = ((BSDDiskData*) s0)->boot_code; -- old_label = &((BSDDiskData*) s0)->label; -- -- if (old_boot_code [0] -- && old_label->d_magic == PED_CPU_TO_LE32 (BSD_DISKMAGIC)) { -+ old_data = (BSDDiskData*) s0; -+ if (old_data->boot_code [0] -+ && old_data->label.d_magic == PED_CPU_TO_LE32 (BSD_DISKMAGIC)) { - BSDDiskData *bsd_specific = (BSDDiskData*) disk->disk_specific; -- memcpy (bsd_specific, old_boot_code, sizeof (BSDDiskData)); -+ memcpy (bsd_specific, old_data, sizeof (BSDDiskData)); - } - free (s0); - } --- -2.26.2 - diff --git a/0023-dos-Fix-gcc-complaints-when-using-boot_code-pointer.patch b/0023-dos-Fix-gcc-complaints-when-using-boot_code-pointer.patch deleted file mode 100644 index 9f97c6f..0000000 --- a/0023-dos-Fix-gcc-complaints-when-using-boot_code-pointer.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 1ff56b03ec960435d55e200300093581ba874d53 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Mon, 9 Nov 2020 15:09:07 -0800 -Subject: [PATCH 23/42] dos: Fix gcc complaints when using boot_code pointer - ---- - libparted/labels/dos.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c -index d859b33..bfa253b 100644 ---- a/libparted/labels/dos.c -+++ b/libparted/labels/dos.c -@@ -1291,7 +1291,7 @@ msdos_write (const PedDisk* disk) - DosRawTable *table = (DosRawTable *) s0; - - if (!table->boot_code[0]) { -- memset (table->boot_code, 0, 512); -+ memset (table, 0, 512); - memcpy (table->boot_code, MBR_BOOT_CODE, sizeof (MBR_BOOT_CODE)); - } - --- -2.26.2 - diff --git a/0024-linux-Fix-gcc-complains-about-signed-sccanf-variable.patch b/0024-linux-Fix-gcc-complains-about-signed-sccanf-variable.patch deleted file mode 100644 index f95b520..0000000 --- a/0024-linux-Fix-gcc-complains-about-signed-sccanf-variable.patch +++ /dev/null @@ -1,38 +0,0 @@ -From c3e648518235e1f77ca496c1234459e4bac300ad Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Mon, 9 Nov 2020 15:16:22 -0800 -Subject: [PATCH 24/42] linux: Fix gcc complains about signed sccanf variables - ---- - libparted/arch/linux.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index 09ec781..4c17720 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -720,9 +720,9 @@ _get_linux_version () - static int kver = -1; - - struct utsname uts; -- int major = 0; -- int minor = 0; -- int teeny = 0; -+ unsigned int major = 0; -+ unsigned int minor = 0; -+ unsigned int teeny = 0; - - if (kver != -1) - return kver; -@@ -2884,7 +2884,7 @@ _dm_get_partition_start_and_length(PedPartition const *part, - char *params; - char *target_type; - dm_get_next_target(task, NULL, (uint64_t *)start, (uint64_t *)length, &target_type, ¶ms); -- if (sscanf (params, "%d:%d %Ld", &major, &minor, start) != 3) -+ if (sscanf (params, "%d:%d %Lu", &major, &minor, start) != 3) - goto err; - rc = 1; - --- -2.26.2 - diff --git a/0025-tests-Fix-unsigned-warning-in-duplicate.c.patch b/0025-tests-Fix-unsigned-warning-in-duplicate.c.patch deleted file mode 100644 index 44c3c04..0000000 --- a/0025-tests-Fix-unsigned-warning-in-duplicate.c.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 09fb0fc6dadde9982d243567cf92743149895102 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Mon, 9 Nov 2020 15:53:30 -0800 -Subject: [PATCH 25/42] tests: Fix unsigned warning in duplicate.c - ---- - tests/duplicate.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/duplicate.c b/tests/duplicate.c -index a9dde84..771faab 100644 ---- a/tests/duplicate.c -+++ b/tests/duplicate.c -@@ -134,7 +134,7 @@ main (int argc, char **argv) - { - if (!ped_partition_is_flag_available(disk_part, flag)) - continue; -- fprintf (stderr, "Checking partition flag %d\n", flag); -+ fprintf (stderr, "Checking partition flag %u\n", flag); - fprintf (stderr, "%d ? %d\n", ped_partition_get_flag (disk_part, flag), - ped_partition_get_flag (copy_part, flag)); - assert (ped_partition_get_flag (disk_part, flag) --- -2.26.2 - diff --git a/0026-hfs-Fix-gcc-10-bounds-check-warning.patch b/0026-hfs-Fix-gcc-10-bounds-check-warning.patch deleted file mode 100644 index f80873b..0000000 --- a/0026-hfs-Fix-gcc-10-bounds-check-warning.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b7ccc1b29674937ab4c97d0e1b7b5bfd6f366b92 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 10 Nov 2020 15:42:46 -0800 -Subject: [PATCH 26/42] hfs: Fix gcc 10 bounds check warning - -binfo is actually a list of structs that cannot be known until runtime, -so use a variable length array. ---- - libparted/fs/hfs/hfs.h | 2 +- - libparted/fs/r/hfs/hfs.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libparted/fs/hfs/hfs.h b/libparted/fs/hfs/hfs.h -index 4fa2e95..0a9392a 100644 ---- a/libparted/fs/hfs/hfs.h -+++ b/libparted/fs/hfs/hfs.h -@@ -529,7 +529,7 @@ struct __attribute__ ((packed)) _HfsJBlockListHeader { - uint32_t bytes_used; - uint32_t checksum; - uint32_t pad; -- HfsJBlockInfo binfo[1]; -+ HfsJBlockInfo binfo[]; - }; - typedef struct _HfsJBlockListHeader HfsJBlockListHeader; - -diff --git a/libparted/fs/r/hfs/hfs.h b/libparted/fs/r/hfs/hfs.h -index 4fa2e95..0a9392a 100644 ---- a/libparted/fs/r/hfs/hfs.h -+++ b/libparted/fs/r/hfs/hfs.h -@@ -529,7 +529,7 @@ struct __attribute__ ((packed)) _HfsJBlockListHeader { - uint32_t bytes_used; - uint32_t checksum; - uint32_t pad; -- HfsJBlockInfo binfo[1]; -+ HfsJBlockInfo binfo[]; - }; - typedef struct _HfsJBlockListHeader HfsJBlockListHeader; - --- -2.26.2 - diff --git a/0027-hfs-advfs-Fix-gcc-10-warnings-about-cast-alignment.patch b/0027-hfs-advfs-Fix-gcc-10-warnings-about-cast-alignment.patch deleted file mode 100644 index dd00068..0000000 --- a/0027-hfs-advfs-Fix-gcc-10-warnings-about-cast-alignment.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 868fab2fea9ad6422b2ee9b3c1ab9e69d5a4f9a7 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 10 Nov 2020 16:15:49 -0800 -Subject: [PATCH 27/42] hfs/advfs: Fix gcc 10 warnings about cast alignment - ---- - libparted/fs/r/hfs/advfs.c | 25 ++++++++++++++----------- - 1 file changed, 14 insertions(+), 11 deletions(-) - -diff --git a/libparted/fs/r/hfs/advfs.c b/libparted/fs/r/hfs/advfs.c -index 0a39960..1ce4319 100644 ---- a/libparted/fs/r/hfs/advfs.c -+++ b/libparted/fs/r/hfs/advfs.c -@@ -87,12 +87,14 @@ hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key, - HfsPrivateGenericKey* record_key = NULL; - unsigned int node_number, record_number; - int i; -+ uint16_t record_pos; - - /* Read the header node */ - if (!hfs_file_read_sector(b_tree_file, node, 0)) - return 0; -- header = ((HfsHeaderRecord*) (node + PED_BE16_TO_CPU(*((uint16_t *) -- (node+(PED_SECTOR_SIZE_DEFAULT-2)))))); -+ uint16_t offset; -+ memcpy(&offset, node+(PED_SECTOR_SIZE_DEFAULT-2), sizeof(uint16_t)); -+ header = (HfsHeaderRecord*) (node + PED_BE16_TO_CPU(offset)); - - /* Get the node number of the root */ - node_number = PED_BE32_TO_CPU(header->root_node); -@@ -107,13 +109,13 @@ hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key, - while (1) { - record_number = PED_BE16_TO_CPU (desc->rec_nb); - for (i = record_number; i; i--) { -- record_key = (HfsPrivateGenericKey*) -- (node + PED_BE16_TO_CPU(*((uint16_t *) -- (node+(PED_SECTOR_SIZE_DEFAULT - 2*i))))); -+ uint16_t value; -+ memcpy(&value, node+(PED_SECTOR_SIZE_DEFAULT - (2*i)), sizeof(uint16_t)); -+ record_pos = PED_BE16_TO_CPU(value); -+ record_key = (HfsPrivateGenericKey*) (node + record_pos); - /* check for obvious error in FS */ -- if (((uint8_t*)record_key - node < HFS_FIRST_REC) -- || ((uint8_t*)record_key - node -- >= PED_SECTOR_SIZE_DEFAULT -+ if ((record_pos< HFS_FIRST_REC) -+ || (record_pos>= PED_SECTOR_SIZE_DEFAULT - - 2 * (signed)(record_number+1))) { - ped_exception_throw ( - PED_EXCEPTION_ERROR, -@@ -129,8 +131,9 @@ hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key, - unsigned int skip; - - skip = (1 + record_key->key_length + 1) & ~1; -- node_number = PED_BE32_TO_CPU (*((uint32_t *) -- (((uint8_t *) record_key) + skip))); -+ uint32_t value; -+ memcpy(&value, node+record_pos+skip, sizeof(uint32_t)); -+ node_number = PED_BE32_TO_CPU(value); - if (!hfs_file_read_sector(b_tree_file, node, - node_number)) - return 0; -@@ -146,7 +149,7 @@ hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key, - if (record_ref) { - record_ref->node_size = 1; /* in sectors */ - record_ref->node_number = node_number; -- record_ref->record_pos = (uint8_t*)record_key - node; -+ record_ref->record_pos = record_pos; - record_ref->record_number = i; - } - --- -2.26.2 - diff --git a/0028-hfs-advfs_plus-Fix-gcc-10-warnings-about-cast-alignm.patch b/0028-hfs-advfs_plus-Fix-gcc-10-warnings-about-cast-alignm.patch deleted file mode 100644 index f39c720..0000000 --- a/0028-hfs-advfs_plus-Fix-gcc-10-warnings-about-cast-alignm.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 6cb1ed79543f9a9425de2b334a41e08836edc6b8 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 10 Nov 2020 17:05:59 -0800 -Subject: [PATCH 28/42] hfs/advfs_plus: Fix gcc 10 warnings about cast - alignment - ---- - libparted/fs/r/hfs/advfs_plus.c | 22 ++++++++++++---------- - 1 file changed, 12 insertions(+), 10 deletions(-) - -diff --git a/libparted/fs/r/hfs/advfs_plus.c b/libparted/fs/r/hfs/advfs_plus.c -index 2b6fd87..2141746 100644 ---- a/libparted/fs/r/hfs/advfs_plus.c -+++ b/libparted/fs/r/hfs/advfs_plus.c -@@ -80,6 +80,7 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key, - HfsPPrivateGenericKey* record_key = NULL; - unsigned int node_number, record_number, size, bsize; - int i; -+ uint16_t record_pos; - - /* Read the header node */ - if (!hfsplus_file_read_sector(b_tree_file, node_1, 0)) -@@ -93,7 +94,7 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key, - - /* Get the size of a node in sectors and allocate buffer */ - size = (bsize = PED_BE16_TO_CPU (header->node_size)) / PED_SECTOR_SIZE_DEFAULT; -- node = (uint8_t*) ped_malloc (bsize); -+ node = ped_malloc (bsize); - if (!node) - return 0; - HfsPNodeDescriptor *desc = (HfsPNodeDescriptor*) node; -@@ -107,13 +108,13 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key, - while (1) { - record_number = PED_BE16_TO_CPU (desc->rec_nb); - for (i = record_number; i; i--) { -- record_key = (HfsPPrivateGenericKey*) -- (node + PED_BE16_TO_CPU(*((uint16_t *) -- (node+(bsize - 2*i))))); -+ uint16_t value; -+ memcpy(&value, node+(bsize - (2*i)), sizeof(uint16_t)); -+ record_pos = PED_BE16_TO_CPU(value); -+ record_key = (HfsPPrivateGenericKey*) (node + record_pos); - /* check for obvious error in FS */ -- if (((uint8_t*)record_key - node < HFS_FIRST_REC) -- || ((uint8_t*)record_key - node -- >= (signed)bsize -+ if ((record_pos < HFS_FIRST_REC) -+ || (record_pos >= (signed)bsize - - 2 * (signed)(record_number+1))) { - ped_exception_throw ( - PED_EXCEPTION_ERROR, -@@ -131,8 +132,9 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key, - - skip = ( 2 + PED_BE16_TO_CPU (record_key->key_length) - + 1 ) & ~1; -- node_number = PED_BE32_TO_CPU (*((uint32_t *) -- (((uint8_t *) record_key) + skip))); -+ uint32_t value; -+ memcpy(&value, node+record_pos+skip, sizeof(uint32_t)); -+ node_number = PED_BE32_TO_CPU(value); - if (!hfsplus_file_read(b_tree_file, node, - (PedSector) node_number * size, - size)) { -@@ -151,7 +153,7 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key, - if (record_ref) { - record_ref->node_size = size; /* in sectors */ - record_ref->node_number = node_number; -- record_ref->record_pos = (uint8_t*)record_key - node; -+ record_ref->record_pos = record_pos; - record_ref->record_number = i; - } - --- -2.26.2 - diff --git a/0029-hfs-hfs-Fix-gcc-10-warnings-about-cast-alignment.patch b/0029-hfs-hfs-Fix-gcc-10-warnings-about-cast-alignment.patch deleted file mode 100644 index cde8032..0000000 --- a/0029-hfs-hfs-Fix-gcc-10-warnings-about-cast-alignment.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 006ad756c70603212309157fa05c5d855e25f07e Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 12 Nov 2020 13:33:36 -0800 -Subject: [PATCH 29/42] hfs/hfs: Fix gcc 10 warnings about cast alignment - ---- - libparted/fs/r/hfs/hfs.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c -index 0aababd..09899da 100644 ---- a/libparted/fs/r/hfs/hfs.c -+++ b/libparted/fs/r/hfs/hfs.c -@@ -891,12 +891,11 @@ hfsplus_wrapper_update (PedFileSystem* fs) - ref.record_number = 1; - } - -- ref.record_pos = -- PED_BE16_TO_CPU (*((uint16_t *) -- (node + (PED_SECTOR_SIZE_DEFAULT -- - 2*ref.record_number)))); -+ uint16_t value; -+ memcpy(&value, node+PED_SECTOR_SIZE_DEFAULT - (2*ref.record_number), sizeof(uint16_t)); -+ ref.record_pos = PED_BE16_TO_CPU(value); - ret_key = (HfsExtentKey*) (node + ref.record_pos); -- ret_data = (HfsExtDescriptor*) ( node + ref.record_pos -+ ret_data = (HfsExtDescriptor*) (node + ref.record_pos - + sizeof (HfsExtentKey) ); - } - --- -2.26.2 - diff --git a/0030-ext2-Fix-gcc-10-warnings-about-cast-alignment.patch b/0030-ext2-Fix-gcc-10-warnings-about-cast-alignment.patch deleted file mode 100644 index 05ff94c..0000000 --- a/0030-ext2-Fix-gcc-10-warnings-about-cast-alignment.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 1e086dba260630b63e0822731522ce04c081d95e Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Tue, 10 Nov 2020 14:39:06 -0800 -Subject: [PATCH 30/42] ext2: Fix gcc 10 warnings about cast alignment - ---- - libparted/fs/ext2/ext2_fs.h | 2 +- - libparted/fs/ext2/interface.c | 7 ++++--- - 2 files changed, 5 insertions(+), 4 deletions(-) - -diff --git a/libparted/fs/ext2/ext2_fs.h b/libparted/fs/ext2/ext2_fs.h -index ac1b6a0..362f8bc 100644 ---- a/libparted/fs/ext2/ext2_fs.h -+++ b/libparted/fs/ext2/ext2_fs.h -@@ -173,7 +173,7 @@ struct ext2_inode - - #define i_size_high i_dir_acl - --struct ext2_super_block -+struct __attribute__ ((packed)) ext2_super_block - { - uint32_t s_inodes_count; /* Inodes count */ - uint32_t s_blocks_count; /* Blocks count */ -diff --git a/libparted/fs/ext2/interface.c b/libparted/fs/ext2/interface.c -index a49568b..01c224e 100644 ---- a/libparted/fs/ext2/interface.c -+++ b/libparted/fs/ext2/interface.c -@@ -33,12 +33,13 @@ struct ext2_dev_handle* ext2_make_dev_handle_from_parted_geometry(PedGeometry* g - static PedGeometry* - _ext2_generic_probe (PedGeometry* geom, int expect_ext_ver) - { -+ struct ext2_super_block *sb; - const int sectors = (4096 + geom->dev->sector_size - 1) / - geom->dev->sector_size; -- char *sb_v = alloca (sectors * geom->dev->sector_size); -- if (!ped_geometry_read(geom, sb_v, 0, sectors)) -+ uint8_t *buf = alloca (sectors * geom->dev->sector_size); -+ if (!ped_geometry_read(geom, buf, 0, sectors)) - return NULL; -- struct ext2_super_block *sb = (struct ext2_super_block *)(sb_v + 1024); -+ sb = (struct ext2_super_block *)(buf+1024); - - if (EXT2_SUPER_MAGIC(*sb) == EXT2_SUPER_MAGIC_CONST) { - PedSector block_size = (EXT2_MIN_BLOCK_SIZE << (EXT2_SUPER_LOG_BLOCK_SIZE(*sb))) / geom->dev->sector_size; --- -2.26.2 - diff --git a/0031-nilfs2-Fix-gcc-10-warnings-about-cast-alignment.patch b/0031-nilfs2-Fix-gcc-10-warnings-about-cast-alignment.patch deleted file mode 100644 index b8898a2..0000000 --- a/0031-nilfs2-Fix-gcc-10-warnings-about-cast-alignment.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 362571d09da09fb2b6fab7037af26d83b2d39b75 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 12 Nov 2020 16:08:31 -0800 -Subject: [PATCH 31/42] nilfs2: Fix gcc 10 warnings about cast alignment - ---- - libparted/fs/nilfs2/nilfs2.c | 11 +++++------ - 1 file changed, 5 insertions(+), 6 deletions(-) - -diff --git a/libparted/fs/nilfs2/nilfs2.c b/libparted/fs/nilfs2/nilfs2.c -index 3ca4808..2871179 100644 ---- a/libparted/fs/nilfs2/nilfs2.c -+++ b/libparted/fs/nilfs2/nilfs2.c -@@ -34,8 +34,7 @@ - /* secondary superblock offset in 512byte blocks. */ - #define NILFS_SB2_OFFSET(devsize) ((((devsize)>>3) - 1) << 3) - --struct nilfs2_super_block --{ -+struct __attribute__ ((packed)) nilfs2_super_block { - uint32_t s_rev_level; - uint16_t s_minor_rev_level; - uint16_t s_magic; -@@ -112,18 +111,18 @@ nilfs2_probe (PedGeometry* geom) - return NULL; - const int sectors = (4096 + geom->dev->sector_size - 1) / - geom->dev->sector_size; -- char *buf = alloca (sectors * geom->dev->sector_size); -+ uint8_t *buf = alloca (sectors * geom->dev->sector_size); - const int sectors2 = (1024 + geom->dev->sector_size -1 ) / - geom->dev->sector_size; - void *buff2 = alloca (sectors2 * geom->dev->sector_size); - - if (ped_geometry_read(geom, buf, 0, sectors)) -- sb = (struct nilfs2_super_block *)(buf+1024); -+ sb = (struct nilfs2_super_block*)(buf + 1024); - if (ped_geometry_read(geom, buff2, sb2off, sectors2)) -- sb2 = buff2; -+ sb2 = (struct nilfs2_super_block*)buff2; - - if ((!sb || !is_valid_nilfs_sb(sb)) && -- (!sb2 || !is_valid_nilfs_sb(sb2)) ) -+ (!sb2 || !is_valid_nilfs_sb(sb2))) - return NULL; - - /* reserve 4k bytes for secondary superblock */ --- -2.26.2 - diff --git a/0032-ntfs-Fix-gcc-10-warnings-about-cast-alignment.patch b/0032-ntfs-Fix-gcc-10-warnings-about-cast-alignment.patch deleted file mode 100644 index d19fee2..0000000 --- a/0032-ntfs-Fix-gcc-10-warnings-about-cast-alignment.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e2ee2628c5d75b375db90a486b906c0d2405b8b3 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 12 Nov 2020 16:18:42 -0800 -Subject: [PATCH 32/42] ntfs: Fix gcc 10 warnings about cast alignment - ---- - libparted/fs/ntfs/ntfs.c | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/libparted/fs/ntfs/ntfs.c b/libparted/fs/ntfs/ntfs.c -index 3bfb28e..a3a6550 100644 ---- a/libparted/fs/ntfs/ntfs.c -+++ b/libparted/fs/ntfs/ntfs.c -@@ -35,16 +35,17 @@ - PedGeometry* - ntfs_probe (PedGeometry* geom) - { -- char *buf = alloca (geom->dev->sector_size); -+ uint8_t *buf = alloca(geom->dev->sector_size); - PedGeometry *newg = NULL; - - if (!ped_geometry_read(geom, buf, 0, 1)) - return 0; - -- if (strncmp (NTFS_SIGNATURE, buf + 3, strlen (NTFS_SIGNATURE)) == 0) -- newg = ped_geometry_new (geom->dev, geom->start, -- PED_LE64_TO_CPU (*(uint64_t*) -- (buf + 0x28))); -+ if (strncmp (NTFS_SIGNATURE, ((char *)buf + 3), strlen (NTFS_SIGNATURE)) == 0) { -+ uint64_t length; -+ memcpy(&length, buf + 0x28, sizeof(uint64_t)); -+ newg = ped_geometry_new (geom->dev, geom->start, length); -+ } - return newg; - } - --- -2.26.2 - diff --git a/0033-ufs-Fix-gcc-10-warnings-about-cast-alignment.patch b/0033-ufs-Fix-gcc-10-warnings-about-cast-alignment.patch deleted file mode 100644 index 3713d61..0000000 --- a/0033-ufs-Fix-gcc-10-warnings-about-cast-alignment.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 65d95eaf5692f7d19f2b550dee4c9b585ce79938 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 12 Nov 2020 16:19:10 -0800 -Subject: [PATCH 33/42] ufs: Fix gcc 10 warnings about cast alignment - ---- - libparted/fs/ufs/ufs.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/libparted/fs/ufs/ufs.c b/libparted/fs/ufs/ufs.c -index 27cb036..f677b60 100644 ---- a/libparted/fs/ufs/ufs.c -+++ b/libparted/fs/ufs/ufs.c -@@ -45,14 +45,14 @@ - #define UFS_MAGIC_FEA 0x00195612 - #define UFS_MAGIC_4GB 0x05231994 - --struct ufs_csum { -+struct __attribute__ ((packed)) ufs_csum { - uint32_t cs_ndir; /* number of directories */ - uint32_t cs_nbfree; /* number of free blocks */ - uint32_t cs_nifree; /* number of free inodes */ - uint32_t cs_nffree; /* number of free frags */ - }; - --struct ufs_super_block { -+struct __attribute__ ((packed)) ufs_super_block { - uint32_t fs_link; /* UNUSED */ - uint32_t fs_rlink; /* UNUSED */ - uint32_t fs_sblkno; /* addr of super-block in filesys */ -@@ -176,7 +176,7 @@ ufs_probe_sun (PedGeometry* geom) - { - const int sectors = ((3 * 512) + geom->dev->sector_size - 1) / - geom->dev->sector_size; -- char * buf = alloca (sectors * geom->dev->sector_size); -+ uint8_t* buf = alloca (sectors * geom->dev->sector_size); - struct ufs_super_block *sb; - - if (geom->length < 5) -@@ -212,7 +212,7 @@ ufs_probe_hp (PedGeometry* geom) - return 0; - const int sectors = ((3 * 512) + geom->dev->sector_size - 1) / - geom->dev->sector_size; -- char * buf = alloca (sectors * geom->dev->sector_size); -+ uint8_t* buf = alloca (sectors * geom->dev->sector_size); - - if (!ped_geometry_read (geom, buf, 16 * 512 / geom->dev->sector_size, sectors)) - return 0; --- -2.26.2 - diff --git a/0034-ped_assert-Fix-incorrect-exception-option.patch b/0034-ped_assert-Fix-incorrect-exception-option.patch deleted file mode 100644 index 863c640..0000000 --- a/0034-ped_assert-Fix-incorrect-exception-option.patch +++ /dev/null @@ -1,27 +0,0 @@ -From c21ee3827639343920d3f08cff319620d3582d2a Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 12 Nov 2020 16:19:36 -0800 -Subject: [PATCH 34/42] ped_assert: Fix incorrect exception option - -PED_EXCEPTION_FATAL is a type, not an option. A PED_EXCEPTION_BUG should -always select CANCEL. ---- - libparted/debug.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libparted/debug.c b/libparted/debug.c -index c4932ca..227673e 100644 ---- a/libparted/debug.c -+++ b/libparted/debug.c -@@ -106,7 +106,7 @@ void ped_assert (const char* cond_text, - /* Throw the exception */ - ped_exception_throw ( - PED_EXCEPTION_BUG, -- PED_EXCEPTION_FATAL, -+ PED_EXCEPTION_CANCEL, - _("Assertion (%s) at %s:%d in function %s() failed."), - cond_text, file, line, function); - abort (); --- -2.26.2 - diff --git a/0035-ui-Fix-command_line_get_disk_flag.patch b/0035-ui-Fix-command_line_get_disk_flag.patch deleted file mode 100644 index d7a88f3..0000000 --- a/0035-ui-Fix-command_line_get_disk_flag.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 45e4c689c81cc55f849d3f90168a6b89c0168191 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 12 Nov 2020 16:30:57 -0800 -Subject: [PATCH 35/42] ui: Fix command_line_get_disk_flag - -It was using PedPartitionFlag instead of PedDiskFlag when walking the -available flags. ---- - parted/ui.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/parted/ui.c b/parted/ui.c -index 7b5374d..8e1f2fe 100644 ---- a/parted/ui.c -+++ b/parted/ui.c -@@ -1138,7 +1138,7 @@ command_line_get_disk_flag (const char* prompt, const PedDisk* disk, - PedDiskFlag* flag) - { - StrList* opts = NULL; -- PedPartitionFlag walk = 0; -+ PedDiskFlag walk = 0; - char* flag_name; - - while ( (walk = ped_disk_flag_next (walk)) ) { --- -2.26.2 - diff --git a/0036-ui-Fix-gcc-10-warning-about-snprintf-truncating-an-i.patch b/0036-ui-Fix-gcc-10-warning-about-snprintf-truncating-an-i.patch deleted file mode 100644 index 8202798..0000000 --- a/0036-ui-Fix-gcc-10-warning-about-snprintf-truncating-an-i.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 6e34cb98ddef0c9fd47359a2006265e7251e8830 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Thu, 12 Nov 2020 16:49:29 -0800 -Subject: [PATCH 36/42] ui: Fix gcc 10 warning about snprintf truncating an int - -Double the storage to 20 bytes. ---- - parted/ui.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/parted/ui.c b/parted/ui.c -index 8e1f2fe..73fdcf5 100644 ---- a/parted/ui.c -+++ b/parted/ui.c -@@ -909,11 +909,11 @@ command_line_get_word (const char* prompt, const char* def, - int - command_line_get_integer (const char* prompt, int* value) - { -- char def_str [10]; -+ char def_str [20]; - char* input; - long ret; - -- snprintf (def_str, 10, "%d", *value); -+ snprintf (def_str, 20, "%d", *value); - input = command_line_get_word (prompt, *value ? def_str : NULL, - NULL, 1); - if (!input) --- -2.26.2 - diff --git a/0037-hfs-reloc-Fix-gcc-10-warnings-about-cast-alignment.patch b/0037-hfs-reloc-Fix-gcc-10-warnings-about-cast-alignment.patch deleted file mode 100644 index 25f1ff0..0000000 --- a/0037-hfs-reloc-Fix-gcc-10-warnings-about-cast-alignment.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 76bf966849534a832c30cd89dbbb8a32939dcbed Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 13 Nov 2020 15:12:06 -0800 -Subject: [PATCH 37/42] hfs/reloc: Fix gcc 10 warnings about cast alignment - ---- - libparted/fs/r/hfs/reloc.c | 35 ++++++++++++++++++++--------------- - 1 file changed, 20 insertions(+), 15 deletions(-) - -diff --git a/libparted/fs/r/hfs/reloc.c b/libparted/fs/r/hfs/reloc.c -index d0477ae..68b14ae 100644 ---- a/libparted/fs/r/hfs/reloc.c -+++ b/libparted/fs/r/hfs/reloc.c -@@ -373,6 +373,7 @@ hfs_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs, - HfsExtDescriptor* extent; - unsigned int leaf_node, record_number; - unsigned int i, j; -+ uint16_t catalog_pos; - - if (!priv_data->catalog_file->sect_nb) { - ped_exception_throw ( -@@ -385,8 +386,9 @@ hfs_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs, - - if (!hfs_file_read_sector (priv_data->catalog_file, node, 0)) - return 0; -- header = (HfsHeaderRecord*)(node + PED_BE16_TO_CPU(*((uint16_t*) -- (node+(PED_SECTOR_SIZE_DEFAULT-2))))); -+ uint16_t offset; -+ memcpy(&offset, node+(PED_SECTOR_SIZE_DEFAULT-2), sizeof(uint16_t)); -+ header = (HfsHeaderRecord*) (node + PED_BE16_TO_CPU(offset)); - - for (leaf_node = PED_BE32_TO_CPU (header->first_leaf_node); - leaf_node; -@@ -397,14 +399,15 @@ hfs_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs, - record_number = PED_BE16_TO_CPU (desc->rec_nb); - for (i = 1; i <= record_number; ++i) { - /* undocumented alignement */ -+ uint16_t value; -+ memcpy(&value, node+(PED_SECTOR_SIZE_DEFAULT - (2*i)), sizeof(uint16_t)); -+ catalog_pos = PED_BE16_TO_CPU(value); -+ catalog_key = (HfsCatalogKey*) (node + catalog_pos); - unsigned int skip; -- catalog_key = (HfsCatalogKey*) (node + PED_BE16_TO_CPU( -- *((uint16_t*)(node+(PED_SECTOR_SIZE_DEFAULT - 2*i))))); - skip = (1 + catalog_key->key_length + 1) & ~1; -- catalog_data = (HfsCatalog*)( ((uint8_t*)catalog_key) -- + skip ); -+ catalog_data = (HfsCatalog*)(node+catalog_pos+skip); - /* check for obvious error in FS */ -- if (((uint8_t*)catalog_key - node < HFS_FIRST_REC) -+ if ((catalog_pos < HFS_FIRST_REC) - || ((uint8_t*)catalog_data - node - >= PED_SECTOR_SIZE_DEFAULT - - 2 * (signed)(record_number+1))) { -@@ -467,6 +470,7 @@ hfs_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs, - HfsExtDescriptor* extent; - unsigned int leaf_node, record_number; - unsigned int i, j; -+ uint16_t extent_pos; - - if (!priv_data->extent_file->sect_nb) { - ped_exception_throw ( -@@ -479,8 +483,9 @@ hfs_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs, - - if (!hfs_file_read_sector (priv_data->extent_file, node, 0)) - return 0; -- header = ((HfsHeaderRecord*) (node + PED_BE16_TO_CPU(*((uint16_t *) -- (node+(PED_SECTOR_SIZE_DEFAULT-2)))))); -+ uint16_t offset; -+ memcpy(&offset, node+(PED_SECTOR_SIZE_DEFAULT-2), sizeof(uint16_t)); -+ header = (HfsHeaderRecord*) (node + PED_BE16_TO_CPU(offset)); - - for (leaf_node = PED_BE32_TO_CPU (header->first_leaf_node); - leaf_node; -@@ -491,14 +496,14 @@ hfs_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs, - record_number = PED_BE16_TO_CPU (desc->rec_nb); - for (i = 1; i <= record_number; i++) { - uint8_t where; -- extent_key = (HfsExtentKey*) -- (node + PED_BE16_TO_CPU(*((uint16_t *) -- (node+(PED_SECTOR_SIZE_DEFAULT - 2*i))))); -+ uint16_t value; -+ memcpy(&value, node+(PED_SECTOR_SIZE_DEFAULT - (2*i)), sizeof(uint16_t)); -+ extent_pos = PED_BE16_TO_CPU(value); -+ extent_key = (HfsExtentKey*)(node + extent_pos); - /* size is cst */ -- extent = (HfsExtDescriptor*)(((uint8_t*)extent_key) -- + sizeof (HfsExtentKey)); -+ extent = (HfsExtDescriptor*)(node+extent_pos+sizeof(HfsExtentKey)); - /* check for obvious error in FS */ -- if (((uint8_t*)extent_key - node < HFS_FIRST_REC) -+ if ((extent_pos < HFS_FIRST_REC) - || ((uint8_t*)extent - node - >= PED_SECTOR_SIZE_DEFAULT - - 2 * (signed)(record_number+1))) { --- -2.26.2 - diff --git a/0038-hfs-reloc_plus-Fix-gcc-10-warnings-about-cast-alignm.patch b/0038-hfs-reloc_plus-Fix-gcc-10-warnings-about-cast-alignm.patch deleted file mode 100644 index 9c4d712..0000000 --- a/0038-hfs-reloc_plus-Fix-gcc-10-warnings-about-cast-alignm.patch +++ /dev/null @@ -1,103 +0,0 @@ -From f496795a850976d211d3f5c673b868c3c90a8c3d Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 13 Nov 2020 15:25:35 -0800 -Subject: [PATCH 38/42] hfs/reloc_plus: Fix gcc 10 warnings about cast - alignment - ---- - libparted/fs/r/hfs/reloc_plus.c | 33 +++++++++++++++++++-------------- - 1 file changed, 19 insertions(+), 14 deletions(-) - -diff --git a/libparted/fs/r/hfs/reloc_plus.c b/libparted/fs/r/hfs/reloc_plus.c -index cebadbe..44c0a77 100644 ---- a/libparted/fs/r/hfs/reloc_plus.c -+++ b/libparted/fs/r/hfs/reloc_plus.c -@@ -486,6 +486,7 @@ hfsplus_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs, - unsigned int i, j, size, bsize; - uint32_t jib = priv_data->jib_start_block, - jl = priv_data->jl_start_block; -+ uint16_t catalog_pos; - - if (!priv_data->catalog_file->sect_nb) { - ped_exception_throw ( -@@ -520,15 +521,16 @@ hfsplus_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs, - unsigned int skip; - uint8_t where; - -- catalog_key = (HfsPCatalogKey*) -- ( node + PED_BE16_TO_CPU (*((uint16_t *) -- (node+(bsize - 2*i)))) ); -+ uint16_t value; -+ memcpy(&value, node+(bsize - (2*i)), sizeof(uint16_t)); -+ catalog_pos = PED_BE16_TO_CPU(value); -+ catalog_key = (HfsPCatalogKey*)(node + catalog_pos); - skip = ( 2 + PED_BE16_TO_CPU (catalog_key->key_length) - + 1) & ~1; - catalog_data = (HfsPCatalog*) - (((uint8_t*)catalog_key) + skip); - /* check for obvious error in FS */ -- if (((uint8_t*)catalog_key - node < HFS_FIRST_REC) -+ if ((catalog_pos < HFS_FIRST_REC) - || ((uint8_t*)catalog_data - node - >= (signed) bsize - - 2 * (signed)(record_number+1))) { -@@ -609,6 +611,7 @@ hfsplus_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs, - HfsPExtDescriptor* extent; - unsigned int leaf_node, record_number; - unsigned int i, j, size, bsize; -+ uint16_t extent_pos; - - if (!priv_data->extents_file->sect_nb) { - ped_exception_throw ( -@@ -640,13 +643,14 @@ hfsplus_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs, - record_number = PED_BE16_TO_CPU (desc->rec_nb); - for (i = 1; i <= record_number; i++) { - uint8_t where; -- extent_key = (HfsPExtentKey*) -- (node + PED_BE16_TO_CPU(*((uint16_t *) -- (node+(bsize - 2*i))))); -+ uint16_t value; -+ memcpy(&value, node+(bsize - (2*i)), sizeof(uint16_t)); -+ extent_pos = PED_BE16_TO_CPU(value); -+ extent_key = (HfsPExtentKey*)(node + extent_pos); - extent = (HfsPExtDescriptor*) - (((uint8_t*)extent_key) + sizeof (HfsPExtentKey)); - /* check for obvious error in FS */ -- if (((uint8_t*)extent_key - node < HFS_FIRST_REC) -+ if ((extent_pos < HFS_FIRST_REC) - || ((uint8_t*)extent - node - >= (signed)bsize - - 2 * (signed)(record_number+1))) { -@@ -724,6 +728,7 @@ hfsplus_cache_from_attributes(HfsCPrivateCache* cache, PedFileSystem* fs, - HfsPExtDescriptor* extent; - unsigned int leaf_node, record_number; - unsigned int i, j, size, bsize; -+ uint16_t generic_pos; - - /* attributes file is facultative */ - if (!priv_data->attributes_file->sect_nb) -@@ -751,15 +756,15 @@ hfsplus_cache_from_attributes(HfsCPrivateCache* cache, PedFileSystem* fs, - record_number = PED_BE16_TO_CPU (desc->rec_nb); - for (i = 1; i <= record_number; i++) { - unsigned int skip; -- generic_key = (HfsPPrivateGenericKey*) -- (node + PED_BE16_TO_CPU(*((uint16_t *) -- (node+(bsize - 2*i))))); -+ uint16_t value; -+ memcpy(&value, node+(bsize - (2*i)), sizeof(uint16_t)); -+ generic_pos = PED_BE16_TO_CPU(value); -+ generic_key = (HfsPPrivateGenericKey*)(node + generic_pos); - skip = ( 2 + PED_BE16_TO_CPU (generic_key->key_length) - + 1 ) & ~1; -- fork_ext_data = (HfsPForkDataAttr*) -- (((uint8_t*)generic_key) + skip); -+ fork_ext_data = (HfsPForkDataAttr*)(node+generic_pos+skip); - /* check for obvious error in FS */ -- if (((uint8_t*)generic_key - node < HFS_FIRST_REC) -+ if ((generic_pos < HFS_FIRST_REC) - || ((uint8_t*)fork_ext_data - node - >= (signed) bsize - - 2 * (signed)(record_number+1))) { --- -2.26.2 - diff --git a/0039-fs-r-fat-Remove-disabled-code.patch b/0039-fs-r-fat-Remove-disabled-code.patch deleted file mode 100644 index a6528b1..0000000 --- a/0039-fs-r-fat-Remove-disabled-code.patch +++ /dev/null @@ -1,350 +0,0 @@ -From d2cc30120427394f6eaaa60acfbe647fb82a9762 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 20 Nov 2020 13:21:25 -0800 -Subject: [PATCH 39/42] fs/r/fat: Remove disabled code - ---- - libparted/fs/r/fat/count.c | 83 ----------------- - libparted/fs/r/fat/fat.c | 175 ------------------------------------ - libparted/fs/r/fat/resize.c | 17 ---- - 3 files changed, 275 deletions(-) - -diff --git a/libparted/fs/r/fat/count.c b/libparted/fs/r/fat/count.c -index 2b65e72..51e1aa2 100644 ---- a/libparted/fs/r/fat/count.c -+++ b/libparted/fs/r/fat/count.c -@@ -27,66 +27,6 @@ - - #ifndef DISCOVER_ONLY - --#if 0 --/* extremely ugly hack: stick everything that obviously isn't an unmovable file -- * in here. Note: DAT is a bit dubious. Unfortunately, it's used by the -- * registry, so it'll be all over the place :-( -- */ --static char* movable_extensions[] = { -- "", -- "1ST", -- "AVI", -- "BAK", "BAT", "BMP", -- "CFG", "COM", "CSS", -- "DAT", "DLL", "DOC", "DRV", -- "EXE", -- "FAQ", "FLT", "FON", -- "GID", "GIF", -- "HLP", "HTT", "HTM", -- "ICO", "INI", -- "JPG", -- "LNK", "LOG", -- "KBD", -- "ME", "MID", "MSG", -- "OCX", "OLD", -- "PIF", "PNG", "PRV", -- "RTF", -- "SCR", "SYS", -- "TMP", "TTF", "TXT", -- "URL", -- "WAV", -- "VBX", "VOC", "VXD", -- NULL --}; -- --static char* --get_extension (char* file_name) --{ -- char* ext; -- -- ext = strrchr (file_name, '.'); -- if (!ext) -- return ""; -- if (strchr (ext, '\\')) -- return ""; -- return ext + 1; --} -- --static int --is_movable_system_file (char* file_name) --{ -- char* ext = get_extension (file_name); -- int i; -- -- for (i = 0; movable_extensions [i]; i++) { -- if (strcasecmp (ext, movable_extensions [i]) == 0) -- return 1; -- } -- -- return 0; --} --#endif /* 0 */ -- - /* - prints out the sequence of clusters for a given file chain, beginning - at start_cluster. -@@ -248,29 +188,6 @@ flag_traverse_dir (FatTraverseInfo* trav_info) { - print_chain (fs, first_cluster); - #endif - --#if 0 -- if (fat_dir_entry_is_system_file (this_entry) -- && !is_movable_system_file (file_name)) { -- PedExceptionOption ex_status; -- ex_status = ped_exception_throw ( -- PED_EXCEPTION_WARNING, -- PED_EXCEPTION_IGNORE_CANCEL, -- _("The file %s is marked as a system file. " -- "This means moving it could cause some " -- "programs to stop working."), -- file_name); -- -- switch (ex_status) { -- case PED_EXCEPTION_CANCEL: -- return 0; -- -- case PED_EXCEPTION_UNHANDLED: -- ped_exception_catch (); -- case PED_EXCEPTION_IGNORE: -- } -- } --#endif /* 0 */ -- - if (fat_dir_entry_is_directory (this_entry)) { - if (!flag_traverse_fat (fs, file_name, first_cluster, - FAT_FLAG_DIRECTORY, size)) -diff --git a/libparted/fs/r/fat/fat.c b/libparted/fs/r/fat/fat.c -index ad57d36..0b2fee9 100644 ---- a/libparted/fs/r/fat/fat.c -+++ b/libparted/fs/r/fat/fat.c -@@ -613,68 +613,6 @@ fat_get_resize_constraint (const PedFileSystem* fs) - return fat_get_copy_constraint (fs, fs->geom->dev); - } - --/* FIXME: fat_calc_sizes() needs to say "too big" or "too small", or -- * something. This is a really difficult (maths) problem to do -- * nicely... -- * So, this algorithm works if dev->length / 2 is a valid fat_type -- * size. (Which is how I got the magic numbers below) -- */ --#if 0 --/* returns: -1 too small, 0 ok, 1 too big */ --static int --_test_create_size (PedSector length, FatType fat_type, -- PedSector cluster_sectors, PedSector cluster_count) --{ -- PedSector rootdir_sectors; -- PedSector _cluster_sectors; -- FatCluster _cluster_count; -- PedSector _fat_size; -- -- rootdir_sectors = (fat_type == FAT_TYPE_FAT16) ? 16 : 0; -- -- if (!fat_calc_sizes (length, 0, fat_type, rootdir_sectors, -- &_cluster_sectors, &_cluster_count, &_fat_size)) -- return -1; // XXX: doesn't work... can't see a better way! -- -- if (_cluster_sectors < cluster_sectors) -- return -1; -- if (_cluster_sectors > cluster_sectors) -- return 1; -- -- if (_cluster_count < cluster_count) -- return -1; -- if (_cluster_count > cluster_count) -- return 1; -- -- return 0; --} -- --static PedSector --_get_create_size (PedSector upper_bound, FatType fat_type, -- PedSector cluster_sectors, FatCluster cluster_count) --{ -- PedSector min_length = 0; -- PedSector max_length = upper_bound; -- PedSector length; -- -- while (1) { -- length = (min_length + max_length) / 2; -- switch (_test_create_size (length, fat_type, cluster_sectors, -- cluster_count)) { -- case -1: min_length = length; break; -- case 0: return length; -- case 1: max_length = length; break; -- } -- /* hack... won't always be able to get max cluster count -- * with max cluster size, etc. */ -- if (max_length - min_length == 1) -- return min_length; -- } -- -- return 0; /* shut gcc up */ --} --#endif -- - PedConstraint* - fat_get_create_constraint_fat16 (const PedDevice* dev) - { -@@ -685,19 +623,8 @@ fat_get_create_constraint_fat16 (const PedDevice* dev) - if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1)) - return NULL; - --#if 0 -- min_size = _get_create_size (dev->length, FAT_TYPE_FAT16, -- fat_min_cluster_size (FAT_TYPE_FAT16), -- fat_min_cluster_count (FAT_TYPE_FAT16)); -- max_size = _get_create_size (dev->length, FAT_TYPE_FAT16, -- fat_max_cluster_size (FAT_TYPE_FAT16), -- fat_max_cluster_count (FAT_TYPE_FAT16)); -- if (!min_size) -- return NULL; --#else - min_size = 65794; - max_size = 2097153; --#endif - - return ped_constraint_new ( - ped_alignment_any, ped_alignment_any, -@@ -714,15 +641,7 @@ fat_get_create_constraint_fat32 (const PedDevice* dev) - if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1)) - return NULL; - --#if 0 -- min_size = _get_create_size (dev->length, FAT_TYPE_FAT32, -- fat_min_cluster_size (FAT_TYPE_FAT32), -- fat_min_cluster_count (FAT_TYPE_FAT32)); -- if (!min_size) -- return NULL; --#else - min_size = 525224; --#endif - - return ped_constraint_new ( - ped_alignment_any, ped_alignment_any, -@@ -730,97 +649,3 @@ fat_get_create_constraint_fat32 (const PedDevice* dev) - min_size, dev->length); - } - #endif /* !DISCOVER_ONLY */ -- --#if 0 -- --static PedFileSystemOps fat16_ops = { -- probe: fat_probe_fat16, --#ifndef DISCOVER_ONLY -- clobber: fat_clobber, -- open: fat_open, -- create: fat_create_fat16, -- close: fat_close, -- check: fat_check, -- resize: fat_resize, -- copy: fat_copy, -- get_create_constraint: fat_get_create_constraint_fat16, -- get_resize_constraint: fat_get_resize_constraint, -- get_copy_constraint: fat_get_copy_constraint, --#else /* !DISCOVER_ONLY */ -- clobber: NULL, -- open: NULL, -- create: NULL, -- close: NULL, -- check: NULL, -- resize: NULL, -- copy: NULL, -- get_create_constraint: NULL, -- get_resize_constraint: NULL, -- get_copy_constraint: NULL, --#endif /* !DISCOVER_ONLY */ --}; -- --static PedFileSystemOps fat32_ops = { -- probe: fat_probe_fat32, --#ifndef DISCOVER_ONLY -- clobber: fat_clobber, -- open: fat_open, -- create: fat_create_fat32, -- close: fat_close, -- check: fat_check, -- resize: fat_resize, -- copy: fat_copy, -- get_create_constraint: fat_get_create_constraint_fat32, -- get_resize_constraint: fat_get_resize_constraint, -- get_copy_constraint: fat_get_copy_constraint, --#else /* !DISCOVER_ONLY */ -- clobber: NULL, -- open: NULL, -- create: NULL, -- close: NULL, -- check: NULL, -- resize: NULL, -- copy: NULL, -- get_create_constraint: NULL, -- get_resize_constraint: NULL, -- get_copy_constraint: NULL, --#endif /* !DISCOVER_ONLY */ --}; -- --#define FAT_BLOCK_SIZES ((int[2]){512, 0}) -- --PedFileSystemType fat16_type = { -- next: NULL, -- ops: &fat16_ops, -- name: "fat16", -- block_sizes: FAT_BLOCK_SIZES --}; -- --PedFileSystemType fat32_type = { -- next: NULL, -- ops: &fat32_ops, -- name: "fat32", -- block_sizes: FAT_BLOCK_SIZES --}; -- --void --ped_file_system_fat_init () --{ -- if (sizeof (FatBootSector) != 512) { -- ped_exception_throw (PED_EXCEPTION_BUG, PED_EXCEPTION_CANCEL, -- _("GNU Parted was miscompiled: the FAT boot sector " -- "should be 512 bytes. FAT support will be disabled.")); -- } else { -- ped_file_system_type_register (&fat16_type); -- ped_file_system_type_register (&fat32_type); -- } --} -- --void --ped_file_system_fat_done () --{ -- ped_file_system_type_unregister (&fat16_type); -- ped_file_system_type_unregister (&fat32_type); --} -- --#endif -diff --git a/libparted/fs/r/fat/resize.c b/libparted/fs/r/fat/resize.c -index 71113d4..2a0955d 100644 ---- a/libparted/fs/r/fat/resize.c -+++ b/libparted/fs/r/fat/resize.c -@@ -446,23 +446,6 @@ fat_construct_new_fat (FatOpContext* ctx) - fat_table_set (new_fs_info->fat, new_cluster, new_next_cluster); - } - --#if 0 --#ifdef PED_VERBOSE -- for (old_cluster=2; old_cluster < old_fs_info->cluster_count+2; -- old_cluster++) { -- if (fat_table_is_available (old_fs_info->fat, old_cluster)) -- continue; -- -- printf ("%d->%d\t(next: %d->%d)\n", -- old_cluster, -- ctx->remap [old_cluster], -- fat_table_get (old_fs_info->fat, old_cluster), -- fat_table_get (new_fs_info->fat, -- ctx->remap [old_cluster])); -- } --#endif /* PED_VERBOSE */ --#endif -- - if (old_fs_info->fat_type == FAT_TYPE_FAT32 - && new_fs_info->fat_type == FAT_TYPE_FAT32) { - new_fs_info->root_cluster --- -2.26.2 - diff --git a/0040-fs-r-hfs-Remove-disabled-code.patch b/0040-fs-r-hfs-Remove-disabled-code.patch deleted file mode 100644 index fcbea96..0000000 --- a/0040-fs-r-hfs-Remove-disabled-code.patch +++ /dev/null @@ -1,228 +0,0 @@ -From 0d5f047b2855f3d39fa3afe6ec2a6129d18ddf33 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 20 Nov 2020 13:22:52 -0800 -Subject: [PATCH 40/42] fs/r/hfs: Remove disabled code - ---- - libparted/fs/r/hfs/hfs.c | 194 --------------------------------------- - 1 file changed, 194 deletions(-) - -diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c -index 09899da..1da093c 100644 ---- a/libparted/fs/r/hfs/hfs.c -+++ b/libparted/fs/r/hfs/hfs.c -@@ -59,28 +59,6 @@ static PedFileSystemType hfsplus_type; - - /* ----- HFS ----- */ - --#if 0 --/* This is a very unundoable operation */ --/* Maybe I shouldn't touch the alternate MDB ? */ --/* Anyway clobber is call before other fs creation */ --/* So this is a non-issue */ --static int --hfs_clobber (PedGeometry* geom) --{ -- uint8_t buf[PED_SECTOR_SIZE_DEFAULT]; -- -- memset (buf, 0, PED_SECTOR_SIZE_DEFAULT); -- -- /* destroy boot blocks, mdb, alternate mdb ... */ -- return (!!ped_geometry_write (geom, buf, 0, 1)) & -- (!!ped_geometry_write (geom, buf, 1, 1)) & -- (!!ped_geometry_write (geom, buf, 2, 1)) & -- (!!ped_geometry_write (geom, buf, geom->length - 2, 1)) & -- (!!ped_geometry_write (geom, buf, geom->length - 1, 1)) & -- (!!ped_geometry_sync (geom)); --} --#endif -- - PedFileSystem * - hfs_open (PedGeometry* geom) - { -@@ -341,44 +319,6 @@ hfs_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer) - #include "reloc_plus.h" - #include "journal.h" - --#if 0 --static int --hfsplus_clobber (PedGeometry* geom) --{ -- unsigned int i = 1; -- uint8_t buf[PED_SECTOR_SIZE_DEFAULT]; -- HfsMasterDirectoryBlock *mdb; -- -- mdb = (HfsMasterDirectoryBlock *) buf; -- -- if (!ped_geometry_read (geom, buf, 2, 1)) -- return 0; -- -- if (PED_BE16_TO_CPU (mdb->signature) == HFS_SIGNATURE) { -- /* embedded hfs+ */ -- PedGeometry *embedded; -- -- i = PED_BE32_TO_CPU(mdb->block_size) / PED_SECTOR_SIZE_DEFAULT; -- embedded = ped_geometry_new ( -- geom->dev, -- (PedSector) geom->start -- + PED_BE16_TO_CPU (mdb->start_block) -- + (PedSector) PED_BE16_TO_CPU ( -- mdb->old_new.embedded.location.start_block ) * i, -- (PedSector) PED_BE16_TO_CPU ( -- mdb->old_new.embedded.location.block_count ) * i ); -- if (!embedded) i = 0; -- else { -- i = hfs_clobber (embedded); -- ped_geometry_destroy (embedded); -- } -- } -- -- /* non-embedded or envelop destroy as hfs */ -- return ( hfs_clobber (geom) && i ); --} --#endif -- - int - hfsplus_close (PedFileSystem *fs) - { -@@ -1224,137 +1164,3 @@ hfsplus_extract (PedFileSystem* fs, PedTimer* timer) - #endif /* HFS_EXTRACT_FS */ - - #endif /* !DISCOVER_ONLY */ -- --#if 0 --static PedFileSystemOps hfs_ops = { -- probe: hfs_probe, --#ifndef DISCOVER_ONLY -- clobber: hfs_clobber, -- open: hfs_open, -- create: NULL, -- close: hfs_close, --#ifndef HFS_EXTRACT_FS -- check: NULL, --#else -- check: hfs_extract, --#endif -- copy: NULL, -- resize: hfs_resize, -- get_create_constraint: NULL, -- get_resize_constraint: hfs_get_resize_constraint, -- get_copy_constraint: NULL, --#else /* DISCOVER_ONLY */ -- clobber: NULL, -- open: NULL, -- create: NULL, -- close: NULL, -- check: NULL, -- copy: NULL, -- resize: NULL, -- get_create_constraint: NULL, -- get_resize_constraint: NULL, -- get_copy_constraint: NULL, --#endif /* DISCOVER_ONLY */ --}; -- --static PedFileSystemOps hfsplus_ops = { -- probe: hfsplus_probe, --#ifndef DISCOVER_ONLY -- clobber: hfsplus_clobber, -- open: hfsplus_open, -- create: NULL, -- close: hfsplus_close, --#ifndef HFS_EXTRACT_FS -- check: NULL, --#else -- check: hfsplus_extract, --#endif -- copy: NULL, -- resize: hfsplus_resize, -- get_create_constraint: NULL, -- get_resize_constraint: hfsplus_get_resize_constraint, -- get_copy_constraint: NULL, --#else /* DISCOVER_ONLY */ -- clobber: NULL, -- open: NULL, -- create: NULL, -- close: NULL, -- check: NULL, -- copy: NULL, -- resize: NULL, -- get_create_constraint: NULL, -- get_resize_constraint: NULL, -- get_copy_constraint: NULL, --#endif /* DISCOVER_ONLY */ --}; -- --static PedFileSystemOps hfsx_ops = { -- probe: hfsx_probe, --#ifndef DISCOVER_ONLY -- clobber: hfs_clobber, /* NOT hfsplus_clobber ! -- HFSX can't be embedded */ -- open: hfsplus_open, -- create: NULL, -- close: hfsplus_close, --#ifndef HFS_EXTRACT_FS -- check: NULL, --#else -- check: hfsplus_extract, --#endif -- copy: NULL, -- resize: hfsplus_resize, -- get_create_constraint: NULL, -- get_resize_constraint: hfsplus_get_resize_constraint, -- get_copy_constraint: NULL, --#else /* DISCOVER_ONLY */ -- clobber: NULL, -- open: NULL, -- create: NULL, -- close: NULL, -- check: NULL, -- copy: NULL, -- resize: NULL, -- get_create_constraint: NULL, -- get_resize_constraint: NULL, -- get_copy_constraint: NULL, --#endif /* DISCOVER_ONLY */ --}; -- -- --static PedFileSystemType hfs_type = { -- next: NULL, -- ops: &hfs_ops, -- name: "hfs", -- block_sizes: HFS_BLOCK_SIZES --}; -- --static PedFileSystemType hfsplus_type = { -- next: NULL, -- ops: &hfsplus_ops, -- name: "hfs+", -- block_sizes: HFSP_BLOCK_SIZES --}; -- --static PedFileSystemType hfsx_type = { -- next: NULL, -- ops: &hfsx_ops, -- name: "hfsx", -- block_sizes: HFSX_BLOCK_SIZES --}; -- --void --ped_file_system_hfs_init () --{ -- ped_file_system_type_register (&hfs_type); -- ped_file_system_type_register (&hfsplus_type); -- ped_file_system_type_register (&hfsx_type); --} -- --void --ped_file_system_hfs_done () --{ -- ped_file_system_type_unregister (&hfs_type); -- ped_file_system_type_unregister (&hfsplus_type); -- ped_file_system_type_unregister (&hfsx_type); --} --#endif --- -2.26.2 - diff --git a/0041-libparted-Remove-disabled-code.patch b/0041-libparted-Remove-disabled-code.patch deleted file mode 100644 index 42580e8..0000000 --- a/0041-libparted-Remove-disabled-code.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 945b13aed7e9762e00bda1b54e2c18eb3373a31d Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 20 Nov 2020 13:26:31 -0800 -Subject: [PATCH 41/42] libparted: Remove disabled code - ---- - libparted/arch/gnu.c | 40 ---------------------------------------- - libparted/labels/mac.c | 14 -------------- - libparted/labels/pc98.c | 5 ----- - 3 files changed, 59 deletions(-) - -diff --git a/libparted/arch/gnu.c b/libparted/arch/gnu.c -index 321b70a..922b93d 100644 ---- a/libparted/arch/gnu.c -+++ b/libparted/arch/gnu.c -@@ -359,46 +359,6 @@ gnu_close (PedDevice* dev) - dev->dirty = 0; - } - --#if 0 -- if (dev->dirty && dev->boot_dirty && dev->type != PED_DEVICE_FILE) { -- /* ouch! */ -- ped_exception_throw ( -- PED_EXCEPTION_WARNING, -- PED_EXCEPTION_OK, -- _("The partition table cannot be re-read. This means " -- "you need to reboot before mounting any " -- "modified partitions. You also need to reinstall " -- "your boot loader before you reboot (which may " -- "require mounting modified partitions). It is " -- "impossible do both things! So you'll need to " -- "boot off a rescue disk, and reinstall your boot " -- "loader from the rescue disk. Read section 4 of " -- "the Parted User documentation for more " -- "information.")); -- return 1; -- } -- -- if (dev->dirty && dev->type != PED_DEVICE_FILE) { -- ped_exception_throw ( -- PED_EXCEPTION_WARNING, -- PED_EXCEPTION_IGNORE, -- _("The partition table on %s cannot be re-read " -- "(%s). This means the Hurd knows nothing about any " -- "modifications you made. You should reboot your " -- "computer before doing anything with %s."), -- dev->path, strerror (errno), dev->path); -- } -- -- if (dev->boot_dirty && dev->type != PED_DEVICE_FILE) { -- ped_exception_throw ( -- PED_EXCEPTION_WARNING, -- PED_EXCEPTION_OK, -- _("You should reinstall your boot loader before " -- "rebooting. Read section 4 of the Parted User " -- "documentation for more information.")); -- } --#endif -- - return 1; - } - -diff --git a/libparted/labels/mac.c b/libparted/labels/mac.c -index 8980885..af9f4c3 100644 ---- a/libparted/labels/mac.c -+++ b/libparted/labels/mac.c -@@ -560,20 +560,6 @@ _rawpart_analyse (MacRawPartition* raw_part, PedDisk* disk, int num) - mac_part_data->data_region_length - = PED_BE32_TO_CPU (raw_part->data_count); - -- /* boot region - we have no idea what this is for, but Mac OSX -- * seems to put garbage here, and doesn't pay any attention to -- * it afterwards. [clausen, dan burcaw] -- */ --#if 0 -- if (raw_part->boot_start) { -- ped_exception_throw ( -- PED_EXCEPTION_ERROR, -- PED_EXCEPTION_CANCEL, -- _("The boot region doesn't start at the start " -- "of the partition.")); -- goto error_destroy_part; -- } --#endif - mac_part_data->boot_region_length - = PED_BE32_TO_CPU (raw_part->boot_count); - -diff --git a/libparted/labels/pc98.c b/libparted/labels/pc98.c -index 328cd8d..b8993c4 100644 ---- a/libparted/labels/pc98.c -+++ b/libparted/labels/pc98.c -@@ -418,13 +418,8 @@ fill_raw_part (PC98RawPartition* raw_part, const PedPartition* part) - return 0; - } - raw_part->end_cyl = PED_CPU_TO_LE16(c); --#if 0 -- raw_part->end_head = h; -- raw_part->end_sector = s; --#else - raw_part->end_head = 0; - raw_part->end_sector = 0; --#endif - - return 1; - } --- -2.26.2 - diff --git a/0042-libparted-fs-Fix-GCC-warnings-suggesting-pure-for-PE.patch b/0042-libparted-fs-Fix-GCC-warnings-suggesting-pure-for-PE.patch deleted file mode 100644 index acc7497..0000000 --- a/0042-libparted-fs-Fix-GCC-warnings-suggesting-pure-for-PE.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 8df7974ac36fcea82551c3f6990f981b659e2635 Mon Sep 17 00:00:00 2001 -From: "Brian C. Lane" -Date: Fri, 20 Nov 2020 14:08:33 -0800 -Subject: [PATCH 42/42] libparted/fs: Fix GCC warnings suggesting pure for - PED_ASSERT functions - -There was some question about whether or not pure should be used for -functions with PED_ASSERT (or exit) in them. It should be fine, since -the values checked by the ASSERT are passed to the function directly. -Behavior should be exactly the same for the same inputs. ---- - libparted/fs/r/fat/calc.c | 12 ++++++------ - libparted/fs/r/fat/clstdup.c | 4 ++-- - libparted/fs/r/hfs/cache.c | 2 +- - 3 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/libparted/fs/r/fat/calc.c b/libparted/fs/r/fat/calc.c -index 18e0455..26c4d18 100644 ---- a/libparted/fs/r/fat/calc.c -+++ b/libparted/fs/r/fat/calc.c -@@ -369,7 +369,7 @@ fat_is_sector_in_clusters (const PedFileSystem* fs, PedSector sector) - + fs_info->cluster_sectors * fs_info->cluster_count; - } - --FatFragment -+FatFragment _GL_ATTRIBUTE_PURE - fat_cluster_to_frag (const PedFileSystem* fs, FatCluster cluster) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -@@ -379,7 +379,7 @@ fat_cluster_to_frag (const PedFileSystem* fs, FatCluster cluster) - return (cluster - 2) * fs_info->cluster_frags; - } - --FatCluster -+FatCluster _GL_ATTRIBUTE_PURE - fat_frag_to_cluster (const PedFileSystem* fs, FatFragment frag) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -@@ -389,7 +389,7 @@ fat_frag_to_cluster (const PedFileSystem* fs, FatFragment frag) - return frag / fs_info->cluster_frags + 2; - } - --PedSector -+PedSector _GL_ATTRIBUTE_PURE - fat_frag_to_sector (const PedFileSystem* fs, FatFragment frag) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -@@ -399,7 +399,7 @@ fat_frag_to_sector (const PedFileSystem* fs, FatFragment frag) - return frag * fs_info->frag_sectors + fs_info->cluster_offset; - } - --FatFragment -+FatFragment _GL_ATTRIBUTE_PURE - fat_sector_to_frag (const PedFileSystem* fs, PedSector sector) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -@@ -409,7 +409,7 @@ fat_sector_to_frag (const PedFileSystem* fs, PedSector sector) - return (sector - fs_info->cluster_offset) / fs_info->frag_sectors; - } - --PedSector -+PedSector _GL_ATTRIBUTE_PURE - fat_cluster_to_sector (const PedFileSystem* fs, FatCluster cluster) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -@@ -420,7 +420,7 @@ fat_cluster_to_sector (const PedFileSystem* fs, FatCluster cluster) - + fs_info->cluster_offset; - } - --FatCluster -+FatCluster _GL_ATTRIBUTE_PURE - fat_sector_to_cluster (const PedFileSystem* fs, PedSector sector) - { - FatSpecific* fs_info = FAT_SPECIFIC (fs); -diff --git a/libparted/fs/r/fat/clstdup.c b/libparted/fs/r/fat/clstdup.c -index 7456f60..cfd1552 100644 ---- a/libparted/fs/r/fat/clstdup.c -+++ b/libparted/fs/r/fat/clstdup.c -@@ -126,7 +126,7 @@ fetch_fragments (FatOpContext* ctx) - - /* finds the first fragment that is not going to get overwritten (that needs to - get read in) */ --static FatFragment -+static FatFragment _GL_ATTRIBUTE_PURE - get_first_underlay (const FatOpContext* ctx, int first, int last) - { - int old; -@@ -147,7 +147,7 @@ get_first_underlay (const FatOpContext* ctx, int first, int last) - - /* finds the last fragment that is not going to get overwritten (that needs to - get read in) */ --static FatFragment -+static FatFragment _GL_ATTRIBUTE_PURE - get_last_underlay (const FatOpContext* ctx, int first, int last) - { - int old; -diff --git a/libparted/fs/r/hfs/cache.c b/libparted/fs/r/hfs/cache.c -index 5e5b071..fc11fe9 100644 ---- a/libparted/fs/r/hfs/cache.c -+++ b/libparted/fs/r/hfs/cache.c -@@ -173,7 +173,7 @@ hfsc_cache_add_extent(HfsCPrivateCache* cache, uint32_t start, uint32_t length, - return ext; - } - --HfsCPrivateExtent* -+HfsCPrivateExtent* _GL_ATTRIBUTE_PURE - hfsc_cache_search_extent(HfsCPrivateCache* cache, uint32_t start) - { - HfsCPrivateExtent* ret; --- -2.26.2 - diff --git a/parted.spec b/parted.spec index c61e125..8d352fe 100644 --- a/parted.spec +++ b/parted.spec @@ -4,7 +4,7 @@ Summary: The GNU disk partition manipulation program Name: parted Version: 3.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ URL: http://www.gnu.org/software/parted @@ -13,6 +13,13 @@ Source1: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig Source2: pubkey.phillip.susi Source3: pubkey.brian.lane +# Upstream patches since v3.4 release +Patch0001: 0001-parted-add-fix-to-fix-in-script-mode.patch +Patch0002: 0002-doc-Document-fix-flag.patch +Patch0003: 0003-tests-Add-tests-for-fix.patch +Patch0004: 0004-tests-Fix-test-t1700-probe-fs.patch +Patch0005: 0005-tests-Fix-t9041-undetected-in-use-16th-partition.patch + BuildRequires: gcc BuildRequires: e2fsprogs-devel BuildRequires: readline-devel @@ -115,6 +122,9 @@ make check %changelog +* Wed Feb 03 2021 Brian C. Lane - 3.4-2 +- Add --fix support from upstream + * Wed Jan 27 2021 Brian C. Lane - 3.4-1 - New stable upstream release v3.4 @@ -163,245 +173,3 @@ make check - New upstream release v3.3 Includes the DASD virtio-blk fix. - Dropping pre-3.2 changelog entries - -* Wed Oct 02 2019 Brian C. Lane - 3.2.153-2 -- libparted/s390: Re-enabled virtio-attached DASD heuristics - Fixes DASD backed virtblk devices - -* Mon Aug 12 2019 Brian C. Lane - 3.2.153-1 -- New upstream ALPHA release v3.2.153 -- Includes all patches except the python2 -> python3 change for test helpers - -* Fri Jul 26 2019 Fedora Release Engineering - 3.2-43 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Wed Apr 24 2019 Björn Esser - 3.2-42 -- Remove hardcoded gzip suffix from GNU info pages - -* Tue Apr 09 2019 Brian C. Lane - 3.2-41 -- Add fix and tests for nilfs2 sigsegv - -* Fri Mar 01 2019 Brian C. Lane - 3.2-40 -- Run the CI tests using rpmbuild -- t6000-dm: Stop using private lvm root - -* Sun Feb 17 2019 Igor Gnatenko - 3.2-39 -- Rebuild for readline 8.0 - -* Thu Jan 31 2019 Brian C. Lane - 3.2-38 -- Add missing patches from Wang Dong -- fix crash due to improper partition number (dongdwdw) -- fix wrong error label jump in mkpart (dongdwdw) -- clean the disk information when commands fail (dongdwdw) -- Remove PED_ASSERT from ped_partition_set_name (bcl) -- Added support for Windows recovery partition (Hans-Joachim.Baader) - -* Tue Oct 16 2018 Brian C. Lane - 3.2-37 -- Read NVMe model names from sysfs (dann.frazier) -- Fix warnings from GCC 7's -Wimplicit-fallthrough (dann.frazier) -- ped_unit_get_name: Resolve conflicting attributes 'const' and 'pure' (dann.frazier) -- Add udf to t1700-probe-fs and to the manpage (bcl) -- libparted: Add support for MBR id, GPT GUID and detection of UDF filesystem (pali.rohar) -- Fix potential command line buffer overflow (xu.simon) -- t6100-mdraid-partitions: Use v0.90 metadata for the test (bcl) -- parted.c: Make sure dev_name is freed (bcl) -- parted.c: Always free peek_word (bcl) -- Fix the length of several strncpy calls (bcl) - -* Thu Jul 19 2018 Brian C. Lane - 3.2-36 -- drop ldconfig, it no longer needs to be called on un/install (bcl) -- Fix msdos-overlap py3 conversion (bcl) - -* Fri Jul 13 2018 Fedora Release Engineering - 3.2-35 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Wed Jun 27 2018 Brian C. Lane - 3.2-34 -- Use python3 in buildroot -- Add make to BuildRequires -- Switch gpt-header-move and msdos-overlap to python3 (bcl) -- Modify gpt-header-move and msdos-overlap to work with py2 or py3 (bcl) -- Fix atari label false positives (psusi) -- Lift 512 byte restriction on fat resize (psusi) -- build: Remove unused traces of dynamic loading (cjwatson) -- Fix resizepart iec unit end sector (psusi) -- mkpart: Allow negative start value when FS-TYPE is not given (mail) -- Fix set and disk_set to not crash when no flags are supported (psusi) -- tests: fix t6100-mdraid-partitions (psusi) -- Fix make check (psusi) -- linux: Include for major() macro. (rjones) - -* Thu Jun 07 2018 Brian C. Lane - 3.2-33 -- Use gpg2 for signature checking - -* Sat Mar 24 2018 Richard W.M. Jones - 3.2-32 -- Fix for missing major/minor() macros in glibc 2.27. - -* Mon Feb 19 2018 Brian C. Lane - 3.2-31 -- Add gcc BuildRequires for future minimal buildroot support -- Remove %%clean section - -* Thu Feb 08 2018 Fedora Release Engineering - 3.2-30 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Tue Dec 19 2017 Brian C. Lane - 3.2-29 -- Add support for NVDIMM devices (sparschauer) -- libparted/labels: link with libiconv if needed (arnout) - -* Mon Jul 31 2017 Brian C. Lane - 3.2-28 -- atari.c: Drop xlocale.h - Resloves: rhbz#1476934 - -* Thu Jul 27 2017 Fedora Release Engineering - 3.2-27 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Tue Jun 06 2017 Brian C. Lane - 3.2-26 -- libparted: Fix udev cookie leak in _dm_resize_partition (bcl) - Resolves: rhbz#1455564 - -* Mon May 01 2017 Brian C. Lane - 3.2-25 -+ Updating to upstream patches -- tests/t1701-rescue-fs wait for the device to appear. (bcl) -- Increase timeout for rmmod scsi_debug and make it a framework failure (bcl) -- libparted/dasd: add test cases for the new fdasd functions (dongdwdw) -- libparted/dasd: add an exception for changing DASD-LDL partition table - (dongdwdw) -- libpartd/dasd: improve flag processing for DASD-LDL (dongdwdw) -- parted/ui: remove unneccesary information of command line (dongdwdw) -- parted: check the name of partition first when to name a partition (dongdwdw) -- Add support for RAM drives (sparschauer) -- Fix crash when localized (psusi) -- libparted: Fix typo in hfs error message (sebras) -- libparted: Fix MacOS boot support (laurent) -- mac: copy partition type and name correctly (saproj) -- libparted: Add support for atari partition tables (glaubitz) -- libparted:tests: Move get_sector_size() to common.c (glaubitz) -- tests: Update t0220 and t0280 for the swap flag. (bcl) -- libparted: set swap flag on GPT partitions (aschnell) -- libparted/dasd: add test cases for the new fdasd functions (dongdwdw) -- libparted/dasd: add new fdasd functions (dongdwdw) -- libparted/dasd: update and improve fdasd functions (dongdwdw) -- libparted/dasd: unify vtoc handling for cdl/ldl (dongdwdw) -- libparted: Don't warn if no HDIO_GET_IDENTITY ioctl (sparschauer) -- libparted: Fix starting CHS in protective MBR (petr.uzel) -- tests: Stop timing t9040 (#1172675) (bcl) - -* Sat Feb 11 2017 Fedora Release Engineering - 3.2-24 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Thu Jan 12 2017 Igor Gnatenko - 3.2-23 -- Rebuild for readline 7.x - -* 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) - -* Wed Jun 15 2016 Brian C. Lane - 3.2-21 -- Cleanup mkpart manpage entry (#1183077) -- doc: Add information about quoting - -* 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 - -* 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) - -* Tue Mar 29 2016 Brian C. Lane 3.2-18 -- Use BLKSSZGET to get device sector size in _device_probe_geometry() - -* 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 - -* 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 Feb 09 2016 Brian C. Lane 3.2-15 -- fdasd.c Safeguard against geometry misprobing.patch (#1305931) - -* Thu Feb 04 2016 Fedora Release Engineering - 3.2-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Thu Oct 29 2015 Brian C. Lane 3.2-13 -- parted: fix build error on s390 - -* Tue Oct 27 2015 Brian C. Lane 3.2-12 -- dasd: enhance device probing -- fdasd: geometry handling updated from upstream s390-tools - -* 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 Jul 13 2015 Brian C. Lane 3.2-10 -- parted: Fix crash with name command and no disklabel (#1226067) - -* Thu Jun 18 2015 Fedora Release Engineering - 3.2-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* 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) - -* Tue Apr 28 2015 Brian C. Lane 3.2-7 -- Add python2 as a BuildRequires, used in some of the tests - -* 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) - -* Fri Nov 07 2014 Brian C. Lane 3.2-5 -- tests: Change minimum size to 256MiB for t1700-probe-fs - -* 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) - -* Sun Aug 17 2014 Fedora Release Engineering - 3.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Wed Aug 13 2014 Brian C. Lane 3.2-2 -- Use a better patch to find the UTF8 locale for t0251 - -* 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