ubi: Fix broken cleanup code in attach_by_scanning

The unwind code was not reversing operations correctly and was causing
a hang on any error condition.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
ubi: Expose a few simple functions from the cmd_ubi

Part, Read, and Write functionality that will be used by env_ubi.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
ubi: ubifs: Add documentation for README

Describe the needed CONFIG tokens to enable UBI and UBIFS support.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
ubi: ubifs: Turn off verbose prints

The prints are out of control.  SILENCE!

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
mtd: Make mtdparts work with pre-reloc env

The env in UBI needs to look up the mtd partition as part of relocation,
which happens before relocation.  Make the mtdparts code capable of
working on the default env to start with.

The code tries to set values in the env as well, but again, the env
isn't there yet, so add a check to setenv to not allow sets before the
env is relocated.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
env: Add support for UBI environment

UBI is a better place for the environment on NAND devices because it
handles wear-leveling and bad blocks.

Gluebi is needed in Linux to access the env as an MTD partition.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
env: Add redundant env support to UBI env

Allow the user to specify two UBI volumes to use for the environment

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>