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.patch50
-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/libmtd.c.patch24
-rw-r--r--meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch73
4 files changed, 155 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..2802afe7b
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/Makefile.patch
@@ -0,0 +1,50 @@
1--- a/Makefile 2012-04-29 18:15:30.000000000 +0200
2+++ b/Makefile 2012-04-29 00:43:03.000000000 +0200
3@@ -16,27 +16,11 @@
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+UBI_BINS = ubiupdatevol ubimkvol ubirmvol ubinfo ubiattach ubidetach ubirename mtdinfo ubirsvol
25+
26+BINS = $(addprefix ubi-utils/,$(UBI_BINS))
27
28 TARGETS = $(BINS)
29-TARGETS += lib/libmtd.a
30-TARGETS += ubi-utils/libubi.a
31
32 OBJDEPS = $(BUILDDIR)/include/version.h
33
34@@ -58,7 +42,7 @@
35 rm -f $(BUILDDIR)/include/version.h
36 $(MAKE) -C $(TESTS) clean
37
38-install:: $(addprefix $(BUILDDIR)/,${BINS}) ${SCRIPTS}
39+install:: $(addprefix $(BUILDDIR)/,${BINS})
40 mkdir -p ${DESTDIR}/${SBINDIR}
41 install -m 0755 $^ ${DESTDIR}/${SBINDIR}/
42 mkdir -p ${DESTDIR}/${MANDIR}/man1
43@@ -88,7 +72,6 @@
44 LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS)
45 LDLIBS_jffs2reader = -lz $(LZOLDLIBS)
46
47-$(foreach v,$(MTD_BINS),$(eval $(call mkdep,,$(v))))
48
49 #
50 # 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/libmtd.c.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libmtd.c.patch
new file mode 100644
index 000000000..f32fb70a1
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libmtd.c.patch
@@ -0,0 +1,24 @@
1--- a/lib/libmtd.c 2012-04-29 21:44:52.000000000 +0200
2+++ b/lib/libmtd.c 2012-04-29 21:43:04.000000000 +0200
3@@ -441,8 +441,8 @@
4 return -1;
5 }
6
7- major = major(st.st_rdev);
8- minor = minor(st.st_rdev);
9+ major = __major(st.st_rdev);
10+ minor = __minor(st.st_rdev);
11
12 if (mtd_get_info((libmtd_t *)lib, &info))
13 return -1;
14@@ -1381,8 +1381,8 @@
15 return -1;
16 }
17
18- major = major(st.st_rdev);
19- minor = minor(st.st_rdev);
20+ major = __major(st.st_rdev);
21+ minor = __minor(st.st_rdev);
22
23 if (mtd_get_info((libmtd_t *)lib, &info))
24 return -1;
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..e60385904
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch
@@ -0,0 +1,73 @@
1--- a/ubi-utils/libubi.c 2012-04-29 21:44:52.000000000 +0200
2+++ b/ubi-utils/libubi.c 2012-04-29 21:43:52.000000000 +0200
3@@ -36,6 +36,26 @@
4 #include "libubi_int.h"
5 #include "common.h"
6
7+/* parts of mtd/ubi-user.h */
8+
9+/* Set an UBI volume property */
10+#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
11+
12+/**
13+ * struct ubi_set_prop_req - a data structure used to set an ubi volume
14+ * property.
15+ * @property: property to set (%UBI_PROP_DIRECT_WRITE)
16+ * @padding: reserved for future, not used, has to be zeroed
17+ * @value: value to set
18+ */
19+struct ubi_set_prop_req {
20+ uint8_t property;
21+ uint8_t padding[7];
22+ uint64_t value;
23+} __attribute__ ((packed));
24+
25+/* end parts of mtd/ubi-user.h */
26+
27 /**
28 * mkpath - compose full path from 2 given components.
29 * @path: the first component
30@@ -382,8 +402,8 @@
31 return errmsg("\"%s\" is not a character device", node);
32 }
33
34- major = major(st.st_rdev);
35- minor = minor(st.st_rdev);
36+ major = __major(st.st_rdev);
37+ minor = __minor(st.st_rdev);
38
39 if (minor == 0) {
40 errno = EINVAL;
41@@ -448,8 +468,8 @@
42 return errmsg("\"%s\" is not a character device", node);
43 }
44
45- major = major(st.st_rdev);
46- minor = minor(st.st_rdev);
47+ major = __major(st.st_rdev);
48+ minor = __minor(st.st_rdev);
49
50 if (minor != 0) {
51 errno = EINVAL;
52@@ -757,8 +777,8 @@
53 mtd_dev_node);
54 }
55
56- major = major(sb.st_rdev);
57- minor = minor(sb.st_rdev);
58+ major = __major(sb.st_rdev);
59+ minor = __minor(sb.st_rdev);
60
61 if (major != MTD_CHAR_MAJOR) {
62 errno = EINVAL;
63@@ -866,8 +886,8 @@
64 return -1;
65 }
66
67- major = major(st.st_rdev);
68- minor = minor(st.st_rdev);
69+ major = __major(st.st_rdev);
70+ minor = __minor(st.st_rdev);
71
72 if (ubi_get_info((libubi_t *)lib, &info))
73 return -1;