2
1

0013-extras-ext4_utils-make_ext4fs_main.c-disable-Android.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 01e86db8460d873aec15d658bfc717b026c0545f Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  3. Date: Sun, 14 Jul 2024 11:46:51 +0200
  4. Subject: [PATCH] extras/ext4_utils/make_ext4fs_main.c: disable
  5. Android-specific code
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. Since we are not building with the Android code, we do not have the
  10. implementation of the selinux_android_file_context_handle(). However,
  11. its only call site is when 'mountpoint' is set, and 'mountpoint'
  12. cannot be non-NULL in non-Android cases due to how the -a option is
  13. parsed:
  14. case 'a':
  15. #ifdef ANDROID
  16. fs_config_func = fs_config;
  17. mountpoint = optarg;
  18. #else
  19. fprintf(stderr, "can't set android permissions - built without android support\n");
  20. usage(argv[0]);
  21. exit(EXIT_FAILURE);
  22. #endif
  23. So also compile out the code calling
  24. selinux_android_file_context_handle() when ANDROID is not set.
  25. Fixes:
  26. make_ext4fs_main.c:155:25: error: implicit declaration of function ‘selinux_android_file_context_handle’ [-Wimplicit-function-declaration]
  27. Upstream: N/A, we're too far from upstream
  28. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  29. ---
  30. extras/ext4_utils/make_ext4fs_main.c | 2 +-
  31. 1 file changed, 1 insertion(+), 1 deletion(-)
  32. diff --git a/extras/ext4_utils/make_ext4fs_main.c b/extras/ext4_utils/make_ext4fs_main.c
  33. index 17d3735..cb58011 100644
  34. --- a/extras/ext4_utils/make_ext4fs_main.c
  35. +++ b/extras/ext4_utils/make_ext4fs_main.c
  36. @@ -149,7 +149,7 @@ int main(int argc, char **argv)
  37. }
  38. }
  39. -#if !defined(HOST)
  40. +#if !defined(HOST) && defined(ANDROID)
  41. // Use only if -S option not requested
  42. if (!sehnd && mountpoint) {
  43. sehnd = selinux_android_file_context_handle();
  44. --
  45. 2.47.0