]> git.webhop.me Git - bs-cst-neutrino-hd.git/commitdiff
add patch for parted
authorMarkham <markham001@gmx.de>
Sat, 1 May 2021 15:32:56 +0000 (17:32 +0200)
committerMarkham <markham001@gmx.de>
Sat, 1 May 2021 15:32:56 +0000 (17:32 +0200)
archive-patches/parted-3.2-device-mapper.patch [new file with mode: 0644]

diff --git a/archive-patches/parted-3.2-device-mapper.patch b/archive-patches/parted-3.2-device-mapper.patch
new file mode 100644 (file)
index 0000000..7ff6eee
--- /dev/null
@@ -0,0 +1,53 @@
+--- parted-3.2/libparted/arch/linux.c
++++ parted-3.2/libparted/arch/linux.c
+@@ -45,6 +45,8 @@
+ #include <libdevmapper.h>
+ #endif
++#include <sys/sysmacros.h>
++
+ #include "../architecture.h"
+ #include "dirname.h"
+ #include "xstrtol.h"
+@@ -2307,6 +2307,7 @@ zasprintf (const char *format, ...)
+ static char *
+ dm_canonical_path (PedDevice const *dev)
+ {
++#ifdef ENABLE_DEVICE_MAPPER
+         LinuxSpecific const *arch_specific = LINUX_SPECIFIC (dev);
+
+         /* Get map name from devicemapper */
+@@ -2324,6 +2325,7 @@ dm_canonical_path (PedDevice const *dev)
+         dm_task_destroy (task);
+         return dev_name;
+ err:
++#endif
+         return NULL;
+ }
+
+@@ -2944,13 +2946,14 @@ _disk_sync_part_table (PedDisk* disk)
+                                                unsigned long long *start,
+                                                unsigned long long *length);
+
+-
++#ifdef ENABLE_DEVICE_MAPPER
+         if (disk->dev->type == PED_DEVICE_DM) {
+                 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 {
++#endif
+                 add_partition = _blkpg_add_partition;
+                 remove_partition = _blkpg_remove_partition;
+ #ifdef BLKPG_RESIZE_PARTITION
+@@ -2959,7 +2958,9 @@ _disk_sync_part_table (PedDisk* disk)
+                 resize_partition = NULL;
+ #endif
+                 get_partition_start_and_length = _kernel_get_partition_start_and_length;
++#ifdef ENABLE_DEVICE_MAPPER
+         }
++#endif
+
+         /* lpn = largest partition number.
+          * for remove pass, use greater of device or label limit */