]> www.infradead.org Git - mtd-utils.git/commitdiff
libubi: remove private kernel header from includes
authorBastian Germann <bastiangermann@fishpost.de>
Wed, 29 Jan 2020 18:50:13 +0000 (19:50 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Thu, 30 Jan 2020 10:23:02 +0000 (11:23 +0100)
libubi.h includes ubi-media.h which was made private in the kernel a
long time ago. There are users of libubi.h, e.g. swupdate, which have to
have ubi-media.h available at build time with this inclusion.

However, libubi.h uses only one symbol from ubi-media.h. Define that symbol
in the header to enable using libubi.h without installing ubi-media.h.

Make up for the transitive symbol use in ubiformat.c by including ubi-media.h.

Signed-off-by: Bastian Germann <bastiangermann@fishpost.de>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
include/libubi.h
ubi-utils/ubiformat.c

index 46596a308f9e59c290000f8482ec604dab746f7c..46c732a0e65611923293de565cfb51f639d2978e 100644 (file)
@@ -26,7 +26,6 @@
 #include <ctype.h>
 #include <stdint.h>
 #include <mtd/ubi-user.h>
-#include <mtd/ubi-media.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -38,6 +37,9 @@ extern "C" {
 /* Maximum physical eraseblock size in bytes */
 #define UBI_MAX_PEB_SZ (2*1024*1024)
 
+/* The maximum volume name length (from Linux's ubi-media.h) */
+#define UBI_VOL_NAME_MAX 127
+
 /* UBI library descriptor */
 typedef void * libubi_t;
 
index be40e526e837578c9207c3bcb9e2cc1e6601ca5d..d1b12e46288eddcafd3e473c2e6356b540424336 100644 (file)
@@ -38,6 +38,7 @@
 #include <getopt.h>
 #include <fcntl.h>
 
+#include <mtd/ubi-media.h>
 #include <libubi.h>
 #include <libmtd.h>
 #include <libscan.h>