summaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2015-09-08 17:49:58 +0200
committerEnrico Jorns <ejo@pengutronix.de>2016-01-22 09:31:43 +0100
commit70554dae5693df5ae890e24961f8bd0793bcc6ba (patch)
tree1131e4a9ed170b3004439ab1f3adb047fff7ae54 /recipes-devtools
parentc84b227b4450f42b95b72cb980734a0dc5a8dcc0 (diff)
downloadmeta-ptx-70554dae5693df5ae890e24961f8bd0793bcc6ba.tar.gz
meta-ptx-70554dae5693df5ae890e24961f8bd0793bcc6ba.tar.xz
mtd-utils: Add ubinize patch to return error code in case of errors
Helps to discover issues with invalid ubinize configs etc. Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/mtd/mtd-utils/ubinize-Always-return-error-code-at-least-1-in-case-.patch58
-rw-r--r--recipes-devtools/mtd/mtd-utils_git.bbappend3
2 files changed, 61 insertions, 0 deletions
diff --git a/recipes-devtools/mtd/mtd-utils/ubinize-Always-return-error-code-at-least-1-in-case-.patch b/recipes-devtools/mtd/mtd-utils/ubinize-Always-return-error-code-at-least-1-in-case-.patch
new file mode 100644
index 0000000..899d314
--- /dev/null
+++ b/recipes-devtools/mtd/mtd-utils/ubinize-Always-return-error-code-at-least-1-in-case-.patch
@@ -0,0 +1,58 @@
+From ec5b0218e3112f27948238fbb6d1a97813be0d48 Mon Sep 17 00:00:00 2001
+From: Enrico Jorns <ejo@pengutronix.de>
+Date: Mon, 7 Sep 2015 15:29:11 +0200
+Subject: [PATCH] ubinize: Always return error code (at least -1) in case of an
+ error
+
+Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
+---
+ ubi-utils/ubinize.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c
+index 34f465a..60bbd9a 100644
+--- a/ubi-utils/ubinize.c
++++ b/ubi-utils/ubinize.c
+@@ -519,6 +519,7 @@ int main(int argc, char * const argv[])
+ */
+ seek = ui.peb_size * 2;
+ if (lseek(args.out_fd, seek, SEEK_SET) != seek) {
++ err = -1;
+ sys_errmsg("cannot seek file \"%s\"", args.f_out);
+ goto out_free;
+ }
+@@ -530,6 +531,7 @@ int main(int argc, char * const argv[])
+ int fd, j;
+
+ if (!sname) {
++ err = -1;
+ errmsg("ini-file parsing error (iniparser_getsecname)");
+ goto out_free;
+ }
+@@ -550,6 +552,7 @@ int main(int argc, char * const argv[])
+ */
+ for (j = 0; j < i; j++) {
+ if (vi[i].id == vi[j].id) {
++ err = -1;
+ errmsg("volume IDs must be unique, but ID %d "
+ "in section \"%s\" is not",
+ vi[i].id, sname);
+@@ -557,6 +560,7 @@ int main(int argc, char * const argv[])
+ }
+
+ if (!strcmp(vi[i].name, vi[j].name)) {
++ err = -1;
+ errmsg("volume name must be unique, but name "
+ "\"%s\" in section \"%s\" is not",
+ vi[i].name, sname);
+@@ -580,6 +584,7 @@ int main(int argc, char * const argv[])
+ if (img) {
+ fd = open(img, O_RDONLY);
+ if (fd == -1) {
++ err = fd;
+ sys_errmsg("cannot open \"%s\"", img);
+ goto out_free;
+ }
+--
+2.5.0
+
diff --git a/recipes-devtools/mtd/mtd-utils_git.bbappend b/recipes-devtools/mtd/mtd-utils_git.bbappend
new file mode 100644
index 0000000..9425503
--- /dev/null
+++ b/recipes-devtools/mtd/mtd-utils_git.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://ubinize-Always-return-error-code-at-least-1-in-case-.patch"