env: ubi: add support of command env erase
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Wed, 14 Dec 2022 15:51:31 +0000 (16:51 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 11 Jan 2023 20:02:24 +0000 (15:02 -0500)
commit91fc785834194c7cf2f686a8861a67154e56e817
treeff8d11612ac3e09e37c27f8eaeeafe51287f7b63
parente64289e1ec7c66a2d858aff65c0af501557d538b
env: ubi: add support of command env erase

Add support of opts erase for ubi env backend, this opts is used by
command 'env erase'.

This command only zero-fill the env UBI volume CONFIG_ENV_UBI_VOLUME
and CONFIG_ENV_UBI_VOLUME_REDUND, so the saved environment becomes
invalid.

This patch introduces a local define ENV_UBI_VOLUME_REDUND
only to avoid #if in the code, as CONFIG_ENV_UBI_VOLUME_REDUND
is only defined when CONFIG_SYS_REDUNDAND_ENVIRONMENT is defined.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
env/ubi.c