the file descriptor of the command pipe. The update program can use this pipe to send commands
back to the recovery binary (mostly for UI things like indicating progress to the user).
the filename of the update package zip file.
A recovery package can use any statically-linked binary as the update binary. All the OTA package
construction tools use the updater program (source in bootable/recovery/updater), which provides
a simple scripting language that can do many typical installation tasks, but implementers are free to
substitute any other binary that runs on the device.
Command pipe protocol
Whatever binary is used can control the UI by sending text-string commands back to the parent recovery
system via the command pipe. Each command is terminated by a newline. The following commands are
available:
ui_print text
Prints text to the scrolling on-screen log. Note that this text will only be visible if the user
has enabled text display (typically toggled with a device-specific key combination). The
message will also appear in the recovery.log file that can be accessed via adb on debug-
mode devices.
progress frac secs
Advance the progress meter over the next frac of its length over the secs seconds (must be
an integer). secs may be "0", in which case the meter is not advanced automatically but by
use of the set_progress command defined below.
set_progress frac
Set the position of the progress meter within the "chunk" defined by the most recent
progress command. frac must be in the range [0.0, 1.0]. The progress meter never moves
backwards; attempts to make it do so are ignored.
The updater binary
The updater binary built from bootable/recovery/updater is usually used as the update binary in an
OTA package (but again, that is not required). updater contains an interpreter for a very simple
extensible scripting language (called "edify") that has commands for doing typical update-related tasks.
updater looks in the package zip file for a script in the file META-INF/com/google/android/updater-
script.
edify syntax
An edify script is a single expression. All values are strings. The empty string is considered "false" in a
Boolean context; all other strings are "true". The following operators are available and have the usual
meanings:
( expr )
expr + expr # note: string concatenation, not integer addition!
expr == expr
expr != expr
expr && expr
expr || expr
! expr
if expr then expr endif
if expr then expr else expr endif
function_name(expr, expr, ...)
expr ; expr
Any string of the characters a-z, A-Z, 0-9, _, :, /, . that isn't a reserved word is considered a string literal.
(Currently the only reserved words are if else then endif.) String literals may also appear in
double-quotes; this is how to create values with whitespace and other characters not in the above set. \n,
\t, \", and \\ serve as escapes within quoted strings, as does \x##.
The && and || operators are short-circuiting; the right side is not evaluated if the logical result is
determined by the left side. Thus the following are equivalent:
e1 && e2
if e1 then e2 endif
The ; operator is a sequence point; it means to evaluate first the left side and then the right side. Its
value is the value of the right-side expression. A semicolon can also appear after an expression, so the
effect is to simulate C-style statements:
prepare();
do_other_thing("argument");
finish_up();