Build - eat: Automated install of fresh builds

Needs:
1 - a build
2 - a connected device

envsetup: eat safely

eat more safely, if there is something to eat

Check for zip file presence before trying to eat

Fixed eat not waiting for device if adb server was not started

$(adb get-state) returned unexpected starting server message
causing the if statement to fail. Calling "adb start-server"
beforehand remedies that.

Patch Set 2:
$(adb get-state) returns 'unknown' if Clockwork recovery is running on
the device
look for /sbin/recovery and 'pass' the state test
also
adb wait-for-device
will result in endless loop, replace with until loop using with get-
state OR 'recovery' tests

Patch Set 3:
fix the initial adb state test, use AND instead of OR

Patch Set 4:
Rebased and prevent "device not found" message from spamming the screen
by
redirecting error output to null

Updated for CM9 variables

eat: Adapt to new file naming scheme

eat: Adapt to new storage paths

envsetup: Make eat restart adbd as root before pushing the recovery
command

Without adbd running as root we can't write to /cache/recovery and
eat fails with a permission denied.

Eat: Option to specify directory of zip in recovery mode

It pushes to /mnt/sdcard0, which may be /emmc/ in recovery. Now the user
can specify another path other than /sdcard/ where the zip is

fix "eat"

Assume user 0 is the active one when flashing...

eat: Use /cache if possible

* Check the size of /cache and use it if possible.

Change-Id: I0c96ed8664a8e8d9965cef33844d9847fdd5ef47
Signed-off-by: STELIX <ssspinni@gmail.com>