M7: add HTCLOG ifdef to fix signal on M7

Change-Id: I7acf89580a2be37fbfd9b9aca22a1dfa2c1a94e7
set /system/etc/init.d/* permissions

ported from CM7

Change-Id: I279d78679f7d779d6cd6bbc6c834d94706937ae8
healthd: who really needs this dmesg spilling by default

Change-Id: I2cf1a013515f8d50c26c80bb810ee1171575395c
Add group qcom_oncrpc and give permissions to ril-daemon and /dev/oncrpc

Change-Id: I2760d7affcc754da4dad1031250307a16466b73b
diag: Remove world read/write permissions from /dev/diag

/dev/diag has world read/write permissions which is considered
a security risk.  Remove these permissions.  Add new qcom_diag
group for access to /dev/diag

CRs-Fixed: 356415
(cherry picked from commit 14c85ec56fd47c5eb143617a3bd5a6e7ee39cb6e)

Change-Id: I536323a97e19a07bbd8eadffa0265d1955590285
init: added missing permissions

Else PerformanceControl will not be able to change them
-scaling_min_freq
-scaling_governor
-I/O scheduler

Change-Id: I55eb68087e991a906d91009b0a9bc43f0b162635
Conditionally Revert "put back the unused virtuals in Vector<>"

These symbols are needed for MR2 camera.tegra and other blobs,
but they conflict with KK blobs so define it for devices that
need it by setting COMMON_GLOBAL_CFLAGS += -DNEEDS_VECTORIMPL_SYMBOLS

Change-Id: I59e66074526f013918a29c3afc10e52b9812778c
init: fixup cpufreq permissions

It is safe to have read permissions for everyone
Also required for the CPU info overlay service

PS3:
add cpu0-cpu3

PS4:
mke this work on at least a few devices :)

Change-Id: I1de067f63121a8a19f29d4e994fbc3bf73054556
rootdir: Allow to use a custom environ.rc

This is helpful for device which relies on blobs that needs their dependencies to be placed on a different dir

Change-Id: Ic5ebb7abe6ea97599c28c8a0d61350358b18fda6
Add unpackbootimg

Change-Id: Ief536352a659ac99df04ab3a8b91cd311644f5df
charger: Add support for non-standard charging interfaces

 * Certain devices may have multiple battery devices or broken uevent
   reporting when a power supply is disconnected.
 * Add a new BOARD_BATTERY_DEVICE_NAME to force which device to monitor.
 * Needed for galaxys2 family
   https://gerrit.omnirom.org/#/c/3979/

Change-Id: I3045bf17a4d962cc5f0e6a951472916412ac0d0d
These are important to restoring sdcard0 mount. Target msm devices.

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

PS2: Fix spacing.

"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."
This fixes weird framebuffer distortion on certain devices, if
TARGET_NO_INITLOGO is set to true in some device makefile.

Change-Id: I51153a6a7aa49013de82f625bd58a528da8b8115
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
init: Add vendor-specific initialization hooks

Allow optional vendor-specific initializations
within init.  This can be used for runtime
initialization setup that init rc scripts do
not support.

Change-Id: I7623a0d59b18f9ec8e3623958e2f7ccd72b877bf
(cherry picked from commit a36f7998a135a63934465889f089f96deefe7c42)
(cherry picked from commit 2ce27688b13bbc9a2237442ec2d6a554325ef658)
(cherry picked from commit 8e4dc4f79011bf0a8832e8d1251fc17b3e542057)
init: Add a mechanism to extend the property service in device configs

Instead of every so often adding a new set of stuff here for a specific
device, let the device includes overload the property arrays. The
new device_perms.h header documents it

Change-Id: I477e27abebeb4b85abe5fcaf19333999b1625417
unpackbootimg: Add support for device trees

Change-Id: I340eed99d2274a2f4cbaf5a9f27726ff3a9302e5
init: allow system UID to setenforce and set booleans

Allow system UID to setenforce and set booleans for SELinux.
Boolean ownerships must also be reset upon policy reload as
the boolean files in selinuxfs are regenerated to match the new policy.

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I0dae393892753b4745e6c956289196338bf771d5
core: Add API to retrieve mtu size

Adding an API to libnetutils to retrieve mtu size of an interface
Made few utility functions from ifc_utils public

Change-Id: Iddec2dcd9f241b146d7f362e2df0724cf740d1f2
(cherry picked from commit 108cded7d96cc347f36b5b78c404c5ebccce13d7)
Use RECOVERY_PRE_COMMAND before calling __reboot() recovery

For the Power menu,
frameworks/base/core/jni/android_os_Power.cpp#L180
already uses RECOVERY_PRE_COMMAND if
TARGET_RECOVERY_PRE_COMMAND is defined in the
BoardConfig.mk for a device to make a system() call before
calling __reboot() for recovery. This commit adds
the same thing to the other places that we know we are
getting into recovery using __reboot(), namely,
adb reboot recovery, the reboot binary and init
in the case of errors.

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: If0a9c7f22de2aa187c921b60ad5edd77b49e095d