Revert "init: Add vendor-specific initialization hooks"

This reverts commit caaa5f1b3befb1587bca159dbda512c24cd10772.

Change-Id: I8137270e3eef9b8681a7c2bdde4a51c052779fb1
init: add detection of charging mode

-when BOARD_CHARGING_MODE_BOOTING_LPM is set to a path_to_sysfs_attribute
 then it and lpm.rc will be read accordingly.

-adapted from techomancer's original change:
 (add detection of charging mode, remove the code for parsing param.lfs,
  since it is not needed)
 http://goo.gl/I19GG

Change-Id: I64c2379225e00afaaf17ee03eab67546781668f8
init: Add option to disable the initlogo

 * It looks like crap on some hardware due to different framebuffer
   formats. Just disable it if the option is set.

Change-Id: Iad8ca25072fd16ca984050c6605bc1646821bee1
Allow a device to define the max number of service groups in init.h

Certain proprieatary binaries (such as tcmd for instance) require
more than 12 supplementary service groups.  By definiing:
TARGET_NR_SVC_SUPP_GIDS := in BoardConfig this can now be changed
per device.

Change-Id: I8f968adc21768ca90232ded7b7e1ffa68dc7ea78
Init: Allow building of init that is compatible with second init boot

When using second init init has already set up /dev /proc, etc
this will prevent duplicate mount points for those
Define BOARD_USE_NO_DEVFS_SETUP := true to use

Change-Id: I5620664b32e08f39da7ef7c7f9c3824d01f930d6
init: define BOARD_CHARGING_CMDLINE parameters

Change-Id: I722e49e2a13418bf887c361c85e9d102168ca973
init: Do not build logo.c when initlogo is disabled

For now, logo.c was build even if TARGET_NO_INITLOGO was true.
Changing tty to KD_GRAPHICS is now done in init.c as it should be, when
the logo is not present.

Change-Id: Ifabd9aebc9c0ad8d6903e963dfac031a6dac32e1
init: Check for symlinks with lstat() not open()

Using open() with an O_NOFOLLOW flag will result in a file falsely
being determined to be a symlink if the open fails for another
reason.

For example, a character device that isn't ready due to the
underlying hardware not being initialized yet will fail to open()

An example of this are any CG2900 device files prior to
execution of ste-cg29xx_ctrl

This uses lstat() instead of open() with O_NOFOLLOW to check
whether a file is a symlink or not.

Change-Id: Ie0d8d94b426c84c29b1b04d41a4cc15536cb307c
Add support for -R (recurse) to init chown builtin.

This is helpful for setting ownerships on entire directory trees,
such as sysfs and selinuxfs, particularly when the precise set of
files is dynamically generated at runtime.

Change-Id: I81070ea36fd7ffcab4ee8b3ef1bb0028d4b7839c
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Change setsebool syntax to be consistent with other init built-ins.

Change setsebool syntax from name=value to name value.
This is to make it consistent with setprop and similar commands.
Update both the init built-in command and the toolbox command
for consistency.

Change-Id: I2c8e016ba26731c4a2ad4a49ae3b89362bf8f8a8
init: Fix some more mergefails

Change-Id: I6fbb230e0f0f4e93f25fb571ae2fb6ccfd12398e
Re-order Board Flags

Change-Id: Ia57aae1d7c12a2cecbc560861d8be18e7d50c63f
init: Add "export_rc" command to export env from a specified file

New export_rc command to import environment variables from
a specified file at the time the command is executed.

Differences between "import" and "export_rc":
1) export_rc can only import environment vars
2) export_rc is performed when the command
   is executed rather than at the time the
   command is parsed (i.e. "import")

Example:
in /init.rc:
    on post-fs
        export_rc /system/etc/init.xyz.rc

in /system/etc/init.xyz.rc:
    export LD_PRELOAD /system/lib/libxyz.so

Change-Id: If616dea5b508c27e9f7a95b5e9db696ecea2fdee
Revert "ueventd: Add bootdevice symlink"

This reverts commit 9914ac71e88bda8ba6fbddba09b6b7439a0a3dc8.

Change-Id: I48ae2b461672931a68725d088e1e4cc59b2573f5
init: Bring back support for arbitrary chargermode cmdlines

This was accidentally removed while debugging the init breakage
fixed in change I8ef5c932efcd5e7f8d6f6fce0915683d84c3ee11. Put
it back

Change-Id: If35b9d5db281f8aab6de26f2bb63717d28b2db30
init: Allow basic environment variable expansion in env assignment

Allow environment variable expansion in 'export' command if the
value begins with "${_var_}" (where "${_var_}" will be replaced
with the current value of environment variable _var_).  Expansion
will only occur one time.

e.g.
export BOOTCLASSPATH ${BOOTCLASSPATH}:/system/framework/abc.jar
(cherry picked from commit 7940299507f15055851a6e8b61ae8d8a7d7f3484)

Change-Id: If9e4adfa1aba2c7a4ca243978ced3c46c2cb4d73
Add support for socket security context specification.

Add an optional argument to the socket option for specifying
a SELinux security context for the socket.  Normally the socket
security context is automatically computed from the service security
context or set using the seclabel option, but this facility allows
dealing with two scenarios that cannot be addressed using the existing
mechanisms:
1) Use of logwrapper to wrap a service.
In this case, init cannot determine the service security context
as it does not directly execute it and we do not want logwrapper
to run in the same domain as the service.

2) Situations where a service has multiple sockets and we want to
label them distinctly.

Change-Id: I7ae9088c326a2140e56a8044bfb21a91505aea11
init: Fix serial number display for semc msm7x30 devices

Add proper check since semc msm7x30 bootloader exports
"serialno" in cmdline instead of the standard androidboot.serialno,
so init doesn't pick it

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: Ib4e715fafc64dd47fb667aeb63a7307334cca844
init: Set the "ro.boot.emmc" property

 * QC switched to this from the old "ro.emmc" property.
 * Set both values since many things depend on this.

Change-Id: I958dbb13b08bd576ad16318683a0eac45dfc6fee
Satisfy my OCD - reformat

Change-Id: Iecb4fdfa3cd9b2292a4a657cf0cc2072dc0dc797