uboot: refine fit ubootenv creation

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2024-09-12 14:03:00 +08:00
committed by hanwckf
parent 15fd81d31d
commit 8dddf4ec0a
2 changed files with 12 additions and 5 deletions

View File

@@ -531,13 +531,16 @@ static int write_ubi_fit_image(const void *data, size_t size,
if (ret)
return ret;
ret = create_ubi_volume("ubootenv", 0x100000, -1, false);
#ifdef CONFIG_ENV_IS_IN_UBI
ret = create_ubi_volume(CONFIG_ENV_UBI_VOLUME, CONFIG_ENV_SIZE, -1, false);
if (ret)
goto out;
ret = create_ubi_volume("ubootenv2", 0x100000, -1, false);
#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
ret = create_ubi_volume(CONFIG_ENV_UBI_VOLUME_REDUND, CONFIG_ENV_SIZE, -1, false);
if (ret)
goto out;
#endif
#endif
}
/* Remove this volume first in case of no enough PEBs */