buildroot/package/swupdate/0003-u-boot-fix-script-format-when-CONFIG_UBOOT_NEWAPI.patch
Pierre-Jean Texier e2d299485e package/swupdate: bump to version 2019.04
New features in this release:
 - Improved documentation
 - delta updates based on rdiff library
 - support for libubootenv
 - dry-run option
 - CA certificates for signed images
 - Fix security leak in parser

This commit also:
 - introduce BR2_PACKAGE_LIBRSYNC for 'rdiff' Handler. No HAVE_* is
   needed, it just declares the functions locally and links with
   -lrsync.
 - introduce BR2_PACKAGE_LIBUBOOTENV
 - drop upstreamed patch
 - backport upstream patches (important fix)
 - regenerate the default swupdate.config. Now CONFIG_GUNZIP is always
   enabled because gunzip is provided by the default busybox config.

Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
[Arnout: don't mention ZLIB in help text for libubootenv, since it is
 select'ed by libubootenv.]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-06-10 23:51:36 +02:00

45 lines
1.6 KiB
Diff

From f811c91c06bffe32f46472524059914987e653ba Mon Sep 17 00:00:00 2001
From: Christian Storm <christian.storm@siemens.com>
Date: Tue, 21 May 2019 16:20:02 +0200
Subject: [PATCH] u-boot: fix script format when !CONFIG_UBOOT_NEWAPI
When !CONFIG_UBOOT_NEWAPI and hence linking against U-Boot's
tools/env/lib.a, SWUpdate's bootloader/uboot.c calls lib.a's
fw_parse_script() which expects input to be in format, quoting:
...
* Each line has a couple with name, value:
* <white spaces>variable_name<white spaces>variable_value
This was changed in SWUpdate by commit dab1b70 "Unify bootloader
script format" to be '='-separated instead of space-separated,
hence breaking the integration with the "old" libubootenv binding.
Signed-off-by: Christian Storm <christian.storm@siemens.com>
Reported-by: Akihiro Suzuki <akihiro27.suzuki@toshiba.co.jp>
Acked-by: Stefano Babic <sbabic@denx.de>
[Backported from: f811c91c06bffe32f46472524059914987e653ba]
Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
---
corelib/installer.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/corelib/installer.c b/corelib/installer.c
index edfcb6a..2dda40a 100644
--- a/corelib/installer.c
+++ b/corelib/installer.c
@@ -169,7 +169,11 @@ static int update_bootloader_env(struct swupdate_cfg *cfg, const char *script)
if (!key || !value)
continue;
+#if defined(CONFIG_UBOOT) && !defined(CONFIG_UBOOT_NEWAPI)
+ snprintf(buf, sizeof(buf), "%s %s\n", key, value);
+#else
snprintf(buf, sizeof(buf), "%s=%s\n", key, value);
+#endif
if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) {
TRACE("Error saving temporary bootloader environment file");
close(fd);
--
2.7.4