restorecon /data/misc/media.

Otherwise it will be mislabeled on upgrades with existing userdata.

AOSP: https://android-review.googlesource.com/79022/

Signed-off-by: Humberto Borba <humberos@gmail.com>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Change-Id: Ibde88d5d692ead45b480bb34cfe0831baeffbf94
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: 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
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
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
charger: allow custom charger res

Change-Id: I9fefc823f72fd34b10073179e9f6d4b1f4831895
Example: BOARD_CHARGER_RES := device/samsung/galaxys2/res/charger
Merge "restorecon /data/misc/media." into android-4.4
Merge remote-tracking branch 'cm/android-4.4' into android-4.4