summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/libblockdev
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2018-08-01 15:21:29 +0800
committerKhem Raj <raj.khem@gmail.com>2018-08-02 11:23:03 -0700
commit3bea987cdeb53b04a0948db2dafbc405715f37ea (patch)
tree9e834f14bbaf135f5a528c5f586c47d87eb36802 /meta-oe/recipes-extended/libblockdev
parent47d5e7940b3ad751b6d9ddf31c0bf02df09b362c (diff)
downloadmeta-openembedded-3bea987cdeb53b04a0948db2dafbc405715f37ea.tar.gz
libblockdev: clean up obsolete patches
Since upgrading libblockdev to 2.18, these patches are useless, remove them. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended/libblockdev')
-rw-r--r--meta-oe/recipes-extended/libblockdev/files/0002-remove-python2-support.patch30
-rw-r--r--meta-oe/recipes-extended/libblockdev/files/0003-remove-dmraid-while-compiling-with-with-dm.patch492
-rw-r--r--meta-oe/recipes-extended/libblockdev/files/0004-fix-compile-failure-against-musl-C-library.patch50
-rw-r--r--meta-oe/recipes-extended/libblockdev/files/0005-fix-a-clang-compiling-issue.patch111
4 files changed, 0 insertions, 683 deletions
diff --git a/meta-oe/recipes-extended/libblockdev/files/0002-remove-python2-support.patch b/meta-oe/recipes-extended/libblockdev/files/0002-remove-python2-support.patch
deleted file mode 100644
index 0719759cd..000000000
--- a/meta-oe/recipes-extended/libblockdev/files/0002-remove-python2-support.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 40dae7ea6450cb30f066da8443eabf063b5b0ad7 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Mon, 8 May 2017 02:05:40 -0400
4Subject: [PATCH 2/3] remove python2 support
5
6Only python3 is required.
7
8Upstream-Status: Inappropriate [wr-installer specific]
9
10Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
11---
12 src/python/gi/overrides/Makefile.am | 5 -----
13 1 file changed, 5 deletions(-)
14
15diff --git a/src/python/gi/overrides/Makefile.am b/src/python/gi/overrides/Makefile.am
16index a2927ac..6385502 100644
17--- a/src/python/gi/overrides/Makefile.am
18+++ b/src/python/gi/overrides/Makefile.am
19@@ -1,8 +1,3 @@
20-pylibdir = $(shell python -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='${exec_prefix}'))")
21-
22-overridesdir = $(pylibdir)/gi/overrides
23-dist_overrides_DATA = BlockDev.py
24-
25 if WITH_PYTHON3
26 py3libdir = $(shell python3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='${exec_prefix}'))")
27 py3overridesdir = $(py3libdir)/gi/overrides
28--
291.8.3.1
30
diff --git a/meta-oe/recipes-extended/libblockdev/files/0003-remove-dmraid-while-compiling-with-with-dm.patch b/meta-oe/recipes-extended/libblockdev/files/0003-remove-dmraid-while-compiling-with-with-dm.patch
deleted file mode 100644
index ac5b5e2be..000000000
--- a/meta-oe/recipes-extended/libblockdev/files/0003-remove-dmraid-while-compiling-with-with-dm.patch
+++ /dev/null
@@ -1,492 +0,0 @@
1From bda7c937ba544182a5cae2a9cf0c173e0ba268c9 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 27 Jul 2017 09:47:23 +0800
4Subject: [PATCH 3/3] remove dmraid while compiling with --with-dm
5
6Fix the following failure:
7
8...
9Perhaps you should add the directory containing `dmraid.pc'
10to the PKG_CONFIG_PATH environment variable
11No package 'dmraid' found
12...
13
14...
15../../../git/src/plugins/dm.c:24:10: fatal error: dmraid/dmraid.h: No
16such file or directory
17 #include <dmraid/dmraid.h>
18 ^~~~~~~~~~~~~~~~~
19...
20
21Upstream-Status: Inappropriate [oe specific]
22
23Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
24---
25 src/lib/plugin_apis/dm.api | 50 ------
26 src/plugins/Makefile.am | 2 +-
27 src/plugins/dm.c | 330 ------------------------------------
28 src/plugins/dm.h | 5 -
29 src/python/gi/overrides/BlockDev.py | 6 -
30 5 files changed, 1 insertion(+), 392 deletions(-)
31
32diff --git a/src/lib/plugin_apis/dm.api b/src/lib/plugin_apis/dm.api
33index 04fd8d8..5d30b6a 100644
34--- a/src/lib/plugin_apis/dm.api
35+++ b/src/lib/plugin_apis/dm.api
36@@ -111,53 +111,3 @@ gchar* bd_dm_get_subsystem_from_name (const gchar *device_name, GError **error);
37 * Tech category: %BD_DM_TECH_MAP-%BD_DM_TECH_MODE_QUERY
38 */
39 gboolean bd_dm_map_exists (const gchar *map_name, gboolean live_only, gboolean active_only, GError **error);
40-
41-/**
42- * bd_dm_get_member_raid_sets:
43- * @name: (allow-none): name of the member
44- * @uuid: (allow-none): uuid of the member
45- * @major: major number of the device or -1 if not specified
46- * @minor: minor number of the device or -1 if not specified
47- * @error: (out): variable to store error (if any)
48- *
49- * Returns: (transfer full) (array zero-terminated=1): list of names of the RAID sets related to
50- * the member or %NULL in case of error
51- *
52- * One of @name, @uuid or @major:@minor has to be given.
53- *
54- * Tech category: %BD_DM_TECH_RAID-%BD_DM_TECH_MODE_QUERY
55- */
56-gchar** bd_dm_get_member_raid_sets (const gchar *name, const gchar *uuid, gint major, gint minor, GError **error);
57-
58-/**
59- * bd_dm_activate_raid_set:
60- * @name: name of the DM RAID set to activate
61- * @error: (out): variable to store error (if any)
62- *
63- * Returns: whether the RAID set @name was successfully activate or not
64- *
65- * Tech category: %BD_DM_TECH_RAID-%BD_DM_TECH_CREATE_ACTIVATE
66- */
67-gboolean bd_dm_activate_raid_set (const gchar *name, GError **error);
68-
69-/**
70- * bd_dm_deactivate_raid_set:
71- * @name: name of the DM RAID set to deactivate
72- * @error: (out): variable to store error (if any)
73- *
74- * Returns: whether the RAID set @name was successfully deactivate or not
75- *
76- * Tech category: %BD_DM_TECH_RAID-%BD_DM_TECH_REMOVE_DEACTIVATE
77- */
78-gboolean bd_dm_deactivate_raid_set (const gchar *name, GError **error);
79-
80-/**
81- * bd_dm_get_raid_set_type:
82- * @name: name of the DM RAID set to get the type of
83- * @error: (out): variable to store error (if any)
84- *
85- * Returns: string representation of the @name RAID set's type
86- *
87- * Tech category: %BD_DM_TECH_RAID-%BD_DM_TECH_QUERY
88- */
89-gchar* bd_dm_get_raid_set_type (const gchar *name, GError **error);
90diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
91index b69c8f7..7575f4a 100644
92--- a/src/plugins/Makefile.am
93+++ b/src/plugins/Makefile.am
94@@ -75,7 +75,7 @@ endif
95
96 if WITH_DM
97 libbd_dm_la_CFLAGS = $(GLIB_CFLAGS) $(DEVMAPPER_CFLAGS) $(UDEV_CFLAGS) -Wall -Wextra -Werror
98-libbd_dm_la_LIBADD = $(GLIB_LIBS) $(DEVMAPPER_LIBS) $(UDEV_LIBS) -ldmraid ${builddir}/../utils/libbd_utils.la
99+libbd_dm_la_LIBADD = $(GLIB_LIBS) $(DEVMAPPER_LIBS) $(UDEV_LIBS) ${builddir}/../utils/libbd_utils.la
100 libbd_dm_la_LDFLAGS = -L${srcdir}/../utils/ -version-info 2:0:0 -Wl,--no-undefined
101 # Dear author of libdmdraid, VERSION really is not a good name for an enum member!
102 libbd_dm_la_CPPFLAGS = -I${builddir}/../../include/ -UVERSION
103diff --git a/src/plugins/dm.c b/src/plugins/dm.c
104index 0e5466c..31ebe96 100644
105--- a/src/plugins/dm.c
106+++ b/src/plugins/dm.c
107@@ -21,17 +21,11 @@
108 #include <unistd.h>
109 #include <blockdev/utils.h>
110 #include <libdevmapper.h>
111-#include <dmraid/dmraid.h>
112 #include <libudev.h>
113
114 #include "dm.h"
115 #include "check_deps.h"
116
117-/* macros taken from the pyblock/dmraid.h file plus one more*/
118-#define for_each_raidset(_c, _n) list_for_each_entry(_n, LC_RS(_c), list)
119-#define for_each_subset(_rs, _n) list_for_each_entry(_n, &(_rs)->sets, list)
120-#define for_each_device(_rs, _d) list_for_each_entry(_d, &(_rs)->devs, devs)
121-
122 /**
123 * SECTION: dm
124 * @short_description: plugin for basic operations with device mapper
125@@ -380,327 +374,3 @@ gboolean bd_dm_map_exists (const gchar *map_name, gboolean live_only, gboolean a
126
127 return ret;
128 }
129-
130-/**
131- * init_dmraid_stack: (skip)
132- *
133- * Initializes the dmraid stack by creating the library context, discovering
134- * devices, raid sets, etc.
135- */
136-static struct lib_context* init_dmraid_stack (GError **error) {
137- gint rc = 0;
138- gchar *argv[] = {"blockdev.dmraid", NULL};
139- struct lib_context *lc;
140-
141- /* the code for this function was cherry-picked from the pyblock code */
142- /* XXX: do this all just once, store global lc and provide a reinit
143- * function? */
144-
145- /* initialize dmraid library context */
146- lc = libdmraid_init (1, (gchar **)argv);
147-
148- rc = discover_devices (lc, NULL);
149- if (!rc) {
150- g_set_error (error, BD_DM_ERROR, BD_DM_ERROR_RAID_FAIL,
151- "Failed to discover devices");
152- libdmraid_exit (lc);
153- return NULL;
154- }
155- discover_raid_devices (lc, NULL);
156-
157- if (!count_devices (lc, RAID)) {
158- g_set_error (error, BD_DM_ERROR, BD_DM_ERROR_RAID_NO_DEVS,
159- "No RAIDs discovered");
160- libdmraid_exit (lc);
161- return NULL;
162- }
163-
164- argv[0] = NULL;
165- if (!group_set (lc, argv)) {
166- g_set_error (error, BD_DM_ERROR, BD_DM_ERROR_RAID_FAIL,
167- "Failed to group_set");
168- libdmraid_exit (lc);
169- return NULL;
170- }
171-
172- return lc;
173-}
174-
175-/**
176- * raid_dev_matches_spec: (skip)
177- *
178- * Returns: whether the device specified by @sysname matches the spec given by @name,
179- * @uuid, @major and @minor
180- */
181-static gboolean raid_dev_matches_spec (struct raid_dev *raid_dev, const gchar *name, const gchar *uuid, gint major, gint minor) {
182- gchar const *dev_name = NULL;
183- gchar const *dev_uuid;
184- gchar const *major_str;
185- gchar const *minor_str;
186- struct udev *context;
187- struct udev_device *device;
188- gboolean ret = TRUE;
189-
190- /* find the second '/' to get name (the rest of the string) */
191- dev_name = strchr (raid_dev->di->path, '/');
192- if (dev_name && strlen (dev_name) > 1) {
193- dev_name++;
194- dev_name = strchr (dev_name, '/');
195- }
196- if (dev_name && strlen (dev_name) > 1) {
197- dev_name++;
198- }
199- else
200- dev_name = NULL;
201-
202- /* if we don't have the name, we cannot check any match */
203- g_return_val_if_fail (dev_name, FALSE);
204-
205- /* g_return_val_if_fail above checks value of dev_name and returns FALSE if
206- * it is NULL so we don't need to check it here */
207- /* coverity[var_deref_model] */
208- if (name && strcmp (dev_name, name) != 0) {
209- return FALSE;
210- }
211-
212- context = udev_new ();
213- device = udev_device_new_from_subsystem_sysname (context, "block", dev_name);
214- dev_uuid = udev_device_get_property_value (device, "UUID");
215- major_str = udev_device_get_property_value (device, "MAJOR");
216- minor_str = udev_device_get_property_value (device, "MINOR");
217-
218- if (uuid && (g_strcmp0 (uuid, "") != 0) && (g_strcmp0 (uuid, dev_uuid) != 0))
219- ret = FALSE;
220-
221- if (major >= 0 && (atoi (major_str) != major))
222- ret = FALSE;
223-
224- if (minor >= 0 && (atoi (minor_str) != minor))
225- ret = FALSE;
226-
227- udev_device_unref (device);
228- udev_unref (context);
229-
230- return ret;
231-}
232-
233-/**
234- * find_raid_sets_for_dev: (skip)
235- */
236-static void find_raid_sets_for_dev (const gchar *name, const gchar *uuid, gint major, gint minor, struct lib_context *lc, struct raid_set *rs, GPtrArray *ret_sets) {
237- struct raid_set *subset = NULL;
238- struct raid_dev *dev = NULL;
239-
240- if (T_GROUP(rs) || !list_empty(&(rs->sets))) {
241- for_each_subset (rs, subset)
242- find_raid_sets_for_dev (name, uuid, major, minor, lc, subset, ret_sets);
243- } else {
244- for_each_device (rs, dev) {
245- if (raid_dev_matches_spec (dev, name, uuid, major, minor))
246- g_ptr_array_add (ret_sets, g_strdup (rs->name));
247- }
248- }
249-}
250-
251-/**
252- * bd_dm_get_member_raid_sets:
253- * @name: (allow-none): name of the member
254- * @uuid: (allow-none): uuid of the member
255- * @major: major number of the device or -1 if not specified
256- * @minor: minor number of the device or -1 if not specified
257- * @error: (out): variable to store error (if any)
258- *
259- * Returns: (transfer full) (array zero-terminated=1): list of names of the RAID sets related to
260- * the member or %NULL in case of error
261- *
262- * One of @name, @uuid or @major:@minor has to be given.
263- *
264- * Tech category: %BD_DM_TECH_RAID-%BD_DM_TECH_MODE_QUERY
265- */
266-gchar** bd_dm_get_member_raid_sets (const gchar *name, const gchar *uuid, gint major, gint minor, GError **error) {
267- guint64 i = 0;
268- struct lib_context *lc = NULL;
269- struct raid_set *rs = NULL;
270- GPtrArray *ret_sets = g_ptr_array_new ();
271- gchar **ret = NULL;
272-
273- lc = init_dmraid_stack (error);
274- if (!lc)
275- /* error is already populated */
276- return NULL;
277-
278- for_each_raidset (lc, rs) {
279- find_raid_sets_for_dev (name, uuid, major, minor, lc, rs, ret_sets);
280- }
281-
282- /* now create the return value -- NULL-terminated array of strings */
283- ret = g_new0 (gchar*, ret_sets->len + 1);
284- for (i=0; i < ret_sets->len; i++)
285- ret[i] = (gchar*) g_ptr_array_index (ret_sets, i);
286- ret[i] = NULL;
287-
288- g_ptr_array_free (ret_sets, FALSE);
289-
290- libdmraid_exit (lc);
291- return ret;
292-}
293-
294-/**
295- * find_in_raid_sets: (skip)
296- *
297- * Runs @eval_fn with @data on each set (traversing recursively) and returns the
298- * first RAID set that @eval_fn returns. Thus the @eval_fn should return %NULL
299- * on all RAID sets that don't fulfill the search criteria.
300- */
301-static struct raid_set* find_in_raid_sets (struct raid_set *rs, RSEvalFunc eval_fn, gpointer data) {
302- struct raid_set *subset = NULL;
303- struct raid_set *ret = NULL;
304-
305- ret = eval_fn (rs, data);
306- if (ret)
307- return ret;
308-
309- if (T_GROUP(rs) || !list_empty(&(rs->sets))) {
310- for_each_subset (rs, subset) {
311- ret = find_in_raid_sets (subset, eval_fn, data);
312- if (ret)
313- return ret;
314- }
315- }
316-
317- return ret;
318-}
319-
320-static struct raid_set* rs_matches_name (struct raid_set *rs, gpointer *name_data) {
321- gchar *name = (gchar*) name_data;
322-
323- if (g_strcmp0 (rs->name, name) == 0)
324- return rs;
325- else
326- return NULL;
327-}
328-
329-static gboolean change_set_by_name (const gchar *name, enum activate_type action, GError **error) {
330- gint rc = 0;
331- struct lib_context *lc = NULL;
332- struct raid_set *iter_rs = NULL;
333- struct raid_set *match_rs = NULL;
334-
335- lc = init_dmraid_stack (error);
336- if (!lc)
337- /* error is already populated */
338- return FALSE;
339-
340- for_each_raidset (lc, iter_rs) {
341- match_rs = find_in_raid_sets (iter_rs, (RSEvalFunc)rs_matches_name, (gchar *)name);
342- if (match_rs)
343- break;
344- }
345-
346- if (!match_rs) {
347- g_set_error (error, BD_DM_ERROR, BD_DM_ERROR_RAID_NO_EXIST,
348- "RAID set %s doesn't exist", name);
349- libdmraid_exit (lc);
350- return FALSE;
351- }
352-
353- rc = change_set (lc, action, match_rs);
354- if (!rc) {
355- g_set_error (error, BD_DM_ERROR, BD_DM_ERROR_RAID_FAIL,
356- "Failed to activate the RAID set '%s'", name);
357- libdmraid_exit (lc);
358- return FALSE;
359- }
360-
361- libdmraid_exit (lc);
362- return TRUE;
363-}
364-
365-/**
366- * bd_dm_activate_raid_set:
367- * @name: name of the DM RAID set to activate
368- * @error: (out): variable to store error (if any)
369- *
370- * Returns: whether the RAID set @name was successfully activate or not
371- *
372- * Tech category: %BD_DM_TECH_RAID-%BD_DM_TECH_CREATE_ACTIVATE
373- */
374-gboolean bd_dm_activate_raid_set (const gchar *name, GError **error) {
375- guint64 progress_id = 0;
376- gchar *msg = NULL;
377- gboolean ret = FALSE;
378-
379- msg = g_strdup_printf ("Activating DM RAID set '%s'", name);
380- progress_id = bd_utils_report_started (msg);
381- g_free (msg);
382- ret = change_set_by_name (name, A_ACTIVATE, error);
383- bd_utils_report_finished (progress_id, "Completed");
384- return ret;
385-}
386-
387-/**
388- * bd_dm_deactivate_raid_set:
389- * @name: name of the DM RAID set to deactivate
390- * @error: (out): variable to store error (if any)
391- *
392- * Returns: whether the RAID set @name was successfully deactivate or not
393- *
394- * Tech category: %BD_DM_TECH_RAID-%BD_DM_TECH_REMOVE_DEACTIVATE
395- */
396-gboolean bd_dm_deactivate_raid_set (const gchar *name, GError **error) {
397- guint64 progress_id = 0;
398- gchar *msg = NULL;
399- gboolean ret = FALSE;
400-
401- msg = g_strdup_printf ("Deactivating DM RAID set '%s'", name);
402- progress_id = bd_utils_report_started (msg);
403- g_free (msg);
404- ret = change_set_by_name (name, A_DEACTIVATE, error);
405- bd_utils_report_finished (progress_id, "Completed");
406- return ret;
407-}
408-
409-/**
410- * bd_dm_get_raid_set_type:
411- * @name: name of the DM RAID set to get the type of
412- * @error: (out): variable to store error (if any)
413- *
414- * Returns: string representation of the @name RAID set's type
415- *
416- * Tech category: %BD_DM_TECH_RAID-%BD_DM_TECH_QUERY
417- */
418-gchar* bd_dm_get_raid_set_type (const gchar *name, GError **error) {
419- struct lib_context *lc = NULL;
420- struct raid_set *iter_rs = NULL;
421- struct raid_set *match_rs = NULL;
422- const gchar *type = NULL;
423-
424- lc = init_dmraid_stack (error);
425- if (!lc)
426- /* error is already populated */
427- return NULL;
428-
429- for_each_raidset (lc, iter_rs) {
430- match_rs = find_in_raid_sets (iter_rs, (RSEvalFunc)rs_matches_name, (gchar *)name);
431- if (match_rs)
432- break;
433- }
434-
435- if (!match_rs) {
436- g_set_error (error, BD_DM_ERROR, BD_DM_ERROR_RAID_NO_EXIST,
437- "RAID set %s doesn't exist", name);
438- libdmraid_exit (lc);
439- return NULL;
440- }
441-
442- type = get_set_type (lc, match_rs);
443- if (!type) {
444- g_set_error (error, BD_DM_ERROR, BD_DM_ERROR_RAID_FAIL,
445- "Failed to get RAID set's type");
446- libdmraid_exit (lc);
447- return NULL;
448- }
449-
450- libdmraid_exit (lc);
451- return g_strdup (type);
452-}
453diff --git a/src/plugins/dm.h b/src/plugins/dm.h
454index 0dce6ac..1ee3788 100644
455--- a/src/plugins/dm.h
456+++ b/src/plugins/dm.h
457@@ -1,5 +1,4 @@
458 #include <glib.h>
459-#include <dmraid/dmraid.h>
460
461 #ifndef BD_DM
462 #define BD_DM
463@@ -48,9 +47,5 @@ gboolean bd_dm_map_exists (const gchar *map_name, gboolean live_only, gboolean a
464 gchar* bd_dm_name_from_node (const gchar *dm_node, GError **error);
465 gchar* bd_dm_node_from_name (const gchar *map_name, GError **error);
466 gchar* bd_dm_get_subsystem_from_name (const gchar *device_name, GError **error);
467-gchar** bd_dm_get_member_raid_sets (const gchar *name, const gchar *uuid, gint major, gint minor, GError **error);
468-gboolean bd_dm_activate_raid_set (const gchar *name, GError **error);
469-gboolean bd_dm_deactivate_raid_set (const gchar *name, GError **error);
470-gchar* bd_dm_get_raid_set_type (const gchar *name, GError **error);
471
472 #endif /* BD_DM */
473diff --git a/src/python/gi/overrides/BlockDev.py b/src/python/gi/overrides/BlockDev.py
474index fb3ffb4..eed0a38 100644
475--- a/src/python/gi/overrides/BlockDev.py
476+++ b/src/python/gi/overrides/BlockDev.py
477@@ -233,12 +233,6 @@ def dm_create_linear(map_name, device, length, uuid=None):
478 return _dm_create_linear(map_name, device, length, uuid)
479 __all__.append("dm_create_linear")
480
481-_dm_get_member_raid_sets = BlockDev.dm_get_member_raid_sets
482-@override(BlockDev.dm_get_member_raid_sets)
483-def dm_get_member_raid_sets(name=None, uuid=None, major=-1, minor=-1):
484- return _dm_get_member_raid_sets(name, uuid, major, minor)
485-__all__.append("dm_get_member_raid_sets")
486-
487
488 _loop_setup = BlockDev.loop_setup
489 @override(BlockDev.loop_setup)
490--
4912.14.3
492
diff --git a/meta-oe/recipes-extended/libblockdev/files/0004-fix-compile-failure-against-musl-C-library.patch b/meta-oe/recipes-extended/libblockdev/files/0004-fix-compile-failure-against-musl-C-library.patch
deleted file mode 100644
index 0b5b80912..000000000
--- a/meta-oe/recipes-extended/libblockdev/files/0004-fix-compile-failure-against-musl-C-library.patch
+++ /dev/null
@@ -1,50 +0,0 @@
1From 59fbd57acd1df25b1972a131dc6a77a4fe147729 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 27 Jul 2017 10:45:02 +0800
4Subject: [PATCH] fix compile failure against musl C library
5
6Upstream-Status: Pending
7
8Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
9---
10 src/plugins/crypto.c | 2 +-
11 src/plugins/part.c | 3 ++-
12 2 files changed, 3 insertions(+), 2 deletions(-)
13
14diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
15index b961471..2d3d251 100644
16--- a/src/plugins/crypto.c
17+++ b/src/plugins/crypto.c
18@@ -22,7 +22,7 @@
19 #include <libcryptsetup.h>
20 #include <nss.h>
21 #include <volume_key/libvolume_key.h>
22-#include <sys/fcntl.h>
23+#include <fcntl.h>
24 #include <sys/ioctl.h>
25 #include <linux/random.h>
26 #include <locale.h>
27diff --git a/src/plugins/part.c b/src/plugins/part.c
28index 6b2a690..ab490d9 100644
29--- a/src/plugins/part.c
30+++ b/src/plugins/part.c
31@@ -25,6 +25,7 @@
32 #include <inttypes.h>
33 #include <unistd.h>
34 #include <sys/file.h>
35+#include <fcntl.h>
36 #include <sys/ioctl.h>
37 #include <linux/fs.h>
38 #include <blockdev/utils.h>
39@@ -1354,7 +1355,7 @@ static gboolean set_gpt_flags (const gchar *device, int part_num, guint64 flags,
40 real_flags |= 0x4000000000000000; /* 1 << 62 */
41 if (flags & BD_PART_FLAG_GPT_NO_AUTOMOUNT)
42 real_flags |= 0x8000000000000000; /* 1 << 63 */
43- mask_str = g_strdup_printf ("%.16"__PRI64_PREFIX"x", real_flags);
44+ mask_str = g_strdup_printf ("%.16"__PRI64"x", real_flags);
45
46 args[2] = g_strdup_printf ("%d:=:%s", part_num, mask_str);
47 g_free (mask_str);
48--
492.14.3
50
diff --git a/meta-oe/recipes-extended/libblockdev/files/0005-fix-a-clang-compiling-issue.patch b/meta-oe/recipes-extended/libblockdev/files/0005-fix-a-clang-compiling-issue.patch
deleted file mode 100644
index b214f0b05..000000000
--- a/meta-oe/recipes-extended/libblockdev/files/0005-fix-a-clang-compiling-issue.patch
+++ /dev/null
@@ -1,111 +0,0 @@
1From 9b4a7a4d0653b627d747e00d6b3ada2990caa1d3 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 9 Aug 2017 13:57:57 +0800
4Subject: [PATCH] fix a clang compiling issue
5
6[snip]
7../../../git/src/plugins/fs.c:2617:26: error: missing field 'start'
8initializer [-Werror,-Wmissing-field-initializers]
9 PedGeometry geom = {0};
10 ^
11../../../git/src/plugins/fs.c:2618:30: error: missing field 'start'
12initializer [-Werror,-Wmissing-field-initializers]
13 PedGeometry new_geom = {0};
14[snip]
15
16Fix typo s/enum libvk_packet_format format/enum libvk_secret secret_type/
17
18Upstream-Status: Submitted [https://github.com/storaged-project/libblockdev/pull/266]
19
20Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
21---
22 src/plugins/crypto.c | 6 +++---
23 src/plugins/fs/vfat.c | 4 ++--
24 src/plugins/part.c | 4 ++--
25 src/utils/exec.c | 2 +-
26 4 files changed, 8 insertions(+), 8 deletions(-)
27
28diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
29index 563093e..b961471 100644
30--- a/src/plugins/crypto.c
31+++ b/src/plugins/crypto.c
32@@ -970,7 +970,7 @@ gboolean bd_crypto_tc_open (const gchar *device, const gchar *name, const guint8
33 gint ret = 0;
34 guint64 progress_id = 0;
35 gchar *msg = NULL;
36- struct crypt_params_tcrypt params = {0};
37+ struct crypt_params_tcrypt params = {NULL,0,NULL,0,NULL,NULL,NULL,0,0};
38
39 msg = g_strdup_printf ("Started opening '%s' TrueCrypt/VeraCrypt device", device);
40 progress_id = bd_utils_report_started (msg);
41@@ -1090,7 +1090,7 @@ static gchar *replace_char (gchar *str, gchar orig, gchar new) {
42 return str;
43 }
44
45-static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libvk_ui *ui, enum libvk_packet_format format, const gchar *out_path,
46+static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libvk_ui *ui, enum libvk_secret secret_type, const gchar *out_path,
47 CERTCertificate *cert, GError **error) {
48 gpointer packet_data = NULL;
49 gsize packet_data_size = 0;
50@@ -1099,7 +1099,7 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv
51 gsize bytes_written = 0;
52 GError *tmp_error = NULL;
53
54- packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, format, cert,
55+ packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, secret_type, cert,
56 ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, error);
57
58 if (!packet_data) {
59diff --git a/src/plugins/fs/vfat.c b/src/plugins/fs/vfat.c
60index 3ed7d4a..5ff7795 100644
61--- a/src/plugins/fs/vfat.c
62+++ b/src/plugins/fs/vfat.c
63@@ -376,8 +376,8 @@ BDFSVfatInfo* bd_fs_vfat_get_info (const gchar *device, GError **error) {
64 */
65 gboolean bd_fs_vfat_resize (const gchar *device, guint64 new_size, GError **error) {
66 PedDevice *ped_dev = NULL;
67- PedGeometry geom = {0};
68- PedGeometry new_geom = {0};
69+ PedGeometry geom = {NULL, 0, 0, 0};
70+ PedGeometry new_geom = {NULL, 0, 0, 0};
71 PedFileSystem *fs = NULL;
72 PedSector start = 0;
73 PedSector length = 0;
74diff --git a/src/plugins/part.c b/src/plugins/part.c
75index fed8300..6b2a690 100644
76--- a/src/plugins/part.c
77+++ b/src/plugins/part.c
78@@ -926,7 +926,7 @@ static PedPartition* add_part_to_disk (PedDevice *dev, PedDisk *disk, BDPartType
79 return NULL;
80 }
81
82- part = ped_partition_new (disk, type, NULL, geom->start, geom->end);
83+ part = ped_partition_new (disk, (PedPartitionType)type, NULL, geom->start, geom->end);
84 if (!part) {
85 set_parted_error (error, BD_PART_ERROR_FAIL);
86 g_prefix_error (error, "Failed to create new partition on device '%s'", dev->path);
87@@ -1564,7 +1564,7 @@ gboolean bd_part_set_part_flags (const gchar *disk, const gchar *part, guint64 f
88 PedPartition *ped_part = NULL;
89 const gchar *part_num_str = NULL;
90 gint part_num = 0;
91- guint64 i = 0;
92+ int i = 0;
93 gint status = 0;
94 gboolean ret = FALSE;
95 guint64 progress_id = 0;
96diff --git a/src/utils/exec.c b/src/utils/exec.c
97index 11c1489..dcf87e5 100644
98--- a/src/utils/exec.c
99+++ b/src/utils/exec.c
100@@ -354,7 +354,7 @@ gboolean bd_utils_exec_and_report_progress (const gchar **argv, const BDExtraArg
101 GIOStatus io_status = G_IO_STATUS_NORMAL;
102 guint i = 0;
103 guint8 completion = 0;
104- GPollFD fds[2] = {{0}, {0}};
105+ GPollFD fds[2] = {{0,0,0}, {0,0,0}};
106 gboolean out_done = FALSE;
107 gboolean err_done = FALSE;
108 GString *stdout_data = g_string_new (NULL);
109--
1102.14.3
111