unpackbootimg (squashed)

unpackbootimg ported forward from eclair

Change-Id: I74d2df0b47d40e7105cc58c2b05f8f383dc7f8a0

port forward pagesize arg from eclair

Change-Id: Ia789a4f392a3890aa0efa7efb42032482b48beb0

unpackbootimg should output BOARD_PAGE_SIZE

Change-Id: Ieb5cda01943a33da97eee4d025f56c2c6e7560e8

output page size in mkbootimg

add an option to override the pagesize for boot images created by nubs. ie, acer liquid mkliquidbootimg.

Change-Id: Ie0c7e67edf5ae59019517e72b9be8c0b81388e41
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
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
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
logwrapper: reduce verbosity and fix usage

 - no info on normal process exit
 - basename as tag, not fullpath
 - fix bad "-x" parameter, its "-d", checked in code

Change-Id: Ife72729eaee2a366bd4226f3fbe3ba074219c974
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
rmmod: fix full path syntax

rmmod /system/modules/multitouch.ko
rmmod: delete_module '/multitouch' failed (errno 2)

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
init: implement a new 'log' command, useful to debug property events

liblog is not usable, because stderr and stdout are redirected to
/dev/null to control the android log output.

Only forked processes are able to write to the android logs...

Note: accept parameters: log [-t topic] [-p level] <message>
      limit : strings beginning with "--" are not handled

Change-Id: I2fbf7422e0085d4cdf1bba6511413d1f796d4555
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
Create /cache/dalvik-cache

manually imported commit ba422208f99552f12f34e6f28cc44445f0e6d9e0 by ctso

Change-Id: I617573a14a8cf08d353804016b3351186720d199
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
Allow 'system' user to modify cpufreq control files

This is needed by new CPU Settings in CMParts

Change-Id: I0ec4e0b1705670034a433df549b2895985c476af
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
rootdir: Change sysfs permissions to allow user control ksm

Change-Id: I8a57a3d3bb7b5cd34d58416ca8778dfd6df3111b
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
Restart oneshot services when manually restarted.

Restores manual restart behavior of oneshot services prior to I9935b519.

Change-Id: Iadfc8462838e3ad2dbbe38d76ba2ef0ce955f722
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
Allow system to call custom reboot cmd

Change-Id: Id726b46f644e72c9a67d64777abe1e3dbdbc0a82
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
init: Extend the check for charger mode

In ICS, Google introduced charge mode handling (see http://bit.ly/wfs7ck).
Extend this with check for battchg_pause used in legacy kernels.

Change-Id: Ia8fba16efa2a7d9416e38dd68d4fef84d37aea5e
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
set /system/etc/init.d/* permissions

ported from CM7

Change-Id: I279d78679f7d779d6cd6bbc6c834d94706937ae8
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
Update unpackbootimg to verify the Android boot image magic value. It will also search the first 512 bytes for padding.

Change-Id: I490cba05f2bb616a3f64e3271ecaa61eb9e64be8
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
unpackbootimg: Fix up the padding search in case the magic does not fall on a 8 byte boundary.

Change-Id: I57471f9c2117cd7965b6958ea0aa88e356436da6
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
unpackbootimg: Fix magic search.

Change-Id: I68470b637556a08e48ff72b7ef8811cba13b04ad
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
unpackbootimg: apparently mkbootimg no longer accepts hex values

Change-Id: I95a33f7b40470e4500d418d863a65a75e7aa8499
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>
unpackbootimg: Need to also update the written file.

Change-Id: I45faddbae85273c79b2837f97933634b6e70546f
Signed-off-by: netchip <netchip@netchip-ubuntu.(none)>