va_end(args);
/* Get source variable */
- env_var = getenv(buf);
+ env_var = env_get(buf);
if (!env_var) {
DBG("DBG: ${%s} not found!\n", buf);
return NULL;
char *platname;
char *partitions;
- platname = getenv("platname");
+ platname = env_get("platname");
if (!platname) {
- error("Undefined platname!\n");
+ printf("Undefined platname!\n");
return CMD_RET_FAILURE;
}
}
if (save_env && run_command("saveenv", 0)) {
- error("Environment save failed");
+ printf("Environment save failed");
return CMD_RET_FAILURE;
}
- partitions = getenv("partitions");
+ partitions = env_get("partitions");
if (!partitions) {
printf("Partition table not changed.\n");
return CMD_RET_SUCCESS;
ret = run_command("gpt write mmc 0 $partitions", 0);
if (ret) {
- error("gpt write failed");
+ printf("gpt write failed");
return ret;
}
const char *platname;
int i;
- platname = getenv("platname");
+ platname = env_get("platname");
if (!platname) {
- error("Undefined platname!\n");
+ printf("Undefined platname!\n");
return CMD_RET_FAILURE;
}
/* Get setup count for ${platname} */
env_setup_cnt = getenv_by_args("%s_setup_cnt", platname);
if (!env_setup_cnt) {
- error("Platform setup count not found!\n");
+ printf("Platform setup count not found!\n");
return CMD_RET_FAILURE;
}
setup_cnt = simple_strtoul(env_setup_cnt, NULL, 0);
/* Set dfu_alt_system_${board} */
snprintf(buf, buf_len, "dfu_alt_system_%s", platname);
DBG("DBG: setenv($%s, %.16s[...])\n", buf, value);
- setenv(buf, value);
+ env_set(buf, value);
/* Get ${platname}_setup_N_partitions */
value = getenv_by_args("%s_setup_%d_partitions", platname, i);
/* Set ${partitions} - NULL if not GPT */
DBG("DBG: setenv($partitions, %.16s[...])\n", value);
- setenv("partitions", value);
+ env_set("partitions", value);
/* Set ${mmcbootpart} */
value = getenv_by_args("%s_setup_%d_bootpart", platname, i);
DBG("DBG: setenv($mmcbootpart, %s)\n", value);
- setenv("mmcbootpart", value);
+ env_set("mmcbootpart", value);
/* Set ${mmcrootpart} */
value = getenv_by_args("%s_setup_%d_rootpart", platname, i);
DBG("DBG: setenv($mmcrootpart, %s)\n", value);
- setenv("mmcrootpart", value);
+ env_set("mmcrootpart", value);
/* Set active setup */
snprintf(buf, buf_len, "%s_setup_active", platname);
snprintf(buf_num, buf_num_len, "%d", i);
DBG("DBG: setenv($%s, %s)\n", buf, buf_num);
- setenv(buf, buf_num);
+ env_set(buf, buf_num);
printf("Setup:[%d] activated!\n", i);
setup_done = 1;
#ifdef CONFIG_OF_MULTI
bdname = get_board_name();
#ifdef CONFIG_PLATFORM_SETUP
- setenv("platname", bdname);
+ env_set("platname", bdname);
#endif
#endif
sprintf(info, "%s%s", bdname, bdtype);