uboot: refine fit ubootenv creation
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -655,13 +655,17 @@ 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, UBI_VOL_NUM_AUTO, 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, UBI_VOL_NUM_AUTO, false);
|
||||
if (ret)
|
||||
goto out;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Remove this volume first in case of no enough PEBs */
|
||||
|
||||
Reference in New Issue
Block a user