summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch92
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils_git.bb6
2 files changed, 3 insertions, 95 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils/0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch b/meta/recipes-devtools/mtd/mtd-utils/0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch
deleted file mode 100644
index 4ece56b9ce..0000000000
--- a/meta/recipes-devtools/mtd/mtd-utils/0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch
+++ /dev/null
@@ -1,92 +0,0 @@
1From 0f833ac73ad631248826386e2918d8571ecf0347 Mon Sep 17 00:00:00 2001
2From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
3Date: Sat, 9 Jun 2018 16:45:22 +0200
4Subject: [PATCH] Revert "Return correct error number in ubi_get_vol_info1"
5
6This reverts commit dede98ffb706676309488d7cc660f569548d5930.
7
8The original commit tried to fix a descrepancy between the implementation
9and the documentation by making the implementation comply.
10
11When making the change, it was overlooked, that ubinfo and ubirename were
12written against the implementation instead of the behaviour specified by
13the documentation. So were further internal functions like
14ubi_get_vol_info1_nm which further breaks ubirmvol.
15
16A report with an outline of a resulting problem can be read on
17the mailing list:
18
19http://lists.infradead.org/pipermail/linux-mtd/2018-June/081562.html
20
21From the report:
22
23steps to reproduce: have mtd-utils 2.0.1 or 2.0.2
24
250. make a bunch of ubi volumes in sequential order
26
27ubimkvol /dev/ubi0 -s 64KiB -N test1
28ubimkvol /dev/ubi0 -s 64KiB -N test2
29ubimkvol /dev/ubi0 -s 64KiB -N test3
30ubimkvol /dev/ubi0 -s 64KiB -N test4
31..
32
331. delete the test1 volume, making a hole in the volume table
34
35ubirmvol /dev/ubi0 -N test1
36
372. try an affected tool (i.e. "ubirmvol /dev/ubi0 -N test4" )
38
39 |root at mr24:/# ubirmvol /dev/ubi0 -N test4
40 |ubirmvol: error!: cannot find UBI volume "test4"
41 | error 19 (No such device)
42
43or "ubinfo -a"
44
45 | root at mr24:/# ubinfo -a
46 | UBI version: 1
47 | Count of UBI devices: 1
48 | UBI control device major/minor: 10:59
49 | Present UBI devices: ubi0
50 |
51 | ubi0
52 | Volumes count: 11
53 | Logical eraseblock size: 15872 bytes, 15.5 KiB
54 | Total amount of logical eraseblocks: 1952 (30982144 bytes, 29.5 MiB)
55 | Amount of available logical eraseblocks: 75 (1190400 bytes, 1.1 MiB)
56 | Maximum count of volumes 92
57 | Count of bad physical eraseblocks: 0
58 | Count of reserved physical eraseblocks: 40
59 | Current maximum erase counter value: 984
60 | Minimum input/output unit size: 512 bytes
61 | Character device major/minor: 251:0
62 | ubinfo: error!: libubi failed to probe volume 5 on ubi0
63 | error 19 (No such device)
64 | Present volumes: 0, 1, 2, 3, 4root at mr24:/#
65
66Reported-by: Christian Lamparter <chunkeey@gmail.com>
67Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
68Upstream-Status: Accepted [http://git.infradead.org/mtd-utils.git/commit/0f833ac73ad631248826386e2918d8571ecf0347]
69---
70 lib/libubi.c | 5 +----
71 1 file changed, 1 insertion(+), 4 deletions(-)
72
73diff --git a/lib/libubi.c b/lib/libubi.c
74index b50e68a..978b433 100644
75--- a/lib/libubi.c
76+++ b/lib/libubi.c
77@@ -1240,11 +1240,8 @@ int ubi_get_vol_info1(libubi_t desc, int dev_num, int vol_id,
78 info->dev_num = dev_num;
79 info->vol_id = vol_id;
80
81- if (vol_get_major(lib, dev_num, vol_id, &info->major, &info->minor)) {
82- if (errno == ENOENT)
83- errno = ENODEV;
84+ if (vol_get_major(lib, dev_num, vol_id, &info->major, &info->minor))
85 return -1;
86- }
87
88 ret = vol_read_data(lib->vol_type, dev_num, vol_id, buf, 50);
89 if (ret < 0)
90--
912.14.4
92
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb
index 9ffac2ed3a..6415fffe61 100644
--- a/meta/recipes-devtools/mtd/mtd-utils_git.bb
+++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -10,12 +10,11 @@ inherit autotools pkgconfig update-alternatives
10DEPENDS = "zlib e2fsprogs util-linux" 10DEPENDS = "zlib e2fsprogs util-linux"
11RDEPENDS_mtd-utils-tests += "bash" 11RDEPENDS_mtd-utils-tests += "bash"
12 12
13PV = "2.0.2+${SRCPV}" 13PV = "2.1.0+${SRCPV}"
14 14
15SRCREV = "bc63d36e39f389c8c17f6a8e9db47f2acc884659" 15SRCREV = "b5027be5f470830ac9543db3c52e076b13abd313"
16SRC_URI = "git://git.infradead.org/mtd-utils.git \ 16SRC_URI = "git://git.infradead.org/mtd-utils.git \
17 file://add-exclusion-to-mkfs-jffs2-git-2.patch \ 17 file://add-exclusion-to-mkfs-jffs2-git-2.patch \
18 file://0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch \
19" 18"
20 19
21S = "${WORKDIR}/git/" 20S = "${WORKDIR}/git/"
@@ -28,6 +27,7 @@ EXTRA_OECONF += "--enable-install-tests"
28PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'xattr', d)} lzo" 27PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'xattr', d)} lzo"
29PACKAGECONFIG[lzo] = "--with-lzo,--without-lzo,lzo" 28PACKAGECONFIG[lzo] = "--with-lzo,--without-lzo,lzo"
30PACKAGECONFIG[xattr] = "--with-xattr,--without-xattr,acl" 29PACKAGECONFIG[xattr] = "--with-xattr,--without-xattr,acl"
30PACKAGECONFIG[crypto] = "--with-crypto,--without-crypto,openssl"
31 31
32CPPFLAGS_append_riscv64 = " -pthread -D_REENTRANT" 32CPPFLAGS_append_riscv64 = " -pthread -D_REENTRANT"
33 33