diff options
Diffstat (limited to 'meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch')
-rw-r--r-- | meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch | 76 |
1 files changed, 50 insertions, 26 deletions
diff --git a/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch b/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch index 68ab715f32..8c4d2ae66d 100644 --- a/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch +++ b/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch | |||
@@ -1,44 +1,68 @@ | |||
1 | From 060e74354774d36d2c11ef08e3e7ea9b9b6e23fb Mon Sep 17 00:00:00 2001 | 1 | Upstream-Status: Backport |
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | 2 | Signed-off-by: Ross Burton <ross.burton@intel.com> |
3 | Date: Thu, 13 Nov 2014 11:29:33 +0800 | ||
4 | Subject: [PATCH] libparted/arch/linux.c: fix compile failure while | ||
5 | --disable-device-mapper | ||
6 | 3 | ||
7 | While --disable-device-mapper, the MACRO ENABLE_DEVICE_MAPPER is | 4 | From da3f129710929abe9a403901fa7d168355b0e95a Mon Sep 17 00:00:00 2001 |
8 | undef, but it missed to scope some device mapper functions. | 5 | From: Felix Janda <felix.janda@posteo.de> |
6 | Date: Sun, 3 May 2015 10:33:15 +0200 | ||
7 | Subject: [PATCH] libparted/arch/linux.c: Compile without ENABLE_DEVICE_MAPPER | ||
9 | 8 | ||
10 | Upstream-Status: Pending | 9 | Signed-off-by: Brian C. Lane <bcl@redhat.com> |
11 | |||
12 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
13 | --- | 10 | --- |
14 | libparted/arch/linux.c | 8 ++++++-- | 11 | libparted/arch/linux.c | 21 +++++++++++++++++---- |
15 | 1 file changed, 6 insertions(+), 2 deletions(-) | 12 | 1 file changed, 17 insertions(+), 4 deletions(-) |
16 | 13 | ||
17 | diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c | 14 | diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c |
18 | index 6fd73c5..2afa479 100644 | 15 | index a15854f..7f12f58 100644 |
19 | --- a/libparted/arch/linux.c | 16 | --- a/libparted/arch/linux.c |
20 | +++ b/libparted/arch/linux.c | 17 | +++ b/libparted/arch/linux.c |
21 | @@ -2320,6 +2320,7 @@ zasprintf (const char *format, ...) | 18 | @@ -2305,6 +2305,7 @@ zasprintf (const char *format, ...) |
19 | return r < 0 ? NULL : resultp; | ||
20 | } | ||
21 | |||
22 | +#ifdef ENABLE_DEVICE_MAPPER | ||
22 | static char * | 23 | static char * |
23 | dm_canonical_path (PedDevice const *dev) | 24 | dm_canonical_path (PedDevice const *dev) |
24 | { | 25 | { |
25 | +#ifdef ENABLE_DEVICE_MAPPER | 26 | @@ -2327,14 +2328,21 @@ dm_canonical_path (PedDevice const *dev) |
26 | LinuxSpecific const *arch_specific = LINUX_SPECIFIC (dev); | ||
27 | |||
28 | /* Get map name from devicemapper */ | ||
29 | @@ -2337,6 +2338,7 @@ dm_canonical_path (PedDevice const *dev) | ||
30 | dm_task_destroy (task); | ||
31 | return dev_name; | ||
32 | err: | 27 | err: |
33 | +#endif | ||
34 | return NULL; | 28 | return NULL; |
35 | } | 29 | } |
30 | +#endif | ||
31 | |||
32 | static char* | ||
33 | _device_get_part_path (PedDevice const *dev, int num) | ||
34 | { | ||
35 | - char *devpath = (dev->type == PED_DEVICE_DM | ||
36 | - ? dm_canonical_path (dev) : dev->path); | ||
37 | - size_t path_len = strlen (devpath); | ||
38 | + char *devpath; | ||
39 | + size_t path_len; | ||
40 | char *result; | ||
41 | +#ifdef ENABLE_DEVICE_MAPPER | ||
42 | + devpath = (dev->type == PED_DEVICE_DM | ||
43 | + ? dm_canonical_path (dev) : dev->path); | ||
44 | +#else | ||
45 | + devpath = dev->path; | ||
46 | +#endif | ||
47 | + path_len = strlen (devpath); | ||
48 | /* Check for devfs-style /disc => /partN transformation | ||
49 | unconditionally; the system might be using udev with devfs rules, | ||
50 | and if not the test is harmless. */ | ||
51 | @@ -2350,8 +2358,10 @@ _device_get_part_path (PedDevice const *dev, int num) | ||
52 | ? "p" : ""); | ||
53 | result = zasprintf ("%s%s%d", devpath, p, num); | ||
54 | } | ||
55 | +#ifdef ENABLE_DEVICE_MAPPER | ||
56 | if (dev->type == PED_DEVICE_DM) | ||
57 | free (devpath); | ||
58 | +#endif | ||
59 | return result; | ||
60 | } | ||
36 | 61 | ||
37 | @@ -2957,13 +2959,15 @@ _disk_sync_part_table (PedDisk* disk) | 62 | @@ -2946,12 +2956,15 @@ _disk_sync_part_table (PedDisk* disk) |
38 | unsigned long long *start, | ||
39 | unsigned long long *length); | 63 | unsigned long long *length); |
40 | 64 | ||
41 | - | 65 | |
42 | +#ifdef ENABLE_DEVICE_MAPPER | 66 | +#ifdef ENABLE_DEVICE_MAPPER |
43 | if (disk->dev->type == PED_DEVICE_DM) { | 67 | if (disk->dev->type == PED_DEVICE_DM) { |
44 | add_partition = _dm_add_partition; | 68 | add_partition = _dm_add_partition; |
@@ -53,5 +77,5 @@ index 6fd73c5..2afa479 100644 | |||
53 | remove_partition = _blkpg_remove_partition; | 77 | remove_partition = _blkpg_remove_partition; |
54 | #ifdef BLKPG_RESIZE_PARTITION | 78 | #ifdef BLKPG_RESIZE_PARTITION |
55 | -- | 79 | -- |
56 | 1.9.1 | 80 | 2.11.0 |
57 | 81 | ||