mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-11-28 15:50:37 -10:00
In commit360a7cd738("package/systemd: bump linux-headers dependency to 4.14"), the headers requirements were bumped to 4.14 because of new build failures due to LOOP_SET_BLOCK_SIZE. Even though systemd does not recommend using it with headers < 4.15 (see [1]), it is still possible to build it and use some of its features (after fixing the build failure). Note that this was build-tested with 4.4 headers only, and not all the way back to 3.15 (which is the version requirement that was used before360a7cd738). [1]: https://github.com/systemd/systemd/blob/main/README Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
39 lines
1.5 KiB
Diff
39 lines
1.5 KiB
Diff
From e358793a796f8c742af4ea3f4fe398731ca46649 Mon Sep 17 00:00:00 2001
|
||
From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <raphael.melotte@mind.be>
|
||
Date: Fri, 14 Jun 2024 14:37:29 +0200
|
||
Subject: [PATCH] src/basic/missing_loop.h: fix missing LOOP_SET_BLOCK_SIZE
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: 8bit
|
||
|
||
Builds with kernels headers < 4.14 fail with:
|
||
|
||
../src/shared/loop-util.c: In function ‘loop_configure_fallback’:
|
||
../src/shared/loop-util.c:237:31: error: ‘LOOP_SET_BLOCK_SIZE’ undeclared (first use in this function); did you mean ‘LOOP_SET_DIRECT_IO’?
|
||
if (ioctl(fd, LOOP_SET_BLOCK_SIZE, (unsigned long) c->block_size) < 0)
|
||
^~~~~~~~~~~~~~~~~~~
|
||
LOOP_SET_DIRECT_IO
|
||
|
||
Fixes: https://github.com/systemd/systemd/issues/33341
|
||
Upstream: https://github.com/systemd/systemd/commit/56ab1c54497d9fac74380ff9e11aaf931a917d2b
|
||
Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
|
||
---
|
||
src/basic/missing_loop.h | 4 ++++
|
||
1 file changed, 4 insertions(+)
|
||
|
||
diff --git a/src/basic/missing_loop.h b/src/basic/missing_loop.h
|
||
index 7141544b64..b1505f678b 100644
|
||
--- a/src/basic/missing_loop.h
|
||
+++ b/src/basic/missing_loop.h
|
||
@@ -22,3 +22,7 @@ struct loop_config {
|
||
#ifndef LOOP_SET_STATUS_SETTABLE_FLAGS
|
||
#define LOOP_SET_STATUS_SETTABLE_FLAGS (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN | LO_FLAGS_DIRECT_IO)
|
||
#endif
|
||
+
|
||
+#ifndef LOOP_SET_BLOCK_SIZE
|
||
+# define LOOP_SET_BLOCK_SIZE 0x4C09
|
||
+#endif
|
||
--
|
||
2.25.1
|
||
|