diff options
author | Andrea Adami <andrea.adami@gmail.com> | 2012-05-02 23:53:00 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-05-10 16:38:14 +0200 |
commit | 3ba480f4b53d564be73f770db05d449da065efc6 (patch) | |
tree | 23aca2c1a8cf817774008f0804004d912d8710e8 /meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc | |
parent | 32d316edae416b88159472a3b4f904a830090000 (diff) | |
download | meta-openembedded-contrib-3ba480f4b53d564be73f770db05d449da065efc6.tar.gz |
ubi-utils-klibc: add the remaining ubicrc32, ubinize, ubiformat
* add more hacks to compile
* binaries tested on Zaurus poodle/corgi (with patched kernel)
* bump PR
* NOTES
* strange behavior wrt getopt for at least ubiformat:
* you should pass the options first, i.e.
* ubiformat -O 512 /dev/mtd3 *works*
* ubiformat /dev/mtd3 -O 512 *fails*
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc')
4 files changed, 69 insertions, 14 deletions
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch index 2802afe7b1..b7dad878bd 100644 --- a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch @@ -1,6 +1,6 @@ ---- a/Makefile 2012-04-29 18:15:30.000000000 +0200 -+++ b/Makefile 2012-04-29 00:43:03.000000000 +0200 -@@ -16,27 +16,11 @@ +--- a/Makefile 2012-05-01 19:46:47.000000000 +0200 ++++ b/Makefile 2012-05-01 19:48:01.000000000 +0200 +@@ -16,27 +16,13 @@ TESTS = tests @@ -13,16 +13,14 @@ - rfddump rfdformat \ - serve_image recv_image \ - sumtool jffs2reader --UBI_BINS = \ -- ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \ -- ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol -- + UBI_BINS = \ + ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \ + ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol + -BINS = $(MTD_BINS) -BINS += mkfs.ubifs/mkfs.ubifs -BINS += $(addprefix ubi-utils/,$(UBI_BINS)) -SCRIPTS = flash_eraseall -+UBI_BINS = ubiupdatevol ubimkvol ubirmvol ubinfo ubiattach ubidetach ubirename mtdinfo ubirsvol -+ +BINS = $(addprefix ubi-utils/,$(UBI_BINS)) TARGETS = $(BINS) @@ -31,7 +29,7 @@ OBJDEPS = $(BUILDDIR)/include/version.h -@@ -58,7 +42,7 @@ +@@ -58,12 +44,9 @@ rm -f $(BUILDDIR)/include/version.h $(MAKE) -C $(TESTS) clean @@ -39,8 +37,13 @@ +install:: $(addprefix $(BUILDDIR)/,${BINS}) mkdir -p ${DESTDIR}/${SBINDIR} install -m 0755 $^ ${DESTDIR}/${SBINDIR}/ - mkdir -p ${DESTDIR}/${MANDIR}/man1 -@@ -88,7 +72,6 @@ +- mkdir -p ${DESTDIR}/${MANDIR}/man1 +- install -m 0644 mkfs.jffs2.1 ${DESTDIR}/${MANDIR}/man1/ +- -gzip -9f ${DESTDIR}/${MANDIR}/man1/*.1 + + tests:: + $(MAKE) -C $(TESTS) +@@ -88,7 +71,6 @@ LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS) LDLIBS_jffs2reader = -lz $(LZOLDLIBS) diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libiniparser.c.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libiniparser.c.patch new file mode 100644 index 0000000000..8be8ac32aa --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libiniparser.c.patch @@ -0,0 +1,13 @@ +--- a/ubi-utils/libiniparser.c 2012-04-30 23:59:40.000000000 +0200 ++++ b/ubi-utils/libiniparser.c 2012-04-30 23:55:15.000000000 +0200 +@@ -333,7 +333,9 @@ + + str = iniparser_getstring(d, key, INI_INVALID_KEY); + if (str==INI_INVALID_KEY) return notfound ; +- return atof(str); ++ double value; ++ sscanf(str,"%lf",&value); ++ return value; + } + + /*-------------------------------------------------------------------------*/ diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch index e60385904b..97c4fa3abf 100644 --- a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch @@ -1,5 +1,5 @@ ---- a/ubi-utils/libubi.c 2012-04-29 21:44:52.000000000 +0200 -+++ b/ubi-utils/libubi.c 2012-04-29 21:43:52.000000000 +0200 +--- a/ubi-utils/libubi.c 2012-05-01 01:57:51.000000000 +0200 ++++ b/ubi-utils/libubi.c 2012-05-01 01:55:14.000000000 +0200 @@ -36,6 +36,26 @@ #include "libubi_int.h" #include "common.h" @@ -49,6 +49,15 @@ if (minor != 0) { errno = EINVAL; +@@ -686,7 +706,7 @@ + * success and %-1 in case of failure. @r->ubi_num contains newly created UBI + * device number. + */ +-static int do_attach(const char *node, const struct ubi_attach_req *r) ++static int do_attach(const char *node, struct ubi_attach_req *r) + { + int fd, ret; + @@ -757,8 +777,8 @@ mtd_dev_node); } diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/ubiformat.c.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/ubiformat.c.patch new file mode 100644 index 0000000000..7539d76e38 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/ubiformat.c.patch @@ -0,0 +1,30 @@ +--- a/ubi-utils/ubiformat.c 2012-05-03 01:14:39.000000000 +0200 ++++ b/ubi-utils/ubiformat.c 2012-05-03 01:00:57.000000000 +0200 +@@ -246,7 +246,11 @@ + + while (1) { + normsg_cont("continue? (yes/no) "); +- if (scanf("%3s", buf) == EOF) { ++ ++ fflush(stderr); ++ fflush(stdout); ++ ++ if (fgets(buf,4,stdin) == NULL) { + sys_errmsg("scanf returned unexpected EOF, assume \"yes\""); + return 1; + } +@@ -259,10 +263,13 @@ + + static int answer_is_yes(void) + { ++ fflush(stderr); ++ fflush(stdout); ++ + char buf[4]; + + while (1) { +- if (scanf("%3s", buf) == EOF) { ++ if (fgets(buf,4,stdin) == NULL) { + sys_errmsg("scanf returned unexpected EOF, assume \"no\""); + return 0; + } |