0001-src-mount.c-fix-build-with-kernel-4.14.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From f73eefdbc0577b125f7d36f54a27d8e95af831dd Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Tue, 22 Dec 2020 11:52:31 +0100
  4. Subject: [PATCH] src/mount.c: fix build with kernel < 4.14
  5. Build with kernel headers < 4.14 fails since version 1.5.0 and
  6. https://github.com/rauc/rauc/commit/527bf2f7f746e0253f7843542e19cb0fa0c7c869:
  7. src/mount.c: In function 'r_setup_loop':
  8. src/mount.c:201:25: error: 'LOOP_SET_BLOCK_SIZE' undeclared (first use in this function)
  9. looprc = ioctl(loopfd, LOOP_SET_BLOCK_SIZE, 4096);
  10. ^
  11. Indeed, LOOP_SET_BLOCK_SIZE is only defined since
  12. https://github.com/torvalds/linux/commit/89e4fdecb51cf5535867026274bc97de9480ade5
  13. Fixes:
  14. - http://autobuild.buildroot.org/results/829ae7ed66686c11a941ac99bd08a06f754affb4
  15. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  16. [Upstream status: https://github.com/rauc/rauc/pull/673]
  17. ---
  18. src/mount.c | 4 ++++
  19. 1 file changed, 4 insertions(+)
  20. diff --git a/src/mount.c b/src/mount.c
  21. index 2e593ca..75acf49 100644
  22. --- a/src/mount.c
  23. +++ b/src/mount.c
  24. @@ -11,6 +11,10 @@
  25. #include "mount.h"
  26. #include "utils.h"
  27. +#ifndef LOOP_SET_BLOCK_SIZE
  28. +#define LOOP_SET_BLOCK_SIZE 0x4C09
  29. +#endif
  30. +
  31. gboolean r_mount_bundle(const gchar *source, const gchar *mountpoint, GError **error)
  32. {
  33. const unsigned long flags = MS_NODEV | MS_NOSUID | MS_RDONLY;
  34. --
  35. 2.29.2