-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbusybox-1.25.1-nandwrite.patch
More file actions
62 lines (56 loc) · 2.08 KB
/
Copy pathbusybox-1.25.1-nandwrite.patch
File metadata and controls
62 lines (56 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--- a/miscutils/nandwrite.c
+++ b/miscutils/nandwrite.c
@@ -29,18 +29,16 @@
//kbuild:lib-$(CONFIG_NANDDUMP) += nandwrite.o
//usage:#define nandwrite_trivial_usage
-//usage: "[-np] [-s ADDR] MTD_DEVICE [FILE]"
+//usage: "[-p] [-s ADDR] MTD_DEVICE [FILE]"
//usage:#define nandwrite_full_usage "\n\n"
//usage: "Write to MTD_DEVICE\n"
-//usage: "\n -n Write without ecc"
//usage: "\n -p Pad to page size"
//usage: "\n -s ADDR Start address"
//usage:#define nanddump_trivial_usage
-//usage: "[-no]" IF_LONG_OPTS(" [--bb=padbad|skipbad]") " [-s ADDR] [-l LEN] [-f FILE] MTD_DEVICE"
+//usage: "[-o]" IF_LONG_OPTS(" [--bb=padbad|skipbad]") " [-s ADDR] [-l LEN] [-f FILE] MTD_DEVICE"
//usage:#define nanddump_full_usage "\n\n"
//usage: "Dump MTD_DEVICE\n"
-//usage: "\n -n Read without ecc"
//usage: "\n -o Dump oob data"
//usage: "\n -s ADDR Start address"
//usage: "\n -l LEN Length"
@@ -59,11 +57,10 @@
#define OPT_p (1 << 0) /* nandwrite only */
#define OPT_o (1 << 0) /* nanddump only */
-#define OPT_n (1 << 1)
-#define OPT_s (1 << 2)
-#define OPT_f (1 << 3)
-#define OPT_l (1 << 4)
-#define OPT_bb (1 << 5) /* must be the last one in the list */
+#define OPT_s (1 << 1)
+#define OPT_f (1 << 2)
+#define OPT_l (1 << 3)
+#define OPT_bb (1 << 4) /* must be the last one in the list */
#define BB_PADBAD (1 << 0)
#define BB_SKIPBAD (1 << 1)
@@ -128,10 +125,10 @@
applet_long_options =
"bb\0" Required_argument "\xff"; /* no short equivalent */
#endif
- opts = getopt32(argv, "ons:f:l:", &opt_s, &opt_f, &opt_l, &opt_bb);
+ opts = getopt32(argv, "os:f:l:", &opt_s, &opt_f, &opt_l, &opt_bb);
} else { /* nandwrite */
opt_complementary = "-1:?2";
- opts = getopt32(argv, "pns:", &opt_s);
+ opts = getopt32(argv, "ps:", &opt_s);
}
argv += optind;
@@ -147,9 +144,6 @@
fd = xopen(argv[0], IS_NANDWRITE ? O_RDWR : O_RDONLY);
xioctl(fd, MEMGETINFO, &meminfo);
- if (opts & OPT_n)
- xioctl(fd, MTDFILEMODE, (void *)MTD_FILE_MODE_RAW);
-
mtdoffset = xstrtou(opt_s, 0);
if (IS_NANDDUMP && (opts & OPT_l)) {
unsigned length = xstrtou(opt_l, 0);