mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-15 16:07:26 +00:00
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>
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user