summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/mtd')
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch28
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch63
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch2
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch25
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch26
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils_git.bb35
6 files changed, 150 insertions, 29 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch b/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
new file mode 100644
index 0000000000..bf3f98f14d
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
@@ -0,0 +1,28 @@
+From 4dab9bed1033f797ef9b482c77342fe3fe26d0be Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 6 Oct 2015 23:51:34 +0000
+Subject: [PATCH] Fix build with musl
+
+Upstream-Status: Backport
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+---
+ jffsX-utils/mkfs.jffs2.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c
+index 5446a16..ca5e0d5 100644
+--- a/jffsX-utils/mkfs.jffs2.c
++++ b/jffsX-utils/mkfs.jffs2.c
+@@ -72,6 +72,7 @@
+ #include <byteswap.h>
+ #include <crc32.h>
+ #include <inttypes.h>
++#include <limits.h>
+
+ #include "rbtree.h"
+ #include "common.h"
+--
+2.6.1
+
diff --git a/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch b/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
new file mode 100644
index 0000000000..853de6af98
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
@@ -0,0 +1,63 @@
+From 82839c3c0371ca2a1643a99d7d01f5bc1c850b28 Mon Sep 17 00:00:00 2001
+From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+Date: Thu, 2 Mar 2017 11:40:36 +0100
+Subject: [PATCH] Replace rpmatch() usage with checking first character of line
+
+This is based on the patch from Khem Raj used by openembedded. In
+addition to the original patch, this also removes the fallback
+implementation that was provided for C libraries that don't implement
+rpmatch.
+
+Upstream-Status: Backport
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+---
+ include/common.h | 25 ++++++-------------------
+ 1 file changed, 6 insertions(+), 19 deletions(-)
+
+diff --git a/include/common.h b/include/common.h
+index d0c706d..d609257 100644
+--- a/include/common.h
++++ b/include/common.h
+@@ -129,21 +129,6 @@ extern "C" {
+ fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \
+ } while(0)
+
+-/* uClibc versions before 0.9.34 and musl don't have rpmatch() */
+-#if defined(__UCLIBC__) && \
+- (__UCLIBC_MAJOR__ == 0 && \
+- (__UCLIBC_MINOR__ < 9 || \
+- (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 34))) || \
+- !defined(__GLIBC__)
+-#undef rpmatch
+-#define rpmatch __rpmatch
+-static inline int __rpmatch(const char *resp)
+-{
+- return (resp[0] == 'y' || resp[0] == 'Y') ? 1 :
+- (resp[0] == 'n' || resp[0] == 'N') ? 0 : -1;
+-}
+-#endif
+-
+ /**
+ * prompt the user for confirmation
+ */
+@@ -164,10 +149,12 @@ static inline bool prompt(const char *msg, bool def)
+ }
+
+ if (strcmp("\n", line) != 0) {
+- switch (rpmatch(line)) {
+- case 0: ret = false; break;
+- case 1: ret = true; break;
+- case -1:
++ switch (line[0]) {
++ case 'N':
++ case 'n': ret = false; break;
++ case 'Y':
++ case 'y': ret = true; break;
++ default:
+ puts("unknown response; please try again");
+ continue;
+ }
+--
+2.6.1
diff --git a/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch b/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
index 57d6a30d82..0e3776af04 100644
--- a/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
+++ b/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
@@ -1,7 +1,7 @@
Upstream-Status: Pending
--- /tmp/mkfs.jffs2.c 2009-01-11 15:28:41.000000000 +0100
-+++ git/mkfs.jffs2.c 2009-01-11 15:59:29.000000000 +0100
++++ git/jffsX-utils/mkfs.jffs2.c 2009-01-11 15:59:29.000000000 +0100
@@ -100,6 +100,11 @@
struct rb_node hardlink_rb;
};
diff --git a/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
index 05f1629d58..6fc594f00b 100644
--- a/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
+++ b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
@@ -1,16 +1,25 @@
-Upstream-Status: Pending
+From 7d026a85946a08b8167dcd792ea6660bf6a49e08 Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+Date: Thu, 2 Mar 2017 10:43:56 +0100
+Subject: [PATCH] Fix alignment trap triggered by NEON instructions
NEON instruction VLD1.64 was used to copy 64 bits data after type
casting, and they will trigger alignment trap.
This patch uses memcpy to avoid alignment problem.
+Upstream-Status: Backport
+
Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+---
+ ubifs-utils/mkfs.ubifs/key.h | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
-diff --git a/mkfs.ubifs/key.h b/mkfs.ubifs/key.h
-index d3a02d4..e7e9218 100644
---- a/mkfs.ubifs/key.h
-+++ b/mkfs.ubifs/key.h
-@@ -141,10 +141,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
+diff --git a/ubifs-utils/mkfs.ubifs/key.h b/ubifs-utils/mkfs.ubifs/key.h
+index 39379fd..118858b 100644
+--- a/ubifs-utils/mkfs.ubifs/key.h
++++ b/ubifs-utils/mkfs.ubifs/key.h
+@@ -159,10 +159,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
*/
static inline void key_write(const union ubifs_key *from, void *to)
{
@@ -26,7 +35,7 @@ index d3a02d4..e7e9218 100644
memset(to + 8, 0, UBIFS_MAX_KEY_LEN - 8);
}
-@@ -156,10 +158,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
+@@ -174,10 +176,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
*/
static inline void key_write_idx(const union ubifs_key *from, void *to)
{
@@ -42,3 +51,5 @@ index d3a02d4..e7e9218 100644
}
/**
+--
+2.6.1
diff --git a/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch b/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
index a66087e301..0f42e73e9a 100644
--- a/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
+++ b/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
@@ -36,6 +36,10 @@ JFFS2: Erase block at 0x00028000 is not formatted. It will be erased
Signed-off-by: Liu Shuo <b35362@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
+Updated for the new version
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
---
v2 : get length of availble freeoob bytes from oobinfo information,
not use the ioctl ECCGETLAYOUT which is being deprecated.
@@ -44,18 +48,18 @@ v2 : get length of availble freeoob bytes from oobinfo information,
1 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/flash_erase.c b/flash_erase.c
-index fe2eaca..3e94495 100644
---- a/flash_erase.c
-+++ b/flash_erase.c
-@@ -98,6 +98,7 @@ int main(int argc, char *argv[])
- int isNAND;
+index 933373a..4b9d84b 100644
+--- a/misc-utils/flash_erase.c
++++ b/misc-utils/flash_erase.c
+@@ -99,6 +99,7 @@ int main(int argc, char *argv[])
+ bool isNAND;
int error = 0;
- uint64_t offset = 0;
+ off_t offset = 0;
+ void *oob_data = NULL;
/*
* Process user arguments
-@@ -197,15 +198,43 @@ int main(int argc, char *argv[])
+@@ -201,15 +202,43 @@ int main(int argc, char *argv[])
if (ioctl(fd, MEMGETOOBSEL, &oobinfo) != 0)
return sys_errmsg("%s: unable to get NAND oobinfo", mtd_device);
@@ -104,7 +108,7 @@ index fe2eaca..3e94495 100644
} else {
/* Legacy mode */
switch (mtd.oob_size) {
-@@ -223,7 +252,6 @@ int main(int argc, char *argv[])
+@@ -227,7 +256,6 @@ int main(int argc, char *argv[])
break;
}
}
@@ -112,13 +116,13 @@ index fe2eaca..3e94495 100644
}
cleanmarker.hdr_crc = cpu_to_je32(mtd_crc32(0, &cleanmarker, sizeof(cleanmarker) - 4));
}
-@@ -272,7 +300,8 @@ int main(int argc, char *argv[])
+@@ -276,7 +304,8 @@ int main(int argc, char *argv[])
/* write cleanmarker */
if (isNAND) {
-- if (mtd_write_oob(mtd_desc, &mtd, fd, offset + clmpos, clmlen, &cleanmarker) != 0) {
+- if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, &cleanmarker) != 0) {
+ void *data = oob_data ? oob_data + clmpos : &cleanmarker;
-+ if (mtd_write_oob(mtd_desc, &mtd, fd, offset + clmpos, clmlen, data) != 0) {
++ if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, data) != 0) {
sys_errmsg("%s: MTD writeoob failure", mtd_device);
continue;
}
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb
index 267d1e9407..4fbc54f8f4 100644
--- a/meta/recipes-devtools/mtd/mtd-utils_git.bb
+++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -1,23 +1,34 @@
SUMMARY = "Tools for managing memory technology devices"
-SECTION = "base"
-DEPENDS = "zlib lzo e2fsprogs util-linux"
HOMEPAGE = "http://www.linux-mtd.infradead.org/"
+SECTION = "base"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
-# Use the latest version at 26 Oct, 2013
-SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b"
+inherit autotools pkgconfig
+
+DEPENDS = "zlib lzo e2fsprogs util-linux"
+
+PV = "2.0.0"
+
+SRCREV = "1bfee8660131fca7a18f68e9548a18ca6b3378a0"
SRC_URI = "git://git.infradead.org/mtd-utils.git \
- file://add-exclusion-to-mkfs-jffs2-git-2.patch \
- file://fix-armv7-neon-alignment.patch \
+ file://add-exclusion-to-mkfs-jffs2-git-2.patch \
+ file://fix-armv7-neon-alignment.patch \
+ file://mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch \
+ file://0001-Fix-build-with-musl.patch \
+ file://010-fix-rpmatch.patch \
"
-PV = "1.5.1+git${SRCPV}"
-
S = "${WORKDIR}/git/"
-EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
+# xattr support creates an additional compile-time dependency on acl because
+# the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
+# regardless whether acl is enabled or disabled in the distro should be okay.
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'xattr', d)}"
+PACKAGECONFIG[xattr] = ",,acl,"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"
do_install () {
oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
@@ -29,4 +40,8 @@ FILES_mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/j
FILES_mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
FILES_mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image"
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
+
+# git/.compr.c.dep:46: warning: NUL character seen; rest of line ignored
+# git/.compr.c.dep:47: *** missing separator. Stop.
+PARALLEL_MAKE = ""