Message ID | 20190314144231.7375-1-sbabic@denx.de |
---|---|
State | Changes Requested |
Headers | show |
Series | Bootloader script must be adjusted for new API | expand |
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 --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);
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(+)