0002-libubi-remove-private-kernel-header-from-includes.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 42e051acd32c28c2f93c946d0c4bf6f9eada2aa4 Mon Sep 17 00:00:00 2001
  2. From: Bastian Germann <bastiangermann@fishpost.de>
  3. Date: Wed, 29 Jan 2020 19:50:13 +0100
  4. Subject: [PATCH 2/2] libubi: remove private kernel header from includes
  5. libubi.h includes ubi-media.h which was made private in the kernel a
  6. long time ago. There are users of libubi.h, e.g. swupdate, which have to
  7. have ubi-media.h available at build time with this inclusion.
  8. However, libubi.h uses only one symbol from ubi-media.h. Define that symbol
  9. in the header to enable using libubi.h without installing ubi-media.h.
  10. Make up for the transitive symbol use in ubiformat.c by including ubi-media.h.
  11. Signed-off-by: Bastian Germann <bastiangermann@fishpost.de>
  12. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
  13. ---
  14. include/libubi.h | 4 +++-
  15. ubi-utils/ubiformat.c | 1 +
  16. 2 files changed, 4 insertions(+), 1 deletion(-)
  17. diff --git a/include/libubi.h b/include/libubi.h
  18. index 46596a3..46c732a 100644
  19. --- a/include/libubi.h
  20. +++ b/include/libubi.h
  21. @@ -26,7 +26,6 @@
  22. #include <ctype.h>
  23. #include <stdint.h>
  24. #include <mtd/ubi-user.h>
  25. -#include <mtd/ubi-media.h>
  26. #ifdef __cplusplus
  27. extern "C" {
  28. @@ -38,6 +37,9 @@ extern "C" {
  29. /* Maximum physical eraseblock size in bytes */
  30. #define UBI_MAX_PEB_SZ (2*1024*1024)
  31. +/* The maximum volume name length (from Linux's ubi-media.h) */
  32. +#define UBI_VOL_NAME_MAX 127
  33. +
  34. /* UBI library descriptor */
  35. typedef void * libubi_t;
  36. diff --git a/ubi-utils/ubiformat.c b/ubi-utils/ubiformat.c
  37. index be40e52..d1b12e4 100644
  38. --- a/ubi-utils/ubiformat.c
  39. +++ b/ubi-utils/ubiformat.c
  40. @@ -38,6 +38,7 @@
  41. #include <getopt.h>
  42. #include <fcntl.h>
  43. +#include <mtd/ubi-media.h>
  44. #include <libubi.h>
  45. #include <libmtd.h>
  46. #include <libscan.h>
  47. --
  48. 2.25.1