Skip to content

env: ext4: corrections and add test for env in ext4

Patrick Delaunay u-boot 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest14 patches 0 repliesNew
  2. v314 patches 0 repliesSuperseded
  3. v29 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v1 posting 2/210 patches0 repliesSuperseded
v1 posting 1/210 patches0 repliesSuperseded

Changes in v4 from the cover letter

- don't use env_import in SPL to avoid to increase its size as it is only required for 'env load' command

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14env: add absolute path at CONFIG_ENV_EXT4_FILEenv/Kconfig+1 -11 reply
2/14env: ext4: set gd->env_validenv/ext4.c+8 -11 reply
3/14env: sf: avoid space in backend nameenv/sf.c+1 -11 reply
4/14env: correctly handle env_load_prioenv/env.c+4 -31 reply
5/14env: nowhere: add .load opsenv/nowhere.c+17 -01 reply
6/14env: the ops driver load becomes mandatory in struct env_driverenv/env.c include/env_internal.h+1 -51 reply
7/14cmd: env: add env load commandcmd/Kconfig cmd/nvedit.c env/env.c +1 more+55 -01 reply
8/14cmd: env: add env select commandcmd/Kconfig cmd/nvedit.c env/env.c +1 more+69 -11 reply
9/14configs: sandbox: activate env in ext4 supportboard/sandbox/sandbox.c configs/sandbox64_defconfig configs/sandbox_defconfig +2 more+31 -01 reply
10/14configs: sandbox: activate command env select and env loadconfigs/sandbox64_defconfig configs/sandbox_defconfig configs/sandbox_flattree_defconfig +1 more+8 -01 reply
11/14test: environment in ext4test/py/tests/test_env.py+96 -15 replies
12/14env: ext4: introduce new function env_ext4_save_bufferenv/ext4.c+20 -81 reply
13/14env: ext4: add support of command env eraseenv/ext4.c+19 -01 reply
14/14test: sandbox: add test for erase commandconfigs/sandbox64_defconfig configs/sandbox_defconfig configs/sandbox_flattree_defconfig +2 more+20 -01 reply

Reviews trailers per patch

2 of 14 patches have a Reviewed-by or Acked-by.

PatchTom Rini
1/14R-b
2/14R-b
3/14
4/14
5/14
6/14
7/14
8/14
9/14
10/14
11/14
12/14
13/14
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/14] env: ext4: corrections and add test for env in ext4

Hi,

V4 of the serie [1]: rebase on master branch and solve the SPL size issue for board with SPL_ENV_IS_NOWHERE=y (pointed by Tom Rini in [2])

The buildman result for these boards are:

-------------------------------------------------
tools/buildman/buildman -b sssddsqqs T1042RDB_PI_NAND_SECURE_BOOT am335x_guardian am335x_guardian am335x_evm j721e_evm_r5 ls1021atwr_sdcard_ifc_SECURE_BOOT ls1043ardb_nand_SECURE_BOOT ls1043ardb_sdcard_SECURE_BOOT ls1046ardb_qspi_spl ls1088ardb_sdcard_qspi_SECURE_BOOT T1042RDB_PI_NAND_SECURE_BOOT -sS

Summary of 25 commits for 13 boards (12 threads, 1 job per thread) 01: Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spi

   aarch64:  w+   ls1043ardb_sdcard_SECURE_BOOT ls1046ardb_sdcard_SECURE_BOOT ls1088ardb_sdcard_qspi_SECURE_BOOT
       arm:  w+   am335x_guardian j721e_evm_r5 ls1021atwr_sdcard_ifc_SECURE_BOOT
   powerpc:  w+   T1042RDB_PI_NAND_SECURE_BOOT
02: env: mmc: allow support of mmc_get_env_dev with OF_CONTROL
       arm: (for 7/7 boards) all +4534.9 bss -4.6 data +4537.1 text +2.3
03: env: mmc: correct the offset returned by mmc_offset_try_partition
       arm: (for 7/7 boards) bss +1.1 text -1.1

04: env: mmc: add redundancy support in mmc_offset_try_partition 05: stm32mp1: board: add support of CONFIG_ENV_IS_IN_MMC 06: stm32mp1: use a specific SD/eMMC partition for U-Boot enviromnent 07: configs:stm32mp1: activate env config in SPL
aarch64: (for 5/5 boards) all -1.8 rodata -1.8

       arm: (for 7/7 boards) all +0.9 bss +3.4 rodata -2.6
08: cmd: env: add option for quiet output on env info
   aarch64: (for 5/5 boards) all +1.8 rodata +1.8
       arm: (for 7/7 boards) all -0.9 bss -3.4 rodata +2.6

09: cmd: env: check real location for env info command
10: configs: sandbox: Enable sub command 'env info'
11: test: env: add test for env info sub-command
12: env: add absolute path at CONFIG_ENV_EXT4_FILE
13: env: ext4: set gd->env_valid
14: env: sf: avoid space in backend name
aarch64: (for 5/5 boards) all -0.2 rodata -0.2
15: env: correctly handle env_load_prio
aarch64: (for 5/5 boards) all -8.0 spl/u-boot-spl:all -1.6 spl/u-boot-spl:text -1.6 text -8.0

       arm: (for 7/7 boards) all -2.3 bss +3.4 spl/u-boot-spl:all -1.7 spl/u-boot-spl:text -1.7 text -5.7

16: env: nowhere: add .load ops
17: env: the ops driver load becomes mandatory in struct env_driver 18: cmd: env: add env load command
19: cmd: env: add env select command
20: configs: sandbox: activate env in ext4 support
21: configs: sandbox: activate command env select and env load 22: test: environment in ext4
23: env: ext4: introduce new function env_ext4_save_buffer 24: env: ext4: add support of command env erase
25: test: sandbox: add test for erase command
-------------------------------------------------

In this serie, I add sandbox test with CONFIG_ENV_IS_NOWHERE activated with EXT4 location: load, save and erase.

To test this feature, I add 2 new commands to change the ENV location:
- env select [target]
- env load

To be able to test invalid file (bad CRC), I also add the support of the command "env erase" for EXT4 env location.

[1] http://patchwork.ozlabs.org/project/uboot/list/?series=185725
[2] http://patchwork.ozlabs.org/project/uboot/patch/20200625075958.9868-6-patrick.delaunay at st.com/

Regards

Patrick

Changes in v4:
- don't use env_import in SPL to avoid to increase its size as it is only required for 'env load' command

Changes in v3:
- new
- new
- new: add load ops in nowhere
- new: load operation becomes mandatory
- new: add 'env load' command
- new: add 'env select' command
- change env_get_location to avoid gd->env_load_prio modification
- replace specific sandbox command by generic command 'env select' and 'env load'
- change title "sandbox: support the change of env location"
- replace specific sandbox command by generic command 'env select' and 'env load'
- update after Stephen Warren comments
- replace sandbox command by generic command 'env load' in test_env

Changes in v2:
- change cmd_tbl_t to struct cmd_tbl
- use CONFIG_IS_ENABLED to set .erase (same as .save)

Patrick Delaunay (14):
env: add absolute path at CONFIG_ENV_EXT4_FILE
env: ext4: set gd->env_valid
env: sf: avoid space in backend name
env: correctly handle env_load_prio
env: nowhere: add .load ops
env: the ops driver load becomes mandatory in struct env_driver
cmd: env: add env load command
cmd: env: add env select command
configs: sandbox: activate env in ext4 support
configs: sandbox: activate command env select and env load
test: environment in ext4
env: ext4: introduce new function env_ext4_save_buffer
env: ext4: add support of command env erase
test: sandbox: add test for erase command

 board/sandbox/sandbox.c            |  15 ++++
 cmd/Kconfig                        |  11 +++
 cmd/nvedit.c                       |  29 ++++++++
 configs/sandbox64_defconfig        |   7 ++
 configs/sandbox_defconfig          |   7 ++
 configs/sandbox_flattree_defconfig |   7 ++
 configs/sandbox_spl_defconfig      |   7 ++
 env/Kconfig                        |   2 +-
 env/env.c                          |  80 ++++++++++++++++++--
 env/ext4.c                         |  54 ++++++++++++--
 env/nowhere.c                      |  17 +++++
 env/sf.c                           |   2 +-
 include/env.h                      |  15 +++-
 include/env_internal.h             |   3 +-
 test/py/tests/test_env.py          | 113 ++++++++++++++++++++++++++++-
 15 files changed, 349 insertions(+), 20 deletions(-)
Signature · 1 line
2.17.1