Commit graph

27304 commits

Author SHA1 Message Date
Wei Wang
641ff0a4d8 init: add support of multiple class names
Add support of multiple class names in service, so that related services
can be grouped together. By doing this, we can start/stop some services
for special purpose. For example, early zygote, early boot animation
and etc.

Bug: 36535312
Test: marlin boots with defined classes
Change-Id: Ifeaaf034fd836816e24f3775bece53ea83faada6
2017-03-27 20:59:05 +00:00
Treehugger Robot
ca622b4e78 Merge "Revert "Revert "Start hwservicemanager earlier.""" 2017-03-27 17:28:38 +00:00
Treehugger Robot
51da2aaa36 Merge "fs_mgr_avb: fix return value check of fs_mgr_get_boot_config()" 2017-03-27 17:08:33 +00:00
Bowgo Tsai
97db0809f4 fs_mgr_avb: fix return value check of fs_mgr_get_boot_config()
fs_mgr_get_boot_config() returns true/false but the return value check
in current fs_mgr_avb is for 0/1. This was introduced during a refactoring.

Check true/false for the return value.

Bug: 33254008
Test: manual test AVB on bullhead
Change-Id: I72c366627214df4a99c4d9cf1eb577e94f7afb31
2017-03-27 22:33:21 +08:00
Treehugger Robot
d444f8663d Merge "Add ld.config.txt to /system/etc" 2017-03-25 05:17:33 +00:00
Steven Moreland
d627502bb0 Revert "Revert "Start hwservicemanager earlier.""
This reverts commit 5011270225.

Now starting even earlier.

Reason for revert: Needed change, reverted b/c broken device.

Bug: 36278706
Test: original DOA device boots
Test: angler, bullhead, fugu, marlin, ryu
Test: all these devices boot with wipe
Test: all these devices boot with w/o wipe
Test: lshal shows all included services

Change-Id: Ic639aedf7834b1bd3a26d23d109727f5559317e9
2017-03-24 20:52:44 -07:00
Elliott Hughes
f5d727f221 Merge ""Requested dump for tid XXX" message shouldn't be fatal." 2017-03-24 23:29:23 +00:00
Fernando Lugo
0fc8a4b363 Merge "fs_mgr: update to new androidboot.slot param" 2017-03-24 23:29:19 +00:00
Fernando Lugo
9c7ae587c2 fs_mgr: update to new androidboot.slot param
androidboot.slot_suffix is being deprecated for a androidboot.slot.
Bootloader must pass slot used to boot into the androidboot.slot which
does not include the '_' character

Test: boot android
Bug: 36533366
Change-Id: I6137bd08418f67a88120c8609eda10b2ada4607d
Signed-off-by: Fernando Lugo <flugo@google.com>
2017-03-24 23:28:55 +00:00
Josh Gao
c10c31e8ba Merge "adb: allow symlinks to directories in directory_exists." 2017-03-24 18:37:36 +00:00
Christopher Ferris
d13099e66c Merge "Test unwinding through a signal handler." 2017-03-24 17:22:25 +00:00
Thierry Strudel
3ba313597d Merge "Revert "Start hwservicemanager earlier."" 2017-03-24 14:33:18 +00:00
Lorenzo Colitti
438720ac2c Merge "Make the xtables lock readable only by AID_RADIO and root." 2017-03-24 06:25:38 +00:00
Steven Moreland
5011270225 Revert "Start hwservicemanager earlier."
This reverts commit 9e36331174.

Reason for revert: a DOA device

Bug: 36546734

Change-Id: I0456247d362fe43b8c37623d04432eb494f68f68
2017-03-24 06:05:41 +00:00
Elliott Hughes
561da6aa82 "Requested dump for tid XXX" message shouldn't be fatal.
This just means we were asked to dump, not that something necessarily went
wrong.

Bug: http://b/36191903
Test: builds
Change-Id: I5638b38f3a13081b1e971512f43238010febb59c
2017-03-23 23:04:27 -07:00
Treehugger Robot
dd26e1a28c Merge "add kill all for shutdown_timeout of 0" 2017-03-24 05:15:20 +00:00
Treehugger Robot
79e0fb87eb Merge "Fix spelling error in warning" 2017-03-24 04:51:09 +00:00
Treehugger Robot
7f0d15a6f2 Merge "init: use read_file and write_file to implement do_copy builtin" 2017-03-24 02:26:14 +00:00
Treehugger Robot
c1ca1a8328 Merge "init: Prevent spin loop while waiting for exec or property" 2017-03-24 01:52:37 +00:00
Treehugger Robot
186edb1aef Merge "init: Remove superfluous error check" 2017-03-24 01:51:31 +00:00
Treehugger Robot
6e6eb48e71 Merge "add clear log for reboot start / end" 2017-03-24 01:50:57 +00:00
Keun-young Park
aa08ea458a add kill all for shutdown_timeout of 0
- If it is explicitly set to 0, active processes can block
  umount completely. Safe to kill all processes and umount.
- also add additional sync after emulated partition umount
  as that can change /data partition files

bug: 36004738
Test: many reboots

Change-Id: I6c9b07b6fdece44b9caec4e45ecf26a20d0eb96e
2017-03-23 18:01:24 -07:00
Yongqin Liu
82bac0de6d init: use read_file and write_file to implement do_copy builtin
this will make the implementation more cleaner,
and has error message output when failed on some operations

also add the O_TRUNC flag explicitly for the open function
called in write_file.

And add more test on read_file and write_file functions

Test: manual with hikey

Change-Id: Ifc1086a20e85db6980b497b1150a8a7952e672d6
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2017-03-24 08:34:25 +08:00
Tom Cherry
77ddcd5a3f init: Prevent spin loop while waiting for exec or property
Currently, when we are waiting for an exec service or a property, if
there are either any services to be restarted or any more commands to
be run, we set the epoll_timeout to handle these events.  However, we
don't actually restart and processes or execute any commands while
waiting, so this essentially turns this waiting into a spin loop,
particularly in the common case of having more commands to execute,
where epoll_timeout is set to 0.

The change only sets epoll_timeout if we're not waiting.

Note that the only way to stop waiting for an exec service or a
property is for a signal or property to be delivered to init, which
happens through the epoll fds, so it's safe to indefinitely wait for
epoll to return.

Test: Boot bullhead
Change-Id: Iae3b217eb28182038b464fd39df8e7d27b5e23ff
2017-03-23 17:17:54 -07:00
Keun-young Park
3cd8c6f912 add clear log for reboot start / end
- hard to tell if reboot itself is problem or not.

bug: 36004738
Test: reboot and check last kmsg
Change-Id: I0de0e10eac9ac336cc352ddee22a4a1d9e46cb79
2017-03-23 16:55:24 -07:00
Tom Cherry
9bdddd713a init: Remove superfluous error check
new doesn't return nullptr in C++, so there is no need to check for
it.

Test: Boot bullhead
Change-Id: I666afb1ba7082dd8d5b9911605b7e20a5561b49e
2017-03-23 16:44:42 -07:00
Treehugger Robot
9bbbaf1480 Merge "Possible null pointer miss on realloc" 2017-03-23 23:26:40 +00:00
Josh Gao
ff468dce4c adb: allow symlinks to directories in directory_exists.
Bug: http://b/36516955
Test: python test_device.py
Change-Id: Ie81e87aac3b157182bde0955bdba23d48bfea873
2017-03-23 16:19:55 -07:00
Christopher Ferris
5ea2c1f20a Test unwinding through a signal handler.
Also make backtrace_testlib.c C++.

Bug: 34468756
Test: Ran new unit test on host x86, host x86_64, angler (32 bit, 64 bit),
Test: fugu.
Change-Id: Ia810f596c2df56cd56e8ab17e6c19be0c48d737f
2017-03-23 16:16:02 -07:00
Mikhail Lappo
26464914fe Possible null pointer miss on realloc
Realloc can return null pointer which
will cause a crash then. Patch introduces
check for controlled 'die' in case memory is
not available

Change-Id: I279028339b1fe756d8a511834e164e59d4cab110
2017-03-23 22:41:14 +01:00
Elliott Hughes
c0ca39c41a Merge "Switch "adb sideload" over to lseek/read." 2017-03-23 21:06:51 +00:00
Treehugger Robot
390f3b364c Merge "libziparchive: fix mac os breakage" 2017-03-23 20:58:58 +00:00
Treehugger Robot
1e62880f70 Merge "libcutils: fs_config() add check /odm/etc/fs_config_*" 2017-03-23 19:54:14 +00:00
Treehugger Robot
c39a31f002 Merge "Create dir in /data for vendor customization" 2017-03-23 19:36:52 +00:00
Adam Lesinski
b02d690336 libziparchive: fix mac os breakage
Add ftruncate64 to utils/Compat.h definitions for mac.

Change-Id: I82cb46927be911e867b606f4f4429a5e1b1987f7
Test: builds on mac
2017-03-23 12:02:09 -07:00
Brian Carlstrom
6d1da7c607 Fix spelling error in warning
Test: m -j32 -k
Bug: 36450628
Change-Id: I0f6463f3de3dcf45f396c7f406f8c1d6b79bf7f9
2017-03-23 11:29:57 -07:00
Treehugger Robot
0e19795a62 Merge "libziparchive: Add ability to backup in ZipWriter" 2017-03-23 17:59:47 +00:00
Jeff Vander Stoep
61efb0dab8 Create dir in /data for vendor customization
Vendor owns /data/vendor.

HAL data must go in /data/vendor/hardware/.

Bug: 34980020
Test: build and boot AOSP Marlin. Observe /data/vendor and
      /data/vendor/hardware exist and are empty.
Change-Id: I6fe96e3c76a10a5eb480ba10e10d4d006de56c12
2017-03-23 10:30:34 -07:00
Fernando Lugo
27a091d4a1 Merge changes I0ad349f2,I0f528cf1
* changes:
  fs_mgr: allow using legacy A/B suffix
  fs_mgr: adapt to new A/B support
2017-03-23 16:52:51 +00:00
Christopher Ferris
446538b5ad Merge "Initialize si_code in siginfo." 2017-03-23 16:38:11 +00:00
Treehugger Robot
1620c51f75 Merge "logwrapper: add a benchmark for android_fork_execvp_ext" 2017-03-23 11:56:10 +00:00
Narayan Kamath
fa339a4f5c Merge "Logwrapper: Remove unused support for input / output processing." 2017-03-23 10:04:26 +00:00
Narayan Kamath
f704193384 logwrapper: add a benchmark for android_fork_execvp_ext
Current results on an aosp_angler (32 bit) :

Benchmark                           Time           CPU Iterations
-----------------------------------------------------------------
BM_android_fork_execvp_ext   15019207 ns    1002131 ns        700

Test: android_fork_execvp_ext_benchmark

Change-Id: I3d4339ff5cbb9a641cbb14f0b55d2b5fc18cdfde
2017-03-23 10:02:21 +00:00
Treehugger Robot
fcd509298d Merge "Start hwservicemanager earlier." 2017-03-23 03:39:40 +00:00
Fernando Lugo
ce9d7db979 fs_mgr: allow using legacy A/B suffix
Right now all platforms supporting A/B have not fixed
androidboot.slot_suffix kernel command line parameter. To avoid breaking
all those platform allow using legacy support bootloaders get fixed.

Bug: 36533366
Test: boot
Change-Id: I0ad349f262d0b7f4897f3e184cb053b1440b2d5b
Signed-off-by: Fernando Lugo <flugo@google.com>
2017-03-22 19:22:25 -07:00
Fernando Lugo
d1dcedd3fb fs_mgr: adapt to new A/B support
In the new A/B partition support suffixes don't have "_". So, fix fs_mgr
code that assumes it has "_"

Bug: 36533366
Test: boot
Change-Id: I0f528cf1e8fecacb1b4ae34f6dc42e18ebe777bb
Signed-off-by: Fernando Lugo <flugo@google.com>
2017-03-22 19:21:56 -07:00
Christopher Ferris
9642232f13 Initialize si_code in siginfo.
There was at least one failure due to si_code being unitialized
and then examined.

Test: Run the 32 bit and 64 bit version of the unit tests on angler.
Change-Id: I5455a2cd29afafcd26a49f696e61141bb48478dc
2017-03-22 18:06:57 -07:00
Christopher Ferris
a06e1c9eef Merge "Do not access device maps." 2017-03-23 00:32:40 +00:00
Treehugger Robot
6edabc75ab Merge "healthd: Implement scheduleUpdate" 2017-03-22 23:54:02 +00:00
Adam Lesinski
537713bace libziparchive: Add ability to backup in ZipWriter
Based on the compressed size of a file entry,
the decision needs to be made to instead store the file
uncompressed. This adds support to ZipWriter to backup
its last file entry.

The file is now always truncated when the EOCD is written out,
to account for the case where a file entry is backed-up and the
resulting file written is much smaller, leaving garbage data at
the end of the file.

This change also includes a rename of FileInfo -> FileEntry.
This struct was private (now public), so it shouldn't affect any
clients.

Bug: 35461578
Test: make ziparchive-tests
Change-Id: I23dc584406274ab7b8ce62b3fbc3562ca4c2603e
2017-03-22 16:46:42 -07:00