aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-envtools
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-06-24 18:12:56 +0000
committerJohn Crispin <john@openwrt.org>2014-06-24 18:12:56 +0000
commit8a82c2cd36aa7b8b1ce6c0662e57c7d96c84c43e (patch)
tree1508d975171f0c7ad55165e9c2d4842d62f3bcd6 /package/boot/uboot-envtools
parentd219e055bee41b02f1b092a131e060a92d763813 (diff)
downloadupstream-8a82c2cd36aa7b8b1ce6c0662e57c7d96c84c43e.tar.gz
upstream-8a82c2cd36aa7b8b1ce6c0662e57c7d96c84c43e.tar.bz2
upstream-8a82c2cd36aa7b8b1ce6c0662e57c7d96c84c43e.zip
uboot-envtools: fix build if ubi volume support is disabled
Insert a missing #ifdef UBI around the use of libubi_close(). As the preceding if (libubi) will never be true on non-UBI builds, compiling only failed when disabling optimization. Also rebase patch to latest u-boot.git HEAD. Signed-off-by: Daniel Golle <daniel@makrotopia.org> SVN-Revision: 41313
Diffstat (limited to 'package/boot/uboot-envtools')
-rw-r--r--package/boot/uboot-envtools/patches/300-support-env-in-ubivol-chardev.patch20
1 files changed, 11 insertions, 9 deletions
diff --git a/package/boot/uboot-envtools/patches/300-support-env-in-ubivol-chardev.patch b/package/boot/uboot-envtools/patches/300-support-env-in-ubivol-chardev.patch
index 96a95f756c..41089c50e7 100644
--- a/package/boot/uboot-envtools/patches/300-support-env-in-ubivol-chardev.patch
+++ b/package/boot/uboot-envtools/patches/300-support-env-in-ubivol-chardev.patch
@@ -1,4 +1,4 @@
-From ee2c9e3aef32c05b1d7891858baff19bffed1652 Mon Sep 17 00:00:00 2001
+From 6e2630a0fc872d0db34157972f6dc3941f6d66dd Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Mon, 19 May 2014 21:38:01 +0200
Subject: [PATCH] tools/env: add support for env in ubi volume chardev
@@ -6,11 +6,11 @@ Subject: [PATCH] tools/env: add support for env in ubi volume chardev
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
tools/env/Makefile | 5 ++++
- tools/env/fw_env.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++--------
- 2 files changed, 69 insertions(+), 10 deletions(-)
+ tools/env/fw_env.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 71 insertions(+), 10 deletions(-)
diff --git a/tools/env/Makefile b/tools/env/Makefile
-index f5368bc..d006a93 100644
+index f5368bc..526d44d 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -20,6 +20,11 @@ ifeq ($(MTD_VERSION),old)
@@ -26,7 +26,7 @@ index f5368bc..d006a93 100644
hostprogs-y := fw_printenv_unstripped
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
-index 30d5b03..5c0acd5 100644
+index 30d5b03..2217a25 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -29,6 +29,9 @@
@@ -107,17 +107,19 @@ index 30d5b03..5c0acd5 100644
ioctl(fd, MEMLOCK, &erase);
processed += erasesize;
-@@ -955,6 +988,9 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
+@@ -955,6 +988,11 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
if (write_total > count)
free (data);
+out:
++#ifdef UBI
+ if (libubi)
+ libubi_close(libubi);
++#endif
return processed;
}
-@@ -1066,12 +1102,8 @@ static int flash_read (int fd)
+@@ -1066,12 +1104,8 @@ static int flash_read (int fd)
if (S_ISCHR(st.st_mode)) {
rc = ioctl(fd, MEMGETINFO, &mtdinfo);
@@ -132,7 +134,7 @@ index 30d5b03..5c0acd5 100644
mtdinfo.type != MTD_NANDFLASH &&
mtdinfo.type != MTD_DATAFLASH &&
mtdinfo.type != MTD_UBIVOLUME) {
-@@ -1079,6 +1111,28 @@ static int flash_read (int fd)
+@@ -1079,6 +1113,28 @@ static int flash_read (int fd)
mtdinfo.type, DEVNAME(dev_current));
return -1;
}
@@ -162,5 +164,5 @@ index 30d5b03..5c0acd5 100644
memset(&mtdinfo, 0, sizeof(mtdinfo));
mtdinfo.type = MTD_ABSENT;
--
-1.9.2
+2.0.0