OSDN Git Service

init: expand usage of property lookup and allow file lookup
authorAndrew Boie <andrew.p.boie@intel.com>
Thu, 25 Oct 2012 21:10:07 +0000 (14:10 -0700)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sun, 16 Jun 2013 06:52:01 +0000 (14:52 +0800)
commitc52e71bd52061b9ede269c50cb16a66a79de74e2
treed56dd35470e0795662f69e788bcb4ba1c87eabfb
parent526635e22c24773d64220d6e318b4c4702498c86
init: expand usage of property lookup and allow file lookup

Currently, the init.rc syntax ${prop.name} to substitute a value
looked up from the property service is only supported for the
setprop, write, and import commands. Here we generalize it so that
the arguments for all commands and services allow for references like
this.

We also introduce the syntax $[/path/to/file] to substitute the
contents of a file (typically a sysfs node), pruning any trailing
newlines from the file first.

Substitutions are always done at the last possible moment; right
when the command is executed or the service is started. If a service
is started/stopped multiple times, the substitutions will always be
re-done each time it starts.

If any substitition fails, the command will not run/service will not
start.

The deprecated syntax $prop.name is no longer supported.

Change-Id: I8560b70f48c0396832d9a7fadc546441e8e81ff9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
init/builtins.c
init/init.c
init/init_parser.c
init/init_parser.h