diff options
author | Khem Raj <raj.khem@gmail.com> | 2015-11-18 23:24:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-12 23:42:55 +0000 |
commit | 36a709aa0f232a1887cf60f2eaf0a44fdd707ecd (patch) | |
tree | 7924315a890369f1ebacf4adee744273fc490c05 /meta/recipes-devtools/mtd/mtd-utils | |
parent | 41fd73fe6591ee4d4e905d228db19d29f7c04637 (diff) | |
download | poky-36a709aa0f232a1887cf60f2eaf0a44fdd707ecd.tar.gz |
mtd-utils: Backport and create patches to support musl
(From OE-Core rev: 9a4ab3b1ad45a556b845530a12ec865be2278c78)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/mtd/mtd-utils')
3 files changed, 133 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch b/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch new file mode 100644 index 0000000000..d3699c65d6 --- /dev/null +++ b/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From e16fa28bc57c29923ab60af2ac343da83e1992d8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 6 Oct 2015 23:51:34 +0000 | ||
4 | Subject: [PATCH] Fix build with musl | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | mkfs.jffs2.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- | ||
11 | recv_image.c | 1 - | ||
12 | serve_image.c | 1 - | ||
13 | 3 files changed, 42 insertions(+), 4 deletions(-) | ||
14 | |||
15 | diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c | ||
16 | index f09c0b2..ed2dc43 100644 | ||
17 | --- a/mkfs.jffs2.c | ||
18 | +++ b/mkfs.jffs2.c | ||
19 | @@ -72,6 +72,7 @@ | ||
20 | #include <byteswap.h> | ||
21 | #include <crc32.h> | ||
22 | #include <inttypes.h> | ||
23 | +#include <limits.h> | ||
24 | |||
25 | #include "rbtree.h" | ||
26 | #include "common.h" | ||
27 | diff --git a/recv_image.c b/recv_image.c | ||
28 | index 26a8361..0093831 100644 | ||
29 | --- a/recv_image.c | ||
30 | +++ b/recv_image.c | ||
31 | @@ -4,7 +4,6 @@ | ||
32 | #define _BSD_SOURCE /* struct ip_mreq */ | ||
33 | |||
34 | #include <errno.h> | ||
35 | -#include <error.h> | ||
36 | #include <stdio.h> | ||
37 | #include <netdb.h> | ||
38 | #include <stdlib.h> | ||
39 | diff --git a/serve_image.c b/serve_image.c | ||
40 | index 38549a1..4f0e946 100644 | ||
41 | --- a/serve_image.c | ||
42 | +++ b/serve_image.c | ||
43 | @@ -3,7 +3,6 @@ | ||
44 | |||
45 | #include <time.h> | ||
46 | #include <errno.h> | ||
47 | -#include <error.h> | ||
48 | #include <netdb.h> | ||
49 | #include <stdio.h> | ||
50 | #include <stdlib.h> | ||
51 | -- | ||
52 | 2.6.1 | ||
53 | |||
diff --git a/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch b/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch new file mode 100644 index 0000000000..46ed956d0e --- /dev/null +++ b/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 26cc709291fc6c5d2e45b26c602407706d9142df Mon Sep 17 00:00:00 2001 | ||
2 | From: Imre Kaloz <kaloz@openwrt.org> | ||
3 | Date: Mon, 4 May 2015 15:36:34 +0200 | ||
4 | Subject: [PATCH] mtd-utils: libfec: use standard C type instead of u_long | ||
5 | |||
6 | Fixes compilation on hosts with the musl C library. | ||
7 | Also drops the unused u_short typedef. | ||
8 | |||
9 | Signed-off-by: Imre Kaloz <kaloz@openwrt.org> | ||
10 | Signed-off-by: Brian Norris <computersforpeace@gmail.com> | ||
11 | --- | ||
12 | Upstream-Status: Backport | ||
13 | |||
14 | lib/libfec.c | 8 +++----- | ||
15 | 1 file changed, 3 insertions(+), 5 deletions(-) | ||
16 | |||
17 | diff --git a/lib/libfec.c b/lib/libfec.c | ||
18 | index ff5a127..bf68381 100644 | ||
19 | --- a/lib/libfec.c | ||
20 | +++ b/lib/libfec.c | ||
21 | @@ -61,8 +61,6 @@ struct timeval { | ||
22 | }; | ||
23 | #define gettimeofday(x, dummy) { (x)->ticks = clock() ; } | ||
24 | #define DIFF_T(a,b) (1+ 1000000*(a.ticks - b.ticks) / CLOCKS_PER_SEC ) | ||
25 | -typedef unsigned long u_long ; | ||
26 | -typedef unsigned short u_short ; | ||
27 | #else /* typically, unix systems */ | ||
28 | #include <sys/time.h> | ||
29 | #define DIFF_T(a,b) \ | ||
30 | @@ -75,12 +73,12 @@ typedef unsigned short u_short ; | ||
31 | t = x.tv_usec + 1000000* (x.tv_sec & 0xff ) ; \ | ||
32 | } | ||
33 | #define TOCK(t) \ | ||
34 | - { u_long t1 ; TICK(t1) ; \ | ||
35 | + { unsigned long t1 ; TICK(t1) ; \ | ||
36 | if (t1 < t) t = 256000000 + t1 - t ; \ | ||
37 | else t = t1 - t ; \ | ||
38 | if (t == 0) t = 1 ;} | ||
39 | |||
40 | -u_long ticks[10]; /* vars for timekeeping */ | ||
41 | +unsigned long ticks[10]; /* vars for timekeeping */ | ||
42 | #else | ||
43 | #define DEB(x) | ||
44 | #define DDB(x) | ||
45 | @@ -625,7 +623,7 @@ init_fec(void) | ||
46 | #define FEC_MAGIC 0xFECC0DEC | ||
47 | |||
48 | struct fec_parms { | ||
49 | - u_long magic ; | ||
50 | + unsigned long magic ; | ||
51 | int k, n ; /* parameters of the code */ | ||
52 | gf *enc_matrix ; | ||
53 | } ; | ||
54 | -- | ||
55 | 2.6.0 | ||
56 | |||
diff --git a/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch b/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch new file mode 100644 index 0000000000..7d783e7a5c --- /dev/null +++ b/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | Replace rpmatch() usage with checking first character of line | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
5 | |||
6 | --- a/include/common.h | ||
7 | +++ b/include/common.h | ||
8 | @@ -122,10 +122,12 @@ | ||
9 | } | ||
10 | |||
11 | if (strcmp("\n", line) != 0) { | ||
12 | - switch (rpmatch(line)) { | ||
13 | - case 0: ret = false; break; | ||
14 | - case 1: ret = true; break; | ||
15 | - case -1: | ||
16 | + switch (line[0]) { | ||
17 | + case 'N': | ||
18 | + case 'n': ret = false; break; | ||
19 | + case 'Y': | ||
20 | + case 'y': ret = true; break; | ||
21 | + default: | ||
22 | puts("unknown response; please try again"); | ||
23 | continue; | ||
24 | } | ||