summaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc
diff options
context:
space:
mode:
Diffstat (limited to 'meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc')
-rw-r--r--meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch53
-rw-r--r--meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/common.mk.patch8
-rw-r--r--meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libiniparser.c.patch19
-rw-r--r--meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch28
-rw-r--r--meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/ubiformat.c.patch20
5 files changed, 128 insertions, 0 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
new file mode 100644
index 000000000..b7dad878b
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch
@@ -0,0 +1,53 @@
1--- a/Makefile 2012-05-01 19:46:47.000000000 +0200
2+++ b/Makefile 2012-05-01 19:48:01.000000000 +0200
3@@ -16,27 +16,13 @@
4
5 TESTS = tests
6
7-MTD_BINS = \
8- ftl_format flash_erase nanddump doc_loadbios \
9- ftl_check mkfs.jffs2 flash_lock flash_unlock \
10- flash_otp_info flash_otp_dump mtd_debug flashcp nandwrite nandtest \
11- jffs2dump \
12- nftldump nftl_format docfdisk \
13- rfddump rfdformat \
14- serve_image recv_image \
15- sumtool jffs2reader
16 UBI_BINS = \
17 ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \
18 ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol
19
20-BINS = $(MTD_BINS)
21-BINS += mkfs.ubifs/mkfs.ubifs
22-BINS += $(addprefix ubi-utils/,$(UBI_BINS))
23-SCRIPTS = flash_eraseall
24+BINS = $(addprefix ubi-utils/,$(UBI_BINS))
25
26 TARGETS = $(BINS)
27-TARGETS += lib/libmtd.a
28-TARGETS += ubi-utils/libubi.a
29
30 OBJDEPS = $(BUILDDIR)/include/version.h
31
32@@ -58,12 +44,9 @@
33 rm -f $(BUILDDIR)/include/version.h
34 $(MAKE) -C $(TESTS) clean
35
36-install:: $(addprefix $(BUILDDIR)/,${BINS}) ${SCRIPTS}
37+install:: $(addprefix $(BUILDDIR)/,${BINS})
38 mkdir -p ${DESTDIR}/${SBINDIR}
39 install -m 0755 $^ ${DESTDIR}/${SBINDIR}/
40- mkdir -p ${DESTDIR}/${MANDIR}/man1
41- install -m 0644 mkfs.jffs2.1 ${DESTDIR}/${MANDIR}/man1/
42- -gzip -9f ${DESTDIR}/${MANDIR}/man1/*.1
43
44 tests::
45 $(MAKE) -C $(TESTS)
46@@ -88,7 +71,6 @@
47 LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS)
48 LDLIBS_jffs2reader = -lz $(LZOLDLIBS)
49
50-$(foreach v,$(MTD_BINS),$(eval $(call mkdep,,$(v))))
51
52 #
53 # Common libmtd
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/common.mk.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/common.mk.patch
new file mode 100644
index 000000000..0a48416c0
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/common.mk.patch
@@ -0,0 +1,8 @@
1--- a/common.mk 2012-04-29 18:15:30.000000000 +0200
2+++ b/common.mk 2012-04-29 00:51:53.000000000 +0200
3@@ -1,4 +1,4 @@
4-CC := $(CROSS)gcc
5+CC := $(CROSS)klcc
6 AR := $(CROSS)ar
7 RANLIB := $(CROSS)ranlib
8
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 000000000..45f2439c8
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libiniparser.c.patch
@@ -0,0 +1,19 @@
1--- a/ubi-utils/libiniparser.c 2012-05-29 23:46:08.000000000 +0200
2+++ b/ubi-utils/libiniparser.c 2012-05-29 23:45:01.000000000 +0200
3@@ -327,6 +327,8 @@
4 the notfound value is returned.
5 */
6 /*--------------------------------------------------------------------------*/
7+/* Floating-point is not supported in klibc */
8+/*
9 double iniparser_getdouble(dictionary * d, char * key, double notfound)
10 {
11 char * str ;
12@@ -335,6 +337,7 @@
13 if (str==INI_INVALID_KEY) return notfound ;
14 return atof(str);
15 }
16+*/
17
18 /*-------------------------------------------------------------------------*/
19 /**
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
new file mode 100644
index 000000000..b52e20789
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch
@@ -0,0 +1,28 @@
1--- a/ubi-utils/libubi.c 2012-05-01 01:57:51.000000000 +0200
2+++ b/ubi-utils/libubi.c 2012-05-01 01:55:14.000000000 +0200
3@@ -686,7 +706,7 @@
4 * success and %-1 in case of failure. @r->ubi_num contains newly created UBI
5 * device number.
6 */
7-static int do_attach(const char *node, const struct ubi_attach_req *r)
8+static int do_attach(const char *node, struct ubi_attach_req *r)
9 {
10 int fd, ret;
11
12@@ -1346,13 +1346,13 @@
13
14 int ubi_set_property(int fd, uint8_t property, uint64_t value)
15 {
16- struct ubi_set_prop_req r;
17+ struct ubi_set_vol_prop_req r;
18
19- memset(&r, 0, sizeof(struct ubi_set_prop_req));
20+ memset(&r, 0, sizeof(struct ubi_set_vol_prop_req));
21 r.property = property;
22 r.value = value;
23
24- return ioctl(fd, UBI_IOCSETPROP, &r);
25+ return ioctl(fd, UBI_IOCSETVOLPROP, &r);
26 }
27
28 int ubi_leb_unmap(int fd, int lnum)
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 000000000..d21ed577b
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/ubiformat.c.patch
@@ -0,0 +1,20 @@
1--- a/ubi-utils/ubiformat.c 2012-05-03 01:14:39.000000000 +0200
2+++ b/ubi-utils/ubiformat.c 2012-05-20 23:11:57.000000000 +0200
3@@ -246,7 +246,7 @@
4
5 while (1) {
6 normsg_cont("continue? (yes/no) ");
7- if (scanf("%3s", buf) == EOF) {
8+ if (fgets(buf,4,stdin) == NULL) {
9 sys_errmsg("scanf returned unexpected EOF, assume \"yes\"");
10 return 1;
11 }
12@@ -262,7 +262,7 @@
13 char buf[4];
14
15 while (1) {
16- if (scanf("%3s", buf) == EOF) {
17+ if (fgets(buf,4,stdin) == NULL) {
18 sys_errmsg("scanf returned unexpected EOF, assume \"no\"");
19 return 0;
20 }