About
-----

arm-boot-config is an automatic boot.scr generator.  If you run it every time
you install or uninstall a kernel you will always have a current boot.scr
that allows you to boot all installed kernels with their associated dtbs.

Written by Brendan Conoboy <blc@redhat.com>.

Installation
------------

Install with 'make install' as root.  Once installed you can regenerate
your boot.scr at any time by running /sbin/a-b-c.  If you install
or uninstall a kernel with rpm then grubby will run a-b-c for you
automatically.


TI Boards
---------

ARM Boards from Texas Instruments often lack any flash storage on which
to store uboot environment.  Additionally, these systems often do not have
sufficient distinction in the uboot environment to produce a unique finger
print.  To handle this situation, a-b-c uses a user-created environment
variable named "tiboard" to uniquely identify the system that u-boot is
running on.  The typical place to set this is in the board's uEnv.txt,
stored along side MLO and u-boot.bin.  A typical uEnv.txt might look
like this:

---
tiboard=panda_es
bootcmd=ext4load mmc 0:3 0x2000000 /boot/boot.scr; source 0x2000000;
---

Other valid values for tiboard include panda, panda_es, panda5, beagle,
beagle_xm, and bbone.


Making Enhancements
-------------------

You can add support for new boards by adding a script to detect your device
in /etc/a-b-c.d.  Boards detection routines are customarily placed at
sequence 20.  These scripts run in uboot using the "hush" shell which is
a limited sh-like environment featuring "if" and "for" statements.  A
primitive "test" is available with -z (is zero?), -n (is non-zero?) as
well as = and != string comparisons.  The $0 parameter is set after each
command.  To add a new board, find a uboot environment fingerprint unique
to your board, test for this fingerprint, then set the appropriate u_env
variables.  This minimally includes the load address for the kernel,
initramfs, and dtb, as well as the dtb filename.  A good console= setting
is also very desirable.  Some uboot 'printenv' outputs from other boards
are included to check against to ensure the fingerprint you create is
sufficiently unique.


Sanity checks for developers
----------------------------

Note: Devices such as the trimslice are limited to 15 tokens max per
u-boot enivornment variable.  This requires chaining a lot of variables
together or diligent escaped quoting.

Do not edit catcat.  It will eat your brain.

The number one syntax error is in forgetting to escape ";" in a setenv
that itself runs setenv.  This often results in uboot trying to run the
command "fi" or "done" from the end of an "if" or "for" statement.


TODO:
-----

Some spaghetti coding conventions in use.  Restructure flow.

Consistent quoting conventions are not used - maintenance issue. Tidy.

Move system detection into functions so they can be rerun once u_dtb is
set.
