summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/mtd/mtd-utils
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2018-02-18 19:21:19 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-02-24 10:31:46 +0000
commitd87f108f40db0cd1a780835ef1d4b666cd7e10f5 (patch)
tree30aef46a5a8bcfebed5545c1da3929e488bc3c3c /meta/recipes-devtools/mtd/mtd-utils
parent20ba50bc8ce353e772f8af37958087e838973172 (diff)
downloadpoky-d87f108f40db0cd1a780835ef1d4b666cd7e10f5.tar.gz
mtd-utils: Bump revision to 1bfee866
This bumps the version to 2.0.1 release plus some more changes. The following patches were merged upstream: - 0001-Fix-build-with-musl.patch - 010-fix-rpmatch.patch - fix-armv7-neon-alignment.patch The `mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch` patch has been removed as the issue seems to have been addressed in the Linux MTD subsystem. The discussion can be seen at: http://lists.infradead.org/pipermail/linux-mtd/2011-August/037320.html Also a research to see if any other distribution had a similar patch included and they don't. So there is no clear need to keep diverging from upstream. See the logs below: ,----[ Changes from 2.0.0 -> 2.0.1 ] | 81049e5 Release mtd-utils-2.0.1 | 4458ad6 mtd-utils: tests: Avoid using less than two blocks in nandpagetest | 76a55b1 mtd-utils: ubinfo: add parameter check | 454a3d0 mkfs-ubifs: fix inclusion of uuid.h | df913e4 mtd-utils: tests: Add Erased Pages Bit Flip Test | f8bc7d9 Add const modifier to read only strings and string constants | a7c8cb3 Silence warnings about unused arguments | e511691 Remove unused variables and functions | ca517e8 Eliminate warnings about missing prototypes | 3029b65 Enable compiler warnings | 9eae306 Move libfec declarations to public header in global include directory | 022ce62 Use autoconf header detection correctly for libmissing | 1a3e3af Restructure autoconf configure.ac | e772dc8 Replace defunct ubifs_assert | b0b1bc5 mtd-utils: tests: Fix nandbiterrs Failure Check | 76e27a7 ubi-utils: Return error code if command line option is unknown | b8e785a nor-utils: Return error code if command line option is unknown | 12e27a1 jffsX-utils: Return error code if command line option is unknown | 9a357ee ftl_format: Use return directly to leave main function | 6890608 flashcp: Drop exit code defines | ccffc10 Use defines for exit code values | 871c2f1 mkfs.ubifs: Add support for symlinks in device table | c0972a5 libiniparser: remove unused function needing float | 5c57076 libubi.c: add klibc specific fixes for ioctl | dede98f Return correct error number in ubi_get_vol_info1 | a2eeedb Fix libmtd behaviour if MTD is not present on the system | 4dab9be Fix build with musl | 82839c3 Replace rpmatch() usage with checking first character of line | 7d026a8 Fix alignment trap triggered by NEON instructions | d7e8612 mtd-utils: Support jffs2 flash-erase for large OOB (>32b) | fc7aa01 ubi: tests: Speedup io_paral by using rand_r() | fdec8a4 ubi: tests: Support up to 65k NAND page size | d600419 ubi: tests: Replace variable-length array with malloc() | 1710e0c Remove README.udev from ubi-tests extra dist | e3e010c ubirename: trivial fixes to the help text | 1fed9b4 Remove UDEV_SETTLE_HACK | 22089b0 mtd-utils: serve_image: Use PRIdoff_t as format specifier. | 5a80691 mtd-utils: Fix format specifier definitions for off_t and loff_t. | 44558d1 nanddump: Add --skip-bad-blocks-to-start option | 2fc8058 nandwrite: Add --skip-bad-blocks-to-start option | 6df83fd nandwrite: fix/cleanup bad block skipping | 7b8981a nandwrite: replace erase loop with mtd_erase_multi | dffaa1d nandwrite: add stricter sanity checking for blockalign `---- ,----[ Changes from 2.0.1 -> 9c61735 ] | 9c61735 mtd: unittests: Stop testing stat() calls | daef4f1 mtd: unittests: Decode arg size from ioctl request | fd0b70b mtd: unittests: Use proper unsigned long type for ioctl requests | c75d104 ubi-utils: ubiformat.c: convert to integer arithmetic | 61afcc6 mtd-utils: common.c: convert to integer arithmetic | 6766178 Run unit test programs through "make check" | 098e91a mtd: tests: Fix check on ebcnt in nandpagetest | 9cfb02c libscan: fix a comment typo in libscan.h | 7086393 libmtd: fix a comment typo in dev_node2num | 3c54e4e ubi-utils: ubicrc32: process command line arguments first | ce50e6d nandbiterrs: Fix copy & paste fail | 03dafe3 Enable further warning flags, address new warnings | 0555cb2 jittertest: Use the appropriate versions of abs() | 475bf70 Mark or fix switch cases that fall through | cb2fcfc Add no-return attribute to usage() style functions | 81fd176 Remove self-assignments of unused paramters | 3b421ab mkfs.ubifs: ignore EOPNOTSUPP when listing extended attributes | 030a63b tests: checkfs: Remove unused source file from makefiles | 40dd609 misc-utils: initialize "ip" in docfdisk to NULL | 94f6573 ubi-tests: io_update: fix missleading indentation | afba4fc mkfs.ubifs: Apply squash-uids to the root node | 3a34784 Add ctags files to .gitignore `---- (From OE-Core rev: af5fd7146d178fdcbb7949280db1bbc4647003db) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/mtd/mtd-utils')
-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/fix-armv7-neon-alignment.patch55
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch137
4 files changed, 0 insertions, 283 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
deleted file mode 100644
index bf3f98f14d..0000000000
--- a/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 4dab9bed1033f797ef9b482c77342fe3fe26d0be Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 6 Oct 2015 23:51:34 +0000
4Subject: [PATCH] Fix build with musl
5
6Upstream-Status: Backport
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
10---
11 jffsX-utils/mkfs.jffs2.c | 1 +
12 1 file changed, 1 insertion(+)
13
14diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c
15index 5446a16..ca5e0d5 100644
16--- a/jffsX-utils/mkfs.jffs2.c
17+++ b/jffsX-utils/mkfs.jffs2.c
18@@ -72,6 +72,7 @@
19 #include <byteswap.h>
20 #include <crc32.h>
21 #include <inttypes.h>
22+#include <limits.h>
23
24 #include "rbtree.h"
25 #include "common.h"
26--
272.6.1
28
diff --git a/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch b/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
deleted file mode 100644
index 853de6af98..0000000000
--- a/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1From 82839c3c0371ca2a1643a99d7d01f5bc1c850b28 Mon Sep 17 00:00:00 2001
2From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
3Date: Thu, 2 Mar 2017 11:40:36 +0100
4Subject: [PATCH] Replace rpmatch() usage with checking first character of line
5
6This is based on the patch from Khem Raj used by openembedded. In
7addition to the original patch, this also removes the fallback
8implementation that was provided for C libraries that don't implement
9rpmatch.
10
11Upstream-Status: Backport
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
15---
16 include/common.h | 25 ++++++-------------------
17 1 file changed, 6 insertions(+), 19 deletions(-)
18
19diff --git a/include/common.h b/include/common.h
20index d0c706d..d609257 100644
21--- a/include/common.h
22+++ b/include/common.h
23@@ -129,21 +129,6 @@ extern "C" {
24 fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \
25 } while(0)
26
27-/* uClibc versions before 0.9.34 and musl don't have rpmatch() */
28-#if defined(__UCLIBC__) && \
29- (__UCLIBC_MAJOR__ == 0 && \
30- (__UCLIBC_MINOR__ < 9 || \
31- (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 34))) || \
32- !defined(__GLIBC__)
33-#undef rpmatch
34-#define rpmatch __rpmatch
35-static inline int __rpmatch(const char *resp)
36-{
37- return (resp[0] == 'y' || resp[0] == 'Y') ? 1 :
38- (resp[0] == 'n' || resp[0] == 'N') ? 0 : -1;
39-}
40-#endif
41-
42 /**
43 * prompt the user for confirmation
44 */
45@@ -164,10 +149,12 @@ static inline bool prompt(const char *msg, bool def)
46 }
47
48 if (strcmp("\n", line) != 0) {
49- switch (rpmatch(line)) {
50- case 0: ret = false; break;
51- case 1: ret = true; break;
52- case -1:
53+ switch (line[0]) {
54+ case 'N':
55+ case 'n': ret = false; break;
56+ case 'Y':
57+ case 'y': ret = true; break;
58+ default:
59 puts("unknown response; please try again");
60 continue;
61 }
62--
632.6.1
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
deleted file mode 100644
index 6fc594f00b..0000000000
--- a/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
+++ /dev/null
@@ -1,55 +0,0 @@
1From 7d026a85946a08b8167dcd792ea6660bf6a49e08 Mon Sep 17 00:00:00 2001
2From: Yuanjie Huang <Yuanjie.Huang@windriver.com>
3Date: Thu, 2 Mar 2017 10:43:56 +0100
4Subject: [PATCH] Fix alignment trap triggered by NEON instructions
5
6NEON instruction VLD1.64 was used to copy 64 bits data after type
7casting, and they will trigger alignment trap.
8This patch uses memcpy to avoid alignment problem.
9
10Upstream-Status: Backport
11
12Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
13Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
14---
15 ubifs-utils/mkfs.ubifs/key.h | 16 ++++++++++------
16 1 file changed, 10 insertions(+), 6 deletions(-)
17
18diff --git a/ubifs-utils/mkfs.ubifs/key.h b/ubifs-utils/mkfs.ubifs/key.h
19index 39379fd..118858b 100644
20--- a/ubifs-utils/mkfs.ubifs/key.h
21+++ b/ubifs-utils/mkfs.ubifs/key.h
22@@ -159,10 +159,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
23 */
24 static inline void key_write(const union ubifs_key *from, void *to)
25 {
26- union ubifs_key *t = to;
27+ __le32 x[2];
28
29- t->j32[0] = cpu_to_le32(from->u32[0]);
30- t->j32[1] = cpu_to_le32(from->u32[1]);
31+ x[0] = cpu_to_le32(from->u32[0]);
32+ x[1] = cpu_to_le32(from->u32[1]);
33+
34+ memcpy(to, &x, 8);
35 memset(to + 8, 0, UBIFS_MAX_KEY_LEN - 8);
36 }
37
38@@ -174,10 +176,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
39 */
40 static inline void key_write_idx(const union ubifs_key *from, void *to)
41 {
42- union ubifs_key *t = to;
43+ __le32 x[2];
44+
45+ x[0] = cpu_to_le32(from->u32[0]);
46+ x[1] = cpu_to_le32(from->u32[1]);
47
48- t->j32[0] = cpu_to_le32(from->u32[0]);
49- t->j32[1] = cpu_to_le32(from->u32[1]);
50+ memcpy(to, &x, 8);
51 }
52
53 /**
54--
552.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
deleted file mode 100644
index 0f42e73e9a..0000000000
--- a/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
+++ /dev/null
@@ -1,137 +0,0 @@
1Upstream-Status: Pending
2From patchwork Mon Aug 8 08:16:43 2011
3Content-Type: text/plain; charset="utf-8"
4MIME-Version: 1.0
5Content-Transfer-Encoding: 7bit
6Subject: mtd-utils: fix corrupt cleanmarker with flash_erase -j command
7Date: Sun, 07 Aug 2011 22:16:43 -0000
8From: b35362@freescale.com
9X-Patchwork-Id: 108873
10Message-Id: <1312791403-13473-1-git-send-email-b35362@freescale.com>
11To: <dwmw2@infradead.org>
12Cc: Liu Shuo <b35362@freescale.com>, Artem.Bityutskiy@nokia.com,
13 Li Yang <leoli@freescale.com>, linux-mtd@lists.infradead.org
14
15From: Liu Shuo <b35362@freescale.com>
16
17Flash_erase -j should fill discrete freeoob areas with required bytes
18of JFFS2 cleanmarker in jffs2_check_nand_cleanmarker(). Not just fill
19the first freeoob area.
20
21The below is the result without this workaround:
22
23JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
24JFFS2: Erase block at 0x00004000 is not formatted. It will be erased
25JFFS2: Erase block at 0x00008000 is not formatted. It will be erased
26JFFS2: Erase block at 0x0000c000 is not formatted. It will be erased
27JFFS2: Erase block at 0x00010000 is not formatted. It will be erased
28JFFS2: Erase block at 0x00014000 is not formatted. It will be erased
29JFFS2: Erase block at 0x00018000 is not formatted. It will be erased
30JFFS2: Erase block at 0x0001c000 is not formatted. It will be erased
31JFFS2: Erase block at 0x00020000 is not formatted. It will be erased
32JFFS2: Erase block at 0x00024000 is not formatted. It will be erased
33JFFS2: Erase block at 0x00028000 is not formatted. It will be erased
34...
35
36Signed-off-by: Liu Shuo <b35362@freescale.com>
37Signed-off-by: Li Yang <leoli@freescale.com>
38
39Updated for the new version
40
41Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
42
43---
44v2 : get length of availble freeoob bytes from oobinfo information,
45 not use the ioctl ECCGETLAYOUT which is being deprecated.
46
47 flash_erase.c | 46 +++++++++++++++++++++++++++++++++++++++-------
48 1 files changed, 39 insertions(+), 7 deletions(-)
49
50diff --git a/flash_erase.c b/flash_erase.c
51index 933373a..4b9d84b 100644
52--- a/misc-utils/flash_erase.c
53+++ b/misc-utils/flash_erase.c
54@@ -99,6 +99,7 @@ int main(int argc, char *argv[])
55 bool isNAND;
56 int error = 0;
57 off_t offset = 0;
58+ void *oob_data = NULL;
59
60 /*
61 * Process user arguments
62@@ -201,15 +202,43 @@ int main(int argc, char *argv[])
63 if (ioctl(fd, MEMGETOOBSEL, &oobinfo) != 0)
64 return sys_errmsg("%s: unable to get NAND oobinfo", mtd_device);
65
66+ cleanmarker.totlen = cpu_to_je32(8);
67 /* Check for autoplacement */
68 if (oobinfo.useecc == MTD_NANDECC_AUTOPLACE) {
69- /* Get the position of the free bytes */
70- if (!oobinfo.oobfree[0][1])
71+ struct nand_ecclayout_user ecclayout;
72+ int i, oobavail;
73+
74+ for (i = 0, oobavail = 0; oobinfo.oobfree[i][1]; i++)
75+ oobavail += oobinfo.oobfree[i][1];
76+
77+ if (!oobavail)
78 return errmsg(" Eeep. Autoplacement selected and no empty space in oob");
79+
80+ /* Get the position of the free bytes */
81 clmpos = oobinfo.oobfree[0][0];
82- clmlen = oobinfo.oobfree[0][1];
83- if (clmlen > 8)
84- clmlen = 8;
85+ clmlen = MIN(oobavail, 8);
86+
87+ if (oobinfo.oobfree[0][1] < 8 && oobavail >= 8) {
88+ int left, n, last = 0;
89+ void *cm;
90+
91+ oob_data = malloc(mtd.oob_size);
92+ if (!oob_data)
93+ return -ENOMEM;
94+
95+ memset(oob_data, 0xff, mtd.oob_size);
96+ cm = &cleanmarker;
97+ for (i = 0, left = clmlen; left ; i++) {
98+ n = MIN(left, oobinfo.oobfree[i][1]);
99+ memcpy(oob_data + oobinfo.oobfree[i][0],
100+ cm, n);
101+ left -= n;
102+ cm += n;
103+ last = oobinfo.oobfree[i][0] + n;
104+ }
105+
106+ clmlen = last - clmpos;
107+ }
108 } else {
109 /* Legacy mode */
110 switch (mtd.oob_size) {
111@@ -227,7 +256,6 @@ int main(int argc, char *argv[])
112 break;
113 }
114 }
115- cleanmarker.totlen = cpu_to_je32(8);
116 }
117 cleanmarker.hdr_crc = cpu_to_je32(mtd_crc32(0, &cleanmarker, sizeof(cleanmarker) - 4));
118 }
119@@ -276,7 +304,8 @@ int main(int argc, char *argv[])
120
121 /* write cleanmarker */
122 if (isNAND) {
123- if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, &cleanmarker) != 0) {
124+ void *data = oob_data ? oob_data + clmpos : &cleanmarker;
125+ if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, data) != 0) {
126 sys_errmsg("%s: MTD writeoob failure", mtd_device);
127 continue;
128 }
129@@ -291,5 +320,8 @@ int main(int argc, char *argv[])
130 show_progress(&mtd, offset, eb, eb_start, eb_cnt);
131 bareverbose(!quiet, "\n");
132
133+ if (oob_data)
134+ free(oob_data);
135+
136 return 0;
137 }