@@ -162,7 +162,7 @@ int bootloader_apply_list(const char *filename)
}
while ((getline(&line, &len, fp)) != -1) {
- key = strtok(line, " \t\n");
+ key = strtok(line, "=");
value = strtok(NULL, "\t\n");
if (value != NULL && key != NULL) {
if ((ret = bootloader_env_set(key, value)) != 0) {
@@ -122,7 +122,7 @@ static int grubenv_parse_script(struct grubenv_t *grubenv, const char *script)
* turns out to be desired
*/
while ((getline(&line, &len, fp)) != -1) {
- key = strtok(line, " \t\n");
+ key = strtok(line, "=");
value = strtok(NULL, "\t\n");
if (value != NULL && key != NULL) {
ret = dict_set_value(&grubenv->vars, key, value);
@@ -169,7 +169,7 @@ static int update_bootloader_env(struct swupdate_cfg *cfg, const char *script)
if (!key || !value)
continue;
- snprintf(buf, sizeof(buf), "%s %s\n", key, value);
+ snprintf(buf, sizeof(buf), "%s=%s\n", key, value);
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> This is the format used when the environment is updated from handler. Internally, a script was still generated with the old format and then passed to the bootloader API. Switch to the new format in all cases and adjust code in Grub and EBG code. Signed-off-by: Stefano Babic <sbabic@denx.de> --- bootloader/ebg.c | 2 +- bootloader/grub.c | 2 +- corelib/installer.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)