init: Look for options in u-boot environment

Look in the saved u-boot environment for init options in addition
to the kernel command line.  This allows setting options to run
in the u-boot environment instead of setting bootargs.

Look at specific variables but not the whole environment so that
users can setup variable to run.  Look at two variables so scripts
can automatically clear one on successful boot as one-time options
(defer that to the full filesystem).

Instead of having the full fw_setenv / fw_getenv binaries which
would overflow the existing space for the initramfs, just use the
busybox strings command to extract the variables.  The oldest
variable might get a crc32 character or flag byte if redundant
environment were configured for nand but that is not expected
to be these user defined variables.

[1] The environment consists of a crc32, a flag byte if a
redundant environment is configured, then a series of var=value
strings separated by NUL bytes.  The flag byte is 1 (active) or 0
(obsolete) for NOR flash, or a counter 0-255 in nand, the flag
byte cycles through 0-255.

Signed-off-by: Milton Miller <miltonm@us.ibm.com>
1 file changed
tree: d9bb0d80b0c5ecb8cc92bff19e1288f207f42382
  1. classes/
  2. common/
  3. conf/
  4. COPYING.apache-2.0
  5. COPYING.MIT
  6. LICENSE