Upgraded parted from 3.4 to 3.6

This commit is contained in:
dslm4515
2023-11-01 16:53:22 -05:00
parent f5226034f7
commit 6e812734b2
6 changed files with 24 additions and 138 deletions

View File

@ -1,10 +0,0 @@
--- parted-3.1.orig/libparted/fs/xfs/platform_defs.h
+++ parted-3.1/libparted/fs/xfs/platform_defs.h
@@ -35,6 +35,7 @@
#define __XFS_PLATFORM_DEFS_H__
#include <stdio.h>
+#include <fcntl.h>
#include <stdarg.h>
#include <assert.h>
#include <endian.h>

View File

@ -1,69 +0,0 @@
--- parted-3.2/tests/t0205-gpt-list-clobbers-pmbr.sh.old 2014-06-15 18:17:43.000000000 +0000
+++ parted-3.2/tests/t0205-gpt-list-clobbers-pmbr.sh 2019-10-04 23:36:26.560000000 +0000
@@ -37,7 +37,7 @@
# Write non-NUL bytes all over the MBR, so we're likely to see any change.
# However, be careful to leave the type of the first partition, 0xEE,
# as well as the final two magic bytes.
-printf '%0450d\xee%059d\x55\xaa' 0 0 | dd of=$dev count=1 conv=notrunc || fail=1
+printf '%0450d\356%059d\125\252' 0 0 | dd of=$dev count=1 conv=notrunc || fail=1
dd if=$dev of=before count=1 || fail=1
--- parted-3.2/tests/t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh.old 2014-06-15 18:17:43.000000000 +0000
+++ parted-3.2/tests/t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh 2019-10-04 23:37:08.760000000 +0000
@@ -33,7 +33,7 @@
# Write non-NUL bytes all over the MBR, so we're likely to see any change.
# However, be careful to leave the type of the first partition, 0xEE,
# as well as the final two magic bytes.
-printf '%0450d\xee%059d\x55\xaa' 0 0 | dd of=$dev count=1 conv=notrunc || fail=1
+printf '%0450d\356%059d\125\252' 0 0 | dd of=$dev count=1 conv=notrunc || fail=1
dd if=$dev of=before count=1 || fail=1
--- parted-3.2/tests/t-local.sh.old 2014-06-15 18:17:43.000000000 +0000
+++ parted-3.2/tests/t-local.sh 2019-10-04 23:48:32.670000000 +0000
@@ -135,7 +135,7 @@
peek_()
{
case $# in 2) ;; *) echo "usage: peek_ FILE 0_BASED_OFFSET" >&2; exit 1;; esac
- case $2 in *[^0-9]*) echo "peek_: invalid offset: $2" >&2; exit 1 ;; esac
+ case $2 in *[!0-9]*) echo "peek_: invalid offset: $2" >&2; exit 1 ;; esac
dd if="$1" bs=1 skip="$2" count=1
}
@@ -143,7 +143,7 @@
{
case $# in 3) ;; *) echo "usage: poke_ FILE 0_BASED_OFFSET BYTE" >&2; exit 1;;
esac
- case $2 in *[^0-9]*) echo "poke_: invalid offset: $2" >&2; exit 1 ;; esac
+ case $2 in *[!0-9]*) echo "poke_: invalid offset: $2" >&2; exit 1 ;; esac
case $3 in ?) ;; *) echo "poke_: invalid byte: '$3'" >&2; exit 1 ;; esac
printf %s "$3" | dd of="$1" bs=1 seek="$2" count=1 conv=notrunc
}
@@ -152,7 +152,7 @@
gpt1_pte_name_offset_()
{
local ss=$1
- case $ss in *[^0-9]*) echo "$0: invalid sector size: $ss">&2; return 1;; esac
+ case $ss in *[!0-9]*) echo "$0: invalid sector size: $ss">&2; return 1;; esac
expr $ss \* 2 + 56
return 0
}
@@ -164,7 +164,7 @@
case $# in 2) ;; *) echo "$0: expected 2 args, got $#" >&2; return 1;; esac
local dev=$1
local ss=$2
- case $ss in *[^0-9]*) echo "$0: invalid sector size: $ss">&2; return 1;; esac
+ case $ss in *[!0-9]*) echo "$0: invalid sector size: $ss">&2; return 1;; esac
# get the first byte of the name
local orig_pte_name_byte
@@ -185,7 +185,7 @@
case $# in 3) ;; *) echo "$0: expected 2 args, got $#" >&2; return 1;; esac
local dev=$1
local ss=$2
- case $ss in *[^0-9]*) echo "$0: invalid sector size: $ss">&2; return 1;; esac
+ case $ss in *[!0-9]*) echo "$0: invalid sector size: $ss">&2; return 1;; esac
local orig_byte=$3
poke_ $dev $(gpt1_pte_name_offset_ $ss) "$orig_byte" || return 1
}

View File

@ -1,10 +0,0 @@
--- parted-3.2/libparted/arch/linux.c
+++ parted-3.2/libparted/arch/linux.c
@@ -37,6 +37,7 @@
#include <dirent.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/utsname.h> /* for uname() */
#include <scsi/scsi.h>

View File

@ -1,42 +0,0 @@
mkpart syntax recently changed, tests do not reflect that.
--- parted-3.2/tests/t5000-tags.sh.old 2014-06-15 18:17:43.000000000 +0000
+++ parted-3.2/tests/t5000-tags.sh 2017-08-19 18:55:03.207451920 +0000
@@ -48,7 +48,7 @@
compare exp out || fail=1
# add a partition
-parted -s $dev u s mkpart name1 ${start_sector} ${end_sector} >out 2>&1 \
+parted -s $dev u s mkpart primary ${start_sector} ${end_sector} name 1 name1 >out 2>&1 \
|| fail=1
# print the table before modification
--- parted-3.2/tests/t0208-mkpart-end-in-IEC.sh.old 2014-06-15 18:17:43.000000000 +0000
+++ parted-3.2/tests/t0208-mkpart-end-in-IEC.sh 2017-08-19 20:05:19.650875813 +0000
@@ -25,22 +25,22 @@
dd if=/dev/null of=$dev bs=1M seek=$n_mbs || fail=1
# create 1st partition
-parted --align=none -s $dev mklabel gpt mkpart p1 1MiB 2MiB > err 2>&1 || fail=1
+parted --align=none -s $dev mklabel gpt mkpart primary 1MiB 2MiB name 1 p1 > err 2>&1 || fail=1
compare /dev/null err || fail=1 # expect no output
#parted -m -s $dev u s p > exp || fail=1
# create 2nd partition - they should not overlap
# this time specify default unit
-parted --align=none -s $dev unit MiB mkpart p2 2 3 > err 2>&1 || fail=1
+parted --align=none -s $dev unit MiB mkpart primary 2 3 name 2 p2 > err 2>&1 || fail=1
compare /dev/null err || fail=1 # expect no output
# create 3rd partition - expect no overlap
# specify default unit, but explicitly override it
-parted --align=none -s $dev unit TB mkpart p3 3MiB 4MiB > err 2>&1 || fail=1
+parted --align=none -s $dev unit TB mkpart primary 3MiB 4MiB name 3 p3 > err 2>&1 || fail=1
compare /dev/null err || fail=1 # expect no output
# Specify default unit of MiB, yet use explicit ending sector number.
-parted --align=none -s $dev unit MiB mkpart p4 4MiB 10239s > err 2>&1 || fail=1
+parted --align=none -s $dev unit MiB mkpart primary 4MiB 10239s name 4 p4 > err 2>&1 || fail=1
compare /dev/null err || fail=1 # expect no output
# check boundaries of the partitions

View File

@ -0,0 +1,19 @@
commit 77035a30511f9dac9e9312381aeadf365d4fc06a
Author: q66 <q66@chimera-linux.org>
Date: Fri Jun 30 13:30:42 2023 +0200
libparted-fs-resize: require libuuid
diff --git a/libparted/fs/Makefile.in b/libparted/fs/Makefile.in
index 3b552b8..ee8c8fd 100644
--- a/libparted/fs/Makefile.in
+++ b/libparted/fs/Makefile.in
@@ -249,7 +249,7 @@ AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
-libparted_fs_resize_la_LIBADD =
+libparted_fs_resize_la_LIBADD = $(UUID_LIBS)
am_libparted_fs_resize_la_OBJECTS = r/filesys.lo r/fat/bootsector.lo \
r/fat/calc.lo r/fat/clstdup.lo r/fat/context.lo r/fat/count.lo \
r/fat/fat.lo r/fat/fatio.lo r/fat/resize.lo r/fat/table.lo \