sbabic / libubootenv

Generic library and tools to access and modify U-Boot environment from User Space
72 stars 39 forks source link

Non-existing devices results in parsing error #33

Open tq-steina opened 5 days ago

tq-steina commented 5 days ago

I just noticed that non-existing files result in a YAML parsing error. This seems a bit unintuitively. In order to provide a general configuration with different, but optional, storage path is provided. If parsing alone, not accessing the env, fails already because some storage devices do not exist, even if are not supposed to be used, this does not work.

Here is an example

uboot:
  size: 0x10000
  devices:
    - path: /dev/mmcblk0
      offset: 0x100000
    - path: /dev/mmcblk0
      offset: 0x110000
uboot-sd:
  size: 0x10000
  devices:
    - path: /dev/mmcblk1
      offset: 0x100000
    - path: /dev/mmcblk1
      offset: 0x110000
uboot-spi:
  size: 0x10000
  devices:
    - path: /dev/mtd0
      offset: 0x100000
      sectorsize: 0x10000
    - path: /dev/mtd0
      offset: 0x110000
      sectorsize: 0x10000