diff options
Diffstat (limited to 'meta/recipes-devtools/mtd')
-rw-r--r-- | meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch | 34 | ||||
-rw-r--r-- | meta/recipes-devtools/mtd/files/0001-ubifs-utils-ubifs.h-Include-fcntl.h.patch | 53 | ||||
-rw-r--r-- | meta/recipes-devtools/mtd/files/0002-ubifs-utils-journal-Include-sys-stat.h.patch | 41 | ||||
-rw-r--r-- | meta/recipes-devtools/mtd/files/0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch | 66 | ||||
-rw-r--r-- | meta/recipes-devtools/mtd/files/0004-ubifs-utils-extract_files-Include-linux-limits.h.patch | 41 | ||||
-rw-r--r-- | meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb (renamed from meta/recipes-devtools/mtd/mtd-utils_git.bb) | 13 |
6 files changed, 242 insertions, 6 deletions
diff --git a/meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch b/meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch new file mode 100644 index 0000000000..2329dfece3 --- /dev/null +++ b/meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From e7adb21350ff3b96dbd2de56a127e9d916c08d62 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 22 Mar 2025 19:05:32 -0700 | ||
4 | Subject: [PATCH] Improve check for GCC compiler version | ||
5 | |||
6 | When using unreleased compiler has version like | ||
7 | 15.0.1 and that test fails because __GNUC_MINOR__ < 1 | ||
8 | becomes true, therefore check for full version string | ||
9 | which is more rubust. | ||
10 | |||
11 | Upstream-Status: Backport [https://github.com/sigma-star/mtd-utils/commit/ac0ab65ebcd7b11739986b81343457469fbb43b0] | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | ubifs-utils/common/atomic.h | 6 +++++- | ||
15 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/ubifs-utils/common/atomic.h b/ubifs-utils/common/atomic.h | ||
18 | index f287d43..95754b2 100644 | ||
19 | --- a/ubifs-utils/common/atomic.h | ||
20 | +++ b/ubifs-utils/common/atomic.h | ||
21 | @@ -2,8 +2,12 @@ | ||
22 | #ifndef __ATOMIC_H__ | ||
23 | #define __ATOMIC_H__ | ||
24 | |||
25 | +#define GCC_VERSION (__GNUC__ * 10000 \ | ||
26 | + + __GNUC_MINOR__ * 100 \ | ||
27 | + + __GNUC_PATCHLEVEL__) | ||
28 | + | ||
29 | /* Check GCC version, just to be safe */ | ||
30 | -#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC_MINOR__ < 1) | ||
31 | +#if GCC_VERSION < 40100 | ||
32 | # error atomic.h works only with GCC newer than version 4.1 | ||
33 | #endif /* GNUC >= 4.1 */ | ||
34 | |||
diff --git a/meta/recipes-devtools/mtd/files/0001-ubifs-utils-ubifs.h-Include-fcntl.h.patch b/meta/recipes-devtools/mtd/files/0001-ubifs-utils-ubifs.h-Include-fcntl.h.patch new file mode 100644 index 0000000000..b603ac8fd6 --- /dev/null +++ b/meta/recipes-devtools/mtd/files/0001-ubifs-utils-ubifs.h-Include-fcntl.h.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 2fc872697f72214e1e3efc6c2523e374fa5d681d Mon Sep 17 00:00:00 2001 | ||
2 | From: Fabio Estevam <festevam@gmail.com> | ||
3 | Date: Mon, 17 Feb 2025 16:02:04 -0300 | ||
4 | Subject: [PATCH v4 mtd-utils 1/4] ubifs-utils: ubifs.h: Include <fcntl.h> | ||
5 | |||
6 | Include the <fcntl.h> header file to fix the following error | ||
7 | when building with musl: | ||
8 | |||
9 | | In file included from ../git/ubifs-utils/common/compr.c:42: | ||
10 | | ../git/ubifs-utils/libubifs/ubifs.h:313:9: error: unknown type name 'loff_t'; did you mean 'off_t'? | ||
11 | | 313 | loff_t ui_size; | ||
12 | | | ^~~~~~ | ||
13 | | | off_t | ||
14 | | ../git/ubifs-utils/libubifs/ubifs.h:1341:9: error: unknown type name 'loff_t'; did you mean 'off_t'? | ||
15 | | 1341 | loff_t i_size; | ||
16 | | | ^~~~~~ | ||
17 | | | off_t | ||
18 | | ../git/ubifs-utils/libubifs/ubifs.h:1342:9: error: unknown type name 'loff_t'; did you mean 'off_t'? | ||
19 | | 1342 | loff_t d_size; | ||
20 | | | ^~~~~~ | ||
21 | | | off_t | ||
22 | | ../git/ubifs-utils/libubifs/ubifs.h:1899:44: error: unknown type name 'loff_t'; did you mean 'off_t'? | ||
23 | | 1899 | int deletion, loff_t new_size); | ||
24 | | | ^~~~~~ | ||
25 | | | off_t | ||
26 | | make: *** [Makefile:4878: ubifs-utils/common/mkfs_ubifs-compr.o] Error 1 | ||
27 | |||
28 | Upstream-Status: Backport [https://github.com/sigma-star/mtd-utils/commit/12bc9ad824bd8f18a5ec9c7154ad2374cf8c7ae3] | ||
29 | Signed-off-by: Fabio Estevam <festevam@gmail.com> | ||
30 | Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> | ||
31 | Reviewed-by: Khem Raj <raj.khem@gmail.com> | ||
32 | --- | ||
33 | Changes since v3: | ||
34 | - Removed Upstream-Status tag. | ||
35 | |||
36 | ubifs-utils/libubifs/ubifs.h | 1 + | ||
37 | 1 file changed, 1 insertion(+) | ||
38 | |||
39 | diff --git a/ubifs-utils/libubifs/ubifs.h b/ubifs-utils/libubifs/ubifs.h | ||
40 | index 0908a2289208..1c7bc7bd0c80 100644 | ||
41 | --- a/ubifs-utils/libubifs/ubifs.h | ||
42 | +++ b/ubifs-utils/libubifs/ubifs.h | ||
43 | @@ -11,6 +11,7 @@ | ||
44 | #ifndef __UBIFS_H__ | ||
45 | #define __UBIFS_H__ | ||
46 | |||
47 | +#include <fcntl.h> | ||
48 | #include <string.h> | ||
49 | |||
50 | #include "linux_types.h" | ||
51 | -- | ||
52 | 2.34.1 | ||
53 | |||
diff --git a/meta/recipes-devtools/mtd/files/0002-ubifs-utils-journal-Include-sys-stat.h.patch b/meta/recipes-devtools/mtd/files/0002-ubifs-utils-journal-Include-sys-stat.h.patch new file mode 100644 index 0000000000..d92a3fb4b6 --- /dev/null +++ b/meta/recipes-devtools/mtd/files/0002-ubifs-utils-journal-Include-sys-stat.h.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 65077d8d664821e323d011956049c1c1b97d9560 Mon Sep 17 00:00:00 2001 | ||
2 | From: Fabio Estevam <festevam@gmail.com> | ||
3 | Date: Mon, 17 Feb 2025 16:07:49 -0300 | ||
4 | Subject: [PATCH v4 mtd-utils 2/4] ubifs-utils: journal: Include <sys/stat.h> | ||
5 | |||
6 | Include the <sys/stat.h> header file to fix the following error | ||
7 | when building with musl: | ||
8 | |||
9 | | ../git/ubifs-utils/libubifs/journal.c: In function 'ubifs_get_dent_type': | ||
10 | | ../git/ubifs-utils/libubifs/journal.c:414:24: error: 'S_IFMT' undeclared (first use in this function) | ||
11 | | 414 | switch (mode & S_IFMT) { | ||
12 | | | ^~~~~~ | ||
13 | | ../git/ubifs-utils/libubifs/journal.c:414:24: note: each undeclared identifier is reported only once for each function it appears in | ||
14 | | ../git/ubifs-utils/libubifs/journal.c:415:14: error: 'S_IFREG' undeclared (first use in this function) | ||
15 | | 415 | case S_IFREG: | ||
16 | |||
17 | Upstream-Status: Backport [https://github.com/sigma-star/mtd-utils/commit/173f9714c8da1d685bfa951d43b9310d16bbab3c] | ||
18 | Signed-off-by: Fabio Estevam <festevam@gmail.com> | ||
19 | Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> | ||
20 | --- | ||
21 | Changes since v3: | ||
22 | - Removed Upstream-Status tag. | ||
23 | |||
24 | ubifs-utils/libubifs/journal.c | 1 + | ||
25 | 1 file changed, 1 insertion(+) | ||
26 | |||
27 | diff --git a/ubifs-utils/libubifs/journal.c b/ubifs-utils/libubifs/journal.c | ||
28 | index e78ea14f3e69..45d82fd54bdb 100644 | ||
29 | --- a/ubifs-utils/libubifs/journal.c | ||
30 | +++ b/ubifs-utils/libubifs/journal.c | ||
31 | @@ -46,6 +46,7 @@ | ||
32 | * all the nodes. | ||
33 | */ | ||
34 | |||
35 | +#include <sys/stat.h> | ||
36 | #include "bitops.h" | ||
37 | #include "kmem.h" | ||
38 | #include "ubifs.h" | ||
39 | -- | ||
40 | 2.34.1 | ||
41 | |||
diff --git a/meta/recipes-devtools/mtd/files/0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch b/meta/recipes-devtools/mtd/files/0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch new file mode 100644 index 0000000000..efaedad70b --- /dev/null +++ b/meta/recipes-devtools/mtd/files/0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | From 52db447c94974cd946de8d9d7031b91d41ad1280 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ross Burton <ross.burton@arm.com> | ||
3 | Date: Wed, 26 Feb 2025 18:24:00 +0000 | ||
4 | Subject: [PATCH 3/4] ubifs-utils: link libmissing.a in case execinfo.h isn't | ||
5 | present | ||
6 | |||
7 | On musl execinfo.h doesn't exist, but ubifs-utils uses backtrace() when | ||
8 | reporting errors. This results in build failures under musl. | ||
9 | |||
10 | Handily, libmissing.a already exists with a stub implementation of | ||
11 | backtrace(). | ||
12 | |||
13 | Guard the execinfo.h include and if it isn't available instead include | ||
14 | libmissing.h, and link to libmissing.a to provide backtrace() if needed. | ||
15 | |||
16 | Upstream-Status: Backport [https://github.com/sigma-star/mtd-utils/commit/8a83b306db64d6f60186d4396b0b770163b85b6e] | ||
17 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
18 | Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> | ||
19 | Signed-off-by: Fabio Estevam <festevam@gmail.com> | ||
20 | --- | ||
21 | ubifs-utils/Makemodule.am | 4 ++-- | ||
22 | ubifs-utils/common/defs.h | 5 ++++- | ||
23 | 2 files changed, 6 insertions(+), 3 deletions(-) | ||
24 | |||
25 | diff --git a/ubifs-utils/Makemodule.am b/ubifs-utils/Makemodule.am | ||
26 | index 21ba0597d84a..f84569a6da44 100644 | ||
27 | --- a/ubifs-utils/Makemodule.am | ||
28 | +++ b/ubifs-utils/Makemodule.am | ||
29 | @@ -72,7 +72,7 @@ mkfs_ubifs_SOURCES = \ | ||
30 | ubifs-utils/mkfs.ubifs/mkfs.ubifs.c | ||
31 | |||
32 | mkfs_ubifs_LDADD = libmtd.a libubi.a $(ZLIB_LIBS) $(LZO_LIBS) $(ZSTD_LIBS) $(UUID_LIBS) $(LIBSELINUX_LIBS) $(OPENSSL_LIBS) \ | ||
33 | - $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread | ||
34 | + $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread libmissing.a | ||
35 | mkfs_ubifs_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) $(ZSTD_CFLAGS) $(UUID_CFLAGS) $(LIBSELINUX_CFLAGS) \ | ||
36 | -I$(top_srcdir)/ubi-utils/include -I$(top_srcdir)/ubifs-utils/common -I $(top_srcdir)/ubifs-utils/libubifs | ||
37 | |||
38 | @@ -90,7 +90,7 @@ fsck_ubifs_SOURCES = \ | ||
39 | ubifs-utils/fsck.ubifs/handle_disconnected.c | ||
40 | |||
41 | fsck_ubifs_LDADD = libmtd.a libubi.a $(ZLIB_LIBS) $(LZO_LIBS) $(ZSTD_LIBS) $(UUID_LIBS) $(LIBSELINUX_LIBS) $(OPENSSL_LIBS) \ | ||
42 | - $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread | ||
43 | + $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread libmissing.a | ||
44 | fsck_ubifs_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) $(ZSTD_CFLAGS) $(UUID_CFLAGS) $(LIBSELINUX_CFLAGS) \ | ||
45 | -I$(top_srcdir)/ubi-utils/include -I$(top_srcdir)/ubifs-utils/common -I $(top_srcdir)/ubifs-utils/libubifs \ | ||
46 | -I$(top_srcdir)/ubifs-utils/fsck.ubifs | ||
47 | diff --git a/ubifs-utils/common/defs.h b/ubifs-utils/common/defs.h | ||
48 | index 7ff1771674d9..d5edbf67439a 100644 | ||
49 | --- a/ubifs-utils/common/defs.h | ||
50 | +++ b/ubifs-utils/common/defs.h | ||
51 | @@ -13,8 +13,11 @@ | ||
52 | #include <errno.h> | ||
53 | #include <time.h> | ||
54 | #include <assert.h> | ||
55 | +#if HAVE_EXECINFO_H | ||
56 | #include <execinfo.h> | ||
57 | - | ||
58 | +#else | ||
59 | +#include "libmissing.h" | ||
60 | +#endif | ||
61 | #include "ubifs.h" | ||
62 | |||
63 | /* common.h requires the PROGRAM_NAME macro */ | ||
64 | -- | ||
65 | 2.34.1 | ||
66 | |||
diff --git a/meta/recipes-devtools/mtd/files/0004-ubifs-utils-extract_files-Include-linux-limits.h.patch b/meta/recipes-devtools/mtd/files/0004-ubifs-utils-extract_files-Include-linux-limits.h.patch new file mode 100644 index 0000000000..3444f330dc --- /dev/null +++ b/meta/recipes-devtools/mtd/files/0004-ubifs-utils-extract_files-Include-linux-limits.h.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From f218be1ce0c8923d690221160a3dd9f1492acaf1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Fabio Estevam <festevam@gmail.com> | ||
3 | Date: Tue, 18 Feb 2025 08:17:30 -0300 | ||
4 | Subject: [PATCH v4 mtd-utils 4/4] ubifs-utils: extract_files: Include <linux/limits.h> | ||
5 | |||
6 | Include <linux/limits.h> to fix the following build error when building | ||
7 | with musl: | ||
8 | |||
9 | | ../git/ubifs-utils/fsck.ubifs/extract_files.c: In function 'parse_ino_node': | ||
10 | | ../git/ubifs-utils/fsck.ubifs/extract_files.c:144:47: error: 'XATTR_LIST_MAX' undeclared (first use in this function) | ||
11 | | 144 | if (ino_node->xnms + ino_node->xcnt > XATTR_LIST_MAX) { | ||
12 | | | ^~~~~~~~~~~~~~ | ||
13 | | ../git/ubifs-utils/fsck.ubifs/extract_files.c:144:47: note: each undeclared identifier is reported only once for each function it appears in | ||
14 | | make: *** [Makefile:4374: ubifs-utils/fsck.ubifs/fsck_ubifs-extract_files.o] Error 1 | ||
15 | |||
16 | Upstream-Status: Backport [https://github.com/sigma-star/mtd-utils/commit/77981a2888c711268b0e7f32af6af159c2288e23] | ||
17 | Signed-off-by: Fabio Estevam <festevam@gmail.com> | ||
18 | Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> | ||
19 | --- | ||
20 | Changes since v3: | ||
21 | - None. | ||
22 | |||
23 | ubifs-utils/fsck.ubifs/extract_files.c | 2 ++ | ||
24 | 1 file changed, 2 insertions(+) | ||
25 | |||
26 | diff --git a/ubifs-utils/fsck.ubifs/extract_files.c b/ubifs-utils/fsck.ubifs/extract_files.c | ||
27 | index c83d37749bc0..000ef5d10565 100644 | ||
28 | --- a/ubifs-utils/fsck.ubifs/extract_files.c | ||
29 | +++ b/ubifs-utils/fsck.ubifs/extract_files.c | ||
30 | @@ -10,6 +10,8 @@ | ||
31 | #include <getopt.h> | ||
32 | #include <sys/stat.h> | ||
33 | |||
34 | +#include <linux/limits.h> | ||
35 | + | ||
36 | #include "linux_err.h" | ||
37 | #include "bitops.h" | ||
38 | #include "kmem.h" | ||
39 | -- | ||
40 | 2.34.1 | ||
41 | |||
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb index a40d79c864..47f0b01abe 100644 --- a/meta/recipes-devtools/mtd/mtd-utils_git.bb +++ b/meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb | |||
@@ -11,12 +11,13 @@ inherit autotools pkgconfig update-alternatives | |||
11 | DEPENDS = "zlib e2fsprogs util-linux" | 11 | DEPENDS = "zlib e2fsprogs util-linux" |
12 | RDEPENDS:mtd-utils-tests += "bash" | 12 | RDEPENDS:mtd-utils-tests += "bash" |
13 | 13 | ||
14 | PV = "2.2.0" | 14 | SRCREV = "4594fc1f4496a0ed55cabd31fbeba4e3fbf05602" |
15 | 15 | SRC_URI = "git://git.infradead.org/mtd-utils.git;branch=master \ | |
16 | SRCREV = "31e990c56aba7584cde310685d663bb122f16003" | 16 | file://0001-ubifs-utils-ubifs.h-Include-fcntl.h.patch \ |
17 | SRC_URI = "git://git.infradead.org/mtd-utils.git;branch=master" | 17 | file://0002-ubifs-utils-journal-Include-sys-stat.h.patch \ |
18 | 18 | file://0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch \ | |
19 | S = "${WORKDIR}/git" | 19 | file://0004-ubifs-utils-extract_files-Include-linux-limits.h.patch \ |
20 | file://0001-Improve-check-for-GCC-compiler-version.patch" | ||
20 | 21 | ||
21 | # xattr support creates an additional compile-time dependency on acl because | 22 | # xattr support creates an additional compile-time dependency on acl because |
22 | # the sys/acl.h header is needed. libacl is not needed and thus enabling xattr | 23 | # the sys/acl.h header is needed. libacl is not needed and thus enabling xattr |