diff mbox series

Bootloader script must be adjusted for new API

Message ID 20190314144231.7375-1-sbabic@denx.de
State Changes Requested
Headers show
Series Bootloader script must be adjusted for new API | expand

Commit Message

Stefano Babic March 14, 2019, 2:42 p.m. UTC
Former script had the syntax:

	<variable> <value>

but it was changed to be confor to u-boot format, also used by U-Boot
tools to generate an environment from a script:

	<variable>=<value>

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 corelib/installer.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Stefano Babic March 15, 2019, 10:38 a.m. UTC | #1
On 14/03/19 15:42, Stefano Babic wrote:
> Former script had the syntax:
> 
> 	<variable> <value>
> 
> but it was changed to be confor to u-boot format, also used by U-Boot
> tools to generate an environment from a script:
> 
> 	<variable>=<value>
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> ---
>  corelib/installer.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/corelib/installer.c b/corelib/installer.c
> index f7809d4..a451a2a 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 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);
> 

Discarded, this breaks GRUB and EBG code.

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/corelib/installer.c b/corelib/installer.c
index f7809d4..a451a2a 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 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);