parted: update to 3.4

This commit is contained in:
Lucy Phipps 2021-11-01 11:54:22 +00:00
parent d5adc0a5d8
commit 06bd63fd72
No known key found for this signature in database
GPG Key ID: 8F688A3DB7869BFE
5 changed files with 2 additions and 88 deletions

View File

@ -1,54 +0,0 @@
Fix disabling of libdevmapper.
Fix bugs related to disabling libdevmapper. Parted is rarely compiled without
devmapper. So couple of syntax errors for the cas3 of disabled devmapper
sneaked in.
diff -ur src-orig/libparted/arch/linux.c src/libparted/arch/linux.c
--- src-orig/libparted/arch/linux.c 2017-08-31 15:47:07.007674598 +0200
+++ src/libparted/arch/linux.c 2017-08-31 15:50:01.487860337 +0200
@@ -2304,6 +2304,7 @@
return r < 0 ? NULL : resultp;
}
+#ifdef ENABLE_DEVICE_MAPPER
static char *
dm_canonical_path (PedDevice const *dev)
{
@@ -2326,12 +2327,17 @@
err:
return NULL;
}
+#endif
static char*
_device_get_part_path (PedDevice const *dev, int num)
{
+#ifdef ENABLE_DEVICE_MAPPER
char *devpath = (dev->type == PED_DEVICE_DM
? dm_canonical_path (dev) : dev->path);
+#else
+ char *devpath = dev->path;
+#endif
size_t path_len = strlen (devpath);
char *result;
/* Check for devfs-style /disc => /partN transformation
@@ -2946,10 +2948,18 @@
if (disk->dev->type == PED_DEVICE_DM) {
+#ifdef ENABLE_DEVICE_MAPPER
add_partition = _dm_add_partition;
remove_partition = _dm_remove_partition;
resize_partition = _dm_resize_partition;
get_partition_start_and_length = _dm_get_partition_start_and_length;
+#else
+ ped_exception_throw (
+ PED_EXCEPTION_BUG,
+ PED_EXCEPTION_CANCEL,
+ "This parted is compiled without devmapper support");
+ return 0;
+#endif
} else {
add_partition = _blkpg_add_partition;
remove_partition = _blkpg_remove_partition;

View File

@ -1,31 +0,0 @@
Add missing major() and minor().
Based on glibc version of this functions. Parted relies on those
functions and they're not provided by bionic libc.
diff -ur src-orig/libparted/arch/linux.c src/libparted/arch/linux.c
--- src-orig/libparted/arch/linux.c 2017-08-31 15:47:07.007674598 +0200
+++ src/libparted/arch/linux.c 2017-08-31 15:50:01.487860337 +0200
@@ -86,6 +86,22 @@
#define WR_MODE (O_WRONLY)
#define RW_MODE (O_RDWR)
+unsigned int major(dev_t __dev)
+{
+ unsigned int __major;
+ __major = ((__dev & (dev_t) 0x00000000000fff00u) >> 8);
+ __major |= ((__dev & (dev_t) 0xfffff00000000000u) >> 32);
+ return __major;
+}
+
+unsigned int minor(dev_t __dev)
+{
+ unsigned int __minor;
+ __minor = ((__dev & (dev_t) 0x00000000000000ffu) >> 0);
+ __minor |= ((__dev & (dev_t) 0x00000ffffff00000u) >> 12);
+ return __minor;
+}
+
struct hd_geometry {
unsigned char heads;
unsigned char sectors;

View File

@ -2,10 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/parted/
TERMUX_PKG_DESCRIPTION="Versatile partition editor"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.2
TERMUX_PKG_REVISION=5
TERMUX_PKG_VERSION=3.4
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/parted/parted-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4
TERMUX_PKG_SHA256=e1298022472da5589b7f2be1d5ee3c1b66ec3d96dfbad03dc642afd009da5342
TERMUX_PKG_DEPENDS="libiconv, libuuid, readline"
TERMUX_PKG_BREAKS="parted-dev"
TERMUX_PKG_REPLACES="parted-dev"