diff options
author | Andrea Adami <andrea.adami@gmail.com> | 2014-11-13 01:13:50 +0100 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2014-11-17 10:00:45 +0000 |
commit | f38cf13f728d95c6640bf17b50bf52194538cc47 (patch) | |
tree | a1cac9fef6cd6a6eb7b55b1ae8166d0ae85a4897 /meta-initramfs | |
parent | e6f64ce21d51d6b108c24cfe755638c526d9af8b (diff) | |
download | meta-openembedded-f38cf13f728d95c6640bf17b50bf52194538cc47.tar.gz |
ubi-utils-klibc_1.5.1: initial commit of v. 1.5.1
NOTE: we track master upstream so we are some commits ahead v 1.5.1.
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Diffstat (limited to 'meta-initramfs')
7 files changed, 470 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0001-Makefile-only-build-ubi-utils.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0001-Makefile-only-build-ubi-utils.patch new file mode 100644 index 000000000..9d5e4ebf0 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0001-Makefile-only-build-ubi-utils.patch | |||
@@ -0,0 +1,87 @@ | |||
1 | From c4e6bd9378645d577e9d9f85da85f1438afe7c50 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
3 | Date: Sun, 29 Jun 2014 00:32:29 +0200 | ||
4 | Subject: [PATCH 1/6] Makefile: build ubi-utils only | ||
5 | |||
6 | We build all the static ubi-utils but actually only ubiattach is needed in | ||
7 | a minimalistic initramfs for the mount of ubi volumes. | ||
8 | |||
9 | More fixes are needed in order to build the full mtd-utils. | ||
10 | The first issue is: | ||
11 | |||
12 | | mkfs.jffs2.c:64:20: fatal error: libgen.h: No such file or directory | ||
13 | | #include <libgen.h> | ||
14 | |||
15 | Removing the include then the second error is: | ||
16 | |||
17 | | mkfs.jffs2.c:1570:22: error: '_SC_PAGESIZE' undeclared | ||
18 | | (first use in this function) | ||
19 | | page_size = sysconf(_SC_PAGESIZE); | ||
20 | |||
21 | Upstream-Status: Inappropriate [embedded specific] | ||
22 | |||
23 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
24 | --- | ||
25 | Makefile | 24 ++---------------------- | ||
26 | 1 file changed, 2 insertions(+), 22 deletions(-) | ||
27 | |||
28 | diff --git a/Makefile b/Makefile | ||
29 | index eade234..2275865 100644 | ||
30 | --- a/Makefile | ||
31 | +++ b/Makefile | ||
32 | @@ -16,28 +16,13 @@ endif | ||
33 | |||
34 | TESTS = tests | ||
35 | |||
36 | -MTD_BINS = \ | ||
37 | - ftl_format flash_erase nanddump doc_loadbios \ | ||
38 | - ftl_check mkfs.jffs2 flash_lock flash_unlock \ | ||
39 | - flash_otp_info flash_otp_dump flash_otp_lock flash_otp_write \ | ||
40 | - mtd_debug flashcp nandwrite nandtest \ | ||
41 | - jffs2dump \ | ||
42 | - nftldump nftl_format docfdisk \ | ||
43 | - rfddump rfdformat \ | ||
44 | - serve_image recv_image \ | ||
45 | - sumtool jffs2reader | ||
46 | UBI_BINS = \ | ||
47 | ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \ | ||
48 | ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol ubiblock | ||
49 | |||
50 | -BINS = $(MTD_BINS) | ||
51 | -BINS += mkfs.ubifs/mkfs.ubifs | ||
52 | -BINS += $(addprefix ubi-utils/,$(UBI_BINS)) | ||
53 | -SCRIPTS = flash_eraseall | ||
54 | +BINS = $(addprefix ubi-utils/,$(UBI_BINS)) | ||
55 | |||
56 | TARGETS = $(BINS) | ||
57 | -TARGETS += lib/libmtd.a | ||
58 | -TARGETS += ubi-utils/libubi.a | ||
59 | |||
60 | OBJDEPS = $(BUILDDIR)/include/version.h | ||
61 | |||
62 | @@ -61,12 +46,9 @@ endif | ||
63 | rm -f $(BUILDDIR)/include/version.h | ||
64 | $(MAKE) -C $(TESTS) clean | ||
65 | |||
66 | -install:: $(addprefix $(BUILDDIR)/,${BINS}) ${SCRIPTS} | ||
67 | +install:: $(addprefix $(BUILDDIR)/,${BINS}) | ||
68 | mkdir -p ${DESTDIR}/${SBINDIR} | ||
69 | install -m 0755 $^ ${DESTDIR}/${SBINDIR}/ | ||
70 | - mkdir -p ${DESTDIR}/${MANDIR}/man1 | ||
71 | - install -m 0644 mkfs.jffs2.1 ${DESTDIR}/${MANDIR}/man1/ | ||
72 | - -gzip -9f ${DESTDIR}/${MANDIR}/man1/*.1 | ||
73 | |||
74 | tests:: | ||
75 | $(MAKE) -C $(TESTS) | ||
76 | @@ -91,8 +73,6 @@ LDLIBS_mkfs.jffs2 = -lz $(LZOLDLIBS) | ||
77 | LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS) | ||
78 | LDLIBS_jffs2reader = -lz $(LZOLDLIBS) | ||
79 | |||
80 | -$(foreach v,$(MTD_BINS),$(eval $(call mkdep,,$(v)))) | ||
81 | - | ||
82 | # | ||
83 | # Common libmtd | ||
84 | # | ||
85 | -- | ||
86 | 1.9.1 | ||
87 | |||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0002-common.mk-for-klibc-CC-is-klcc.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0002-common.mk-for-klibc-CC-is-klcc.patch new file mode 100644 index 000000000..f46824b5c --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0002-common.mk-for-klibc-CC-is-klcc.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From f3609c7c0450b4c31e1d4603fcf2cfb1ba46f994 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
3 | Date: Sun, 29 Jun 2014 00:37:28 +0200 | ||
4 | Subject: [PATCH 2/6] common.mk: for klibc $(CC) is klcc | ||
5 | |||
6 | Do not hardcode: assign the value to the variable if it is not already defined. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
11 | --- | ||
12 | common.mk | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/common.mk b/common.mk | ||
16 | index ba87377..59c56df 100644 | ||
17 | --- a/common.mk | ||
18 | +++ b/common.mk | ||
19 | @@ -1,4 +1,4 @@ | ||
20 | -CC := $(CROSS)gcc | ||
21 | +CC ?= $(CROSS)gcc | ||
22 | AR := $(CROSS)ar | ||
23 | RANLIB := $(CROSS)ranlib | ||
24 | |||
25 | -- | ||
26 | 1.9.1 | ||
27 | |||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0003-libubi.c-add-klibc-specific-fixes.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0003-libubi.c-add-klibc-specific-fixes.patch new file mode 100644 index 000000000..962b3685f --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0003-libubi.c-add-klibc-specific-fixes.patch | |||
@@ -0,0 +1,76 @@ | |||
1 | From 72a39bb3290a79e76b0dbf59eef83ea2d9b577a1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
3 | Date: Sun, 29 Jun 2014 00:40:15 +0200 | ||
4 | Subject: [PATCH 3/6] libubi.c: add klibc specific fixes for ioctl | ||
5 | |||
6 | First issue is that ioctl() in klibc doesn't expect a constant as arg3. | ||
7 | Second issue is that arg3 in klibc ioctl() implementation is not optional. | ||
8 | |||
9 | Fixes: | ||
10 | |||
11 | | ubi-utils/libubi.c: In function 'do_attach': | ||
12 | | ubi-utils/libubi.c:698:8: warning: passing argument 3 of 'ioctl' discards | ||
13 | | 'const' qualifier from pointer target type | ||
14 | | ret = ioctl(fd, UBI_IOCATT, r); | ||
15 | | ^ | ||
16 | | In file included from ubi-utils/libubi.c:32:0: | ||
17 | | .../lib/klibc/include/sys/ioctl.h:15:14: note: expected 'void *' but argument | ||
18 | | is of type 'const struct ubi_attach_req *' | ||
19 | | __extern int ioctl(int, int, void *); | ||
20 | | ^ | ||
21 | |||
22 | | ubi-utils/libubi.c: In function 'ubi_vol_block_create': | ||
23 | | ubi-utils/libubi.c:1118:9: error: too few arguments to function 'ioctl' | ||
24 | | return ioctl(fd, UBI_IOCVOLCRBLK); | ||
25 | | ^ | ||
26 | | In file included from ubi-utils/libubi.c:32:0: | ||
27 | | .../lib/klibc/include/sys/ioctl.h:15:14: note: declared here | ||
28 | | __extern int ioctl(int, int, void *); | ||
29 | | ^ | ||
30 | | ubi-utils/libubi.c: In function 'ubi_vol_block_remove': | ||
31 | | ubi-utils/libubi.c:1123:9: error: too few arguments to function 'ioctl' | ||
32 | | return ioctl(fd, UBI_IOCVOLRMBLK); | ||
33 | | ^ | ||
34 | | In file included from ubi-utils/libubi.c:32:0: | ||
35 | | .../usr/lib/klibc/include/sys/ioctl.h:15:14: note: declared here | ||
36 | | __extern int ioctl(int, int, void *); | ||
37 | | ^ | ||
38 | |||
39 | Upstream-Status: Inappropriate [klibc specific] | ||
40 | |||
41 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
42 | --- | ||
43 | ubi-utils/libubi.c | 6 +++--- | ||
44 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
45 | |||
46 | diff --git a/ubi-utils/libubi.c b/ubi-utils/libubi.c | ||
47 | index 1e08b7d..491e525 100644 | ||
48 | --- a/ubi-utils/libubi.c | ||
49 | +++ b/ubi-utils/libubi.c | ||
50 | @@ -687,7 +687,7 @@ void libubi_close(libubi_t desc) | ||
51 | * success and %-1 in case of failure. @r->ubi_num contains newly created UBI | ||
52 | * device number. | ||
53 | */ | ||
54 | -static int do_attach(const char *node, const struct ubi_attach_req *r) | ||
55 | +static int do_attach(const char *node, struct ubi_attach_req *r) | ||
56 | { | ||
57 | int fd, ret; | ||
58 | |||
59 | @@ -1115,12 +1115,12 @@ int ubi_rsvol(libubi_t desc, const char *node, int vol_id, long long bytes) | ||
60 | |||
61 | int ubi_vol_block_create(int fd) | ||
62 | { | ||
63 | - return ioctl(fd, UBI_IOCVOLCRBLK); | ||
64 | + return ioctl(fd, UBI_IOCVOLCRBLK, NULL); | ||
65 | } | ||
66 | |||
67 | int ubi_vol_block_remove(int fd) | ||
68 | { | ||
69 | - return ioctl(fd, UBI_IOCVOLRMBLK); | ||
70 | + return ioctl(fd, UBI_IOCVOLRMBLK, NULL); | ||
71 | } | ||
72 | |||
73 | int ubi_update_start(libubi_t desc, int fd, long long bytes) | ||
74 | -- | ||
75 | 1.9.1 | ||
76 | |||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0004-common.h-klibc-fixes-1.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0004-common.h-klibc-fixes-1.patch new file mode 100644 index 000000000..fee1cbcf9 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0004-common.h-klibc-fixes-1.patch | |||
@@ -0,0 +1,84 @@ | |||
1 | From e56767b9caa02e7c41803499c77dc939d5a7f64a Mon Sep 17 00:00:00 2001 | ||
2 | From: Thorsten Glaser <tg@mirbsd.org> | ||
3 | Date: Fri, 20 Jun 2014 10:56:27 +0000 | ||
4 | Subject: [PATCH 4/6] Restore compatibility to dietlibc, klibc, musl libc after commit 4f1b108 | ||
5 | |||
6 | Each C library has their own way to define off_t, and the <features.h> | ||
7 | header is nonstandard and specific to the GNU libc and those that clone | ||
8 | it (uClibc). Fefe’s dietlibc uses different flags, and klibc always uses | ||
9 | a 64-bit off_t (like the BSDs); musl libc cannot be recognised using cpp | ||
10 | instructions, so we assume 64 bit there (and on unknown C libraries) and | ||
11 | leave it to the user to submit a follow-up fix if we guess wrong. I also | ||
12 | added a static assertion to verify the 64 bit guess is correct. | ||
13 | |||
14 | It would be really better using a configure script for this instead. | ||
15 | |||
16 | Fixes: | ||
17 | | CC lib/libmtd.o | ||
18 | | In file included from ubi-utils/ubiutils-common.c:35:0: | ||
19 | | ./include/common.h:29:22: fatal error: features.h: No such file or directory | ||
20 | | #include <features.h> | ||
21 | | ^ | ||
22 | | compilation terminated. | ||
23 | |||
24 | Upstream-Status: Pending | ||
25 | |||
26 | Signed-off-by: Thorsten Glaser <tg@mirbsd.org> | ||
27 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
28 | --- | ||
29 | include/common.h | 24 ++++++++++++++++++++++++ | ||
30 | 1 file changed, 24 insertions(+) | ||
31 | |||
32 | diff --git a/include/common.h b/include/common.h | ||
33 | index 6895e5c..77f3f7d 100644 | ||
34 | --- a/include/common.h | ||
35 | +++ b/include/common.h | ||
36 | @@ -26,7 +26,9 @@ | ||
37 | #include <string.h> | ||
38 | #include <fcntl.h> | ||
39 | #include <errno.h> | ||
40 | +#if defined(__GLIBC__) || defined(__UCLIBC__) | ||
41 | #include <features.h> | ||
42 | +#endif | ||
43 | #include <inttypes.h> | ||
44 | #include "version.h" | ||
45 | |||
46 | @@ -52,6 +54,21 @@ extern "C" { | ||
47 | #endif | ||
48 | |||
49 | /* define a print format specifier for off_t */ | ||
50 | +#if defined(__KLIBC__) | ||
51 | +/* always 64 bit on klibc */ | ||
52 | +#define PRIxoff_t PRIx64 | ||
53 | +#define PRIdoff_t PRId64 | ||
54 | +#elif defined(__dietlibc__) | ||
55 | +/* depends on compiler flags on dietlibc */ | ||
56 | +#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) | ||
57 | +#define PRIxoff_t PRIx64 | ||
58 | +#define PRIdoff_t PRId64 | ||
59 | +#else | ||
60 | +#define PRIxoff_t "l"PRIx32 | ||
61 | +#define PRIdoff_t "l"PRId32 | ||
62 | +#endif | ||
63 | +#elif defined(__GLIBC__) || defined(__UCLIBC__) | ||
64 | +/* depends on compiler flags on glibc and uClibc */ | ||
65 | #ifdef __USE_FILE_OFFSET64 | ||
66 | #define PRIxoff_t PRIx64 | ||
67 | #define PRIdoff_t PRId64 | ||
68 | @@ -59,6 +76,13 @@ extern "C" { | ||
69 | #define PRIxoff_t "l"PRIx32 | ||
70 | #define PRIdoff_t "l"PRId32 | ||
71 | #endif | ||
72 | +#else | ||
73 | +/* unknown libc or musl */ | ||
74 | +#define PRIxoff_t PRIx64 | ||
75 | +#define PRIdoff_t PRId64 | ||
76 | +/* verify our guess of 64 bit is correct */ | ||
77 | +static char __PRIxoff_t_static_assert[sizeof(off_t) == 8 ? 1 : -1]; | ||
78 | +#endif | ||
79 | |||
80 | /* Verbose messages */ | ||
81 | #define bareverbose(verbose, fmt, ...) do { \ | ||
82 | -- | ||
83 | 1.9.1 | ||
84 | |||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0005-common.h-klibc-fixes-2.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0005-common.h-klibc-fixes-2.patch new file mode 100644 index 000000000..2e43d5d97 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0005-common.h-klibc-fixes-2.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 8318852ef4f768bed31072aa7b57e11adc1f639c Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
3 | Date: Sun, 29 Jun 2014 00:44:03 +0200 | ||
4 | Subject: [PATCH 5/6] common.h: more workarounds for klibc compatibility | ||
5 | |||
6 | Patch is addressing two issues: | ||
7 | * First, Klibc doesn't have rpmatch(). | ||
8 | * Second, Klibc lacks getline() | ||
9 | |||
10 | Fixes: | ||
11 | | LD ubi-utils/ubiformat | ||
12 | | .../git/ubi-utils/ubiformat.o: In function `prompt': | ||
13 | | .../git/./include/common.h:157: undefined reference to `getline' | ||
14 | | .../git/./include/common.h:164: undefined reference to `rpmatch' | ||
15 | | .../git/./include/common.h:157: undefined reference to `getline' | ||
16 | | .../git/./include/common.h:164: undefined reference to `rpmatch' | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | |||
20 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
21 | --- | ||
22 | include/common.h | 10 ++++++---- | ||
23 | 1 file changed, 6 insertions(+), 4 deletions(-) | ||
24 | |||
25 | diff --git a/include/common.h b/include/common.h | ||
26 | index 77f3f7d..2cbee0f 100644 | ||
27 | --- a/include/common.h | ||
28 | +++ b/include/common.h | ||
29 | @@ -126,7 +126,7 @@ static char __PRIxoff_t_static_assert[sizeof(off_t) == 8 ? 1 : -1]; | ||
30 | fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \ | ||
31 | } while(0) | ||
32 | |||
33 | -#if defined(__UCLIBC__) | ||
34 | +#if defined(__UCLIBC__) || defined(__KLIBC__) | ||
35 | /* uClibc versions before 0.9.34 don't have rpmatch() */ | ||
36 | #if __UCLIBC_MAJOR__ == 0 && \ | ||
37 | (__UCLIBC_MINOR__ < 9 || \ | ||
38 | @@ -146,15 +146,17 @@ static inline int __rpmatch(const char *resp) | ||
39 | */ | ||
40 | static inline bool prompt(const char *msg, bool def) | ||
41 | { | ||
42 | - char *line = NULL; | ||
43 | - size_t len; | ||
44 | + char *line; | ||
45 | bool ret = def; | ||
46 | |||
47 | + const int sizeof_line = 2; | ||
48 | + line = malloc(sizeof_line); | ||
49 | + | ||
50 | do { | ||
51 | normsg_cont("%s (%c/%c) ", msg, def ? 'Y' : 'y', def ? 'n' : 'N'); | ||
52 | fflush(stdout); | ||
53 | |||
54 | - while (getline(&line, &len, stdin) == -1) { | ||
55 | + while (fgets(line, sizeof_line, stdin) == NULL) { | ||
56 | printf("failed to read prompt; assuming '%s'\n", | ||
57 | def ? "yes" : "no"); | ||
58 | break; | ||
59 | -- | ||
60 | 1.9.1 | ||
61 | |||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0006-libiniparser-remove-unused-function-needing-float.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0006-libiniparser-remove-unused-function-needing-float.patch new file mode 100644 index 000000000..043a89d67 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/0006-libiniparser-remove-unused-function-needing-float.patch | |||
@@ -0,0 +1,85 @@ | |||
1 | From 72a04a9b9ed33c889d2e2b86f306c5be9f6cde35 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
3 | Date: Sun, 29 Jun 2014 00:44:57 +0200 | ||
4 | Subject: [PATCH 6/6] libiniparser: remove unused function needing float | ||
5 | |||
6 | Fixes: | ||
7 | | LD ubi-utils/ubiformat | ||
8 | | .../git/ubi-utils/libiniparser.a(libiniparser.o): In function | ||
9 | | ` LD ubi-utils/ubirename | ||
10 | | iniparser_getdouble': | ||
11 | | .../git/ubi-utils/libiniparser.c:336: undefined reference to `atof' | ||
12 | |||
13 | Grep doesn't reveal any occurrence of iniparser_getdouble(), using atof() so | ||
14 | remove it: floating-point is not supported in klibc | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | |||
18 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
19 | --- | ||
20 | ubi-utils/include/libiniparser.h | 15 --------------- | ||
21 | ubi-utils/libiniparser.c | 22 ---------------------- | ||
22 | 2 files changed, 37 deletions(-) | ||
23 | |||
24 | diff --git a/ubi-utils/include/libiniparser.h b/ubi-utils/include/libiniparser.h | ||
25 | index be3c667..abd77aa 100644 | ||
26 | --- a/ubi-utils/include/libiniparser.h | ||
27 | +++ b/ubi-utils/include/libiniparser.h | ||
28 | @@ -158,21 +158,6 @@ int iniparser_getint(dictionary * d, const char * key, int notfound); | ||
29 | |||
30 | /*-------------------------------------------------------------------------*/ | ||
31 | /** | ||
32 | - @brief Get the string associated to a key, convert to a double | ||
33 | - @param d Dictionary to search | ||
34 | - @param key Key string to look for | ||
35 | - @param notfound Value to return in case of error | ||
36 | - @return double | ||
37 | - | ||
38 | - This function queries a dictionary for a key. A key as read from an | ||
39 | - ini file is given as "section:key". If the key cannot be found, | ||
40 | - the notfound value is returned. | ||
41 | - */ | ||
42 | -/*--------------------------------------------------------------------------*/ | ||
43 | -double iniparser_getdouble(dictionary * d, char * key, double notfound); | ||
44 | - | ||
45 | -/*-------------------------------------------------------------------------*/ | ||
46 | -/** | ||
47 | @brief Get the string associated to a key, convert to a boolean | ||
48 | @param d Dictionary to search | ||
49 | @param key Key string to look for | ||
50 | diff --git a/ubi-utils/libiniparser.c b/ubi-utils/libiniparser.c | ||
51 | index 898f57f..ba70c08 100644 | ||
52 | --- a/ubi-utils/libiniparser.c | ||
53 | +++ b/ubi-utils/libiniparser.c | ||
54 | @@ -316,28 +316,6 @@ int iniparser_getint(dictionary * d, const char * key, int notfound) | ||
55 | |||
56 | /*-------------------------------------------------------------------------*/ | ||
57 | /** | ||
58 | - @brief Get the string associated to a key, convert to a double | ||
59 | - @param d Dictionary to search | ||
60 | - @param key Key string to look for | ||
61 | - @param notfound Value to return in case of error | ||
62 | - @return double | ||
63 | - | ||
64 | - This function queries a dictionary for a key. A key as read from an | ||
65 | - ini file is given as "section:key". If the key cannot be found, | ||
66 | - the notfound value is returned. | ||
67 | - */ | ||
68 | -/*--------------------------------------------------------------------------*/ | ||
69 | -double iniparser_getdouble(dictionary * d, char * key, double notfound) | ||
70 | -{ | ||
71 | - char * str ; | ||
72 | - | ||
73 | - str = iniparser_getstring(d, key, INI_INVALID_KEY); | ||
74 | - if (str==INI_INVALID_KEY) return notfound ; | ||
75 | - return atof(str); | ||
76 | -} | ||
77 | - | ||
78 | -/*-------------------------------------------------------------------------*/ | ||
79 | -/** | ||
80 | @brief Get the string associated to a key, convert to a boolean | ||
81 | @param d Dictionary to search | ||
82 | @param key Key string to look for | ||
83 | -- | ||
84 | 1.9.1 | ||
85 | |||
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb new file mode 100644 index 000000000..8ca1ca727 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb | |||
@@ -0,0 +1,50 @@ | |||
1 | SUMMARY = "UBI utils statically compiled against klibc" | ||
2 | DESCRIPTION = "Small sized tools from mtd-utils for use with initramfs." | ||
3 | SECTION = "base" | ||
4 | DEPENDS = "zlib lzo e2fsprogs util-linux" | ||
5 | HOMEPAGE = "http://www.linux-mtd.infradead.org/" | ||
6 | LICENSE = "GPLv2+" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | ||
8 | file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c" | ||
9 | |||
10 | inherit klibc | ||
11 | |||
12 | SRC_URI = "git://git.infradead.org/mtd-utils.git;tag=b7455d847ab4f9eeeb6a729efc306bfda7bddc99 \ | ||
13 | file://0001-Makefile-only-build-ubi-utils.patch \ | ||
14 | file://0002-common.mk-for-klibc-CC-is-klcc.patch \ | ||
15 | file://0003-libubi.c-add-klibc-specific-fixes.patch \ | ||
16 | file://0004-common.h-klibc-fixes-1.patch \ | ||
17 | file://0005-common.h-klibc-fixes-2.patch \ | ||
18 | file://0006-libiniparser-remove-unused-function-needing-float.patch \ | ||
19 | " | ||
20 | |||
21 | S = "${WORKDIR}/git/" | ||
22 | |||
23 | EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}include -DWITHOUT_XATTR' 'BUILDDIR=${S}'" | ||
24 | |||
25 | do_install () { | ||
26 | |||
27 | install -d ${D}${sbindir} | ||
28 | oe_runmake DESTDIR="${D}" install | ||
29 | |||
30 | } | ||
31 | |||
32 | PACKAGES = "ubi-utils-klibc-dbg" | ||
33 | |||
34 | PACKAGES =+ "mtdinfo-klibc ubiattach-klibc ubiblock-klibc ubicrc32-klibc ubidetach-klibc \ | ||
35 | ubiformat-klibc ubimkvol-klibc ubinfo-klibc ubinize-klibc ubirename-klibc \ | ||
36 | ubirmvol-klibc ubirsvol-klibc ubiupdatevol-klibc" | ||
37 | |||
38 | FILES_mtdinfo-klibc = "${sbindir}/mtdinfo" | ||
39 | FILES_ubiattach-klibc = "${sbindir}/ubiattach" | ||
40 | FILES_ubiblock-klibc = "${sbindir}/ubiblock" | ||
41 | FILES_ubicrc32-klibc = "${sbindir}/ubicrc32" | ||
42 | FILES_ubidetach-klibc = "${sbindir}/ubidetach" | ||
43 | FILES_ubiformat-klibc = "${sbindir}/ubiformat" | ||
44 | FILES_ubimkvol-klibc = "${sbindir}/ubimkvol" | ||
45 | FILES_ubinfo-klibc = "${sbindir}/ubinfo" | ||
46 | FILES_ubinize-klibc = "${sbindir}/ubinize" | ||
47 | FILES_ubirename-klibc = "${sbindir}/ubirename" | ||
48 | FILES_ubirmvol-klibc = "${sbindir}/ubirmvol" | ||
49 | FILES_ubirsvol-klibc = "${sbindir}/ubirsvol" | ||
50 | FILES_ubiupdatevol-klibc = "${sbindir}/ubiupdatevol" | ||