summaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/mtd
diff options
context:
space:
mode:
authorAndrea Adami <andrea.adami@gmail.com>2012-04-29 22:51:33 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2012-04-30 10:16:17 +0200
commit00bf241a99aab5003993fb2107d72f02b7377470 (patch)
tree06d01a8584d2629553bb1daee714ab07040536fc /meta-initramfs/recipes-devtools/mtd
parent8f9b2e3a102e66426ce5b269a6827fc6a3218bef (diff)
downloadmeta-openembedded-00bf241a99aab5003993fb2107d72f02b7377470.tar.gz
ubi-utils-klibc: initial commit of version 1.4.9
* Initially only ubiattach was targeted (for kexecboot project). * Based on klibc_1.5.25, will be revised once new klibc is out. 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')
-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
-rw-r--r--meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.4.9.bb53
5 files changed, 208 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;
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.4.9.bb b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.4.9.bb
new file mode 100644
index 000000000..da0efc0fc
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.4.9.bb
@@ -0,0 +1,53 @@
1DESCRIPTION = "Tools for managing memory technology devices."
2SECTION = "base"
3DEPENDS = "zlib lzo e2fsprogs util-linux"
4HOMEPAGE = "http://www.linux-mtd.infradead.org/"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
7 file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
8
9
10PR = "r0"
11
12inherit klibc
13
14# ubicrc32 needs 'feof' (in klibc_2.0)
15# ubinize needs 'atof'
16# ubiformat needs 'scanf'equivalent for klibc
17
18SRC_URI = "git://git.infradead.org/mtd-utils.git;protocol=git;tag=995cfe51b0a3cf32f381c140bf72b21bf91cef1b \
19 file://Makefile.patch \
20 file://common.mk.patch \
21 file://libmtd.c.patch \
22 file://libubi.c.patch \
23 "
24
25S = "${WORKDIR}/git/"
26
27EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}include -I${S}ubi-utils/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
28
29do_install () {
30 install -d ${D}${sbindir}
31 install -m 755 ubi-utils/ubinfo ${D}${sbindir}/ubinfo
32 install -m 755 ubi-utils/ubiattach ${D}${sbindir}/ubiattach
33 install -m 755 ubi-utils/ubidetach ${D}${sbindir}/ubidetach
34 install -m 755 ubi-utils/mtdinfo ${D}${sbindir}/mtdinfo
35 install -m 755 ubi-utils/ubiupdatevol ${D}${sbindir}/ubiupdatevol
36 install -m 755 ubi-utils/ubimkvol ${D}${sbindir}/ubimkvol
37 install -m 755 ubi-utils/ubirename ${D}${sbindir}/ubirename
38 install -m 755 ubi-utils/ubirmvol ${D}${sbindir}/ubirmvol
39 install -m 755 ubi-utils/ubirsvol ${D}${sbindir}/ubirsvol
40}
41
42PACKAGES =+ "ubinfo-klibc ubiattach-klibc ubidetach-klibc mtdinfo-klibc ubiupdatevol-klibc \
43 ubimkvol-klibc ubirename-klibc ubirmvol-klibc ubirsvol-klibc"
44
45FILES_ubinfo-klibc = "${sbindir}/ubinfo"
46FILES_ubiattach-klibc = "${sbindir}/ubiattach"
47FILES_ubidetach-klibc = "${sbindir}/ubidetach"
48FILES_mtdinfo-klibc = "${sbindir}/mtdinfo"
49FILES_ubiupdatevol-klibc = "${sbindir}/ubiupdatevol"
50FILES_ubimkvol-klibc = "${sbindir}/ubimkvol"
51FILES_ubirename-klibc = "${sbindir}/ubirename"
52FILES_ubirmvol-klibc = "${sbindir}/ubirmvol"
53FILES_ubirsvol-klibc = "${sbindir}/ubirsvol"