Commit graph

32339 commits

Author SHA1 Message Date
Mark Salyzyn
6dfe87ed87 Merge "liblog: android_log_event_list class permit -EBUSY retry" am: 9e3756f532
am: b5e436bf3d

Change-Id: I169339c921f3e992aa5dc4543cadcf8ec4418be3
2017-04-14 01:38:07 +00:00
Todd Poynor
a03b4dc574 Merge changes I76212f65,I6a29c678 into oc-dev
am: 5975d4e337

Change-Id: I0441dc1f8a9ff11429a253d0510790b20b42e3b4
2017-04-14 01:37:03 +00:00
Mark Salyzyn
b5e436bf3d Merge "liblog: android_log_event_list class permit -EBUSY retry"
am: 9e3756f532

Change-Id: I81a265f6521db89c3013d282ae98e56bdecc79d0
2017-04-14 01:32:39 +00:00
TreeHugger Robot
5975d4e337 Merge changes I76212f65,I6a29c678 into oc-dev
* changes:
  init.rc: create /data/misc/reboot owned by system
  reboot: fix owner and permissions of last_reboot_reason file
2017-04-14 01:29:39 +00:00
Wei Wang
c74c092929 Merge "init.rc: start all 3 servicemanagers early" into oc-dev
am: d12835d19f

Change-Id: I935cc9f8b353a6b513fb825e989156684f27a9dd
2017-04-14 01:26:18 +00:00
Steven Moreland
220e6d824c Merge "libutils: export system_headers" into oc-dev
am: e003513ccf

Change-Id: If2e36fa031010ee6c150bec32ba6cff7d4efae1b
2017-04-14 01:26:07 +00:00
Treehugger Robot
9e3756f532 Merge "liblog: android_log_event_list class permit -EBUSY retry" 2017-04-14 01:23:02 +00:00
TreeHugger Robot
d12835d19f Merge "init.rc: start all 3 servicemanagers early" into oc-dev 2017-04-14 01:15:47 +00:00
TreeHugger Robot
e003513ccf Merge "libutils: export system_headers" into oc-dev 2017-04-14 01:13:33 +00:00
Todd Poynor
fc827be3f9 reboot: fix owner and permissions of last_reboot_reason file
Default signature WriteStringToFile creates world-writeable files.
Set owner and group system and remove read/write for non-owner.

Bug: 37251463
Test: Manual: reboot, inspect
Change-Id: I6a29c678168dcae611b120dc52170f4eee7069a9
2017-04-13 18:03:59 -07:00
Todd Poynor
e092b72bf4 init.rc: create /data/misc/reboot owned by system
Directory will be read and modified by system uid.

Bug: 37251463
Test: Manual: reboot and inspect
Change-Id: I76212f65af991ff9ad0969b9c0b8460b80fb9cd2
2017-04-13 18:01:13 -07:00
Bowgo Tsai
471c3eb6c1 Merge "fs_mgr: adds/changes some public APIs for early mount in init" am: d9b45c5811 am: 951427906d am: 947210be92
am: 9ec99028d2

Change-Id: Ie930993991c17e48cd79005a9d02ece6d211e759
2017-04-14 00:58:42 +00:00
Bowgo Tsai
9ec99028d2 Merge "fs_mgr: adds/changes some public APIs for early mount in init" am: d9b45c5811 am: 951427906d
am: 947210be92

Change-Id: I377a388beaa8816b322d10e8fc033d702ba61397
2017-04-14 00:31:25 +00:00
Bowgo Tsai
947210be92 Merge "fs_mgr: adds/changes some public APIs for early mount in init" am: d9b45c5811
am: 951427906d

Change-Id: I4391eb5b67cab4643c7dad2755023d0c1c3cb678
2017-04-14 00:25:02 +00:00
Bowgo Tsai
951427906d Merge "fs_mgr: adds/changes some public APIs for early mount in init"
am: d9b45c5811

Change-Id: I45bb6a8b651c76c09e2aee5d0b1105aadf1d009f
2017-04-14 00:18:26 +00:00
Treehugger Robot
d9b45c5811 Merge "fs_mgr: adds/changes some public APIs for early mount in init" 2017-04-14 00:10:02 +00:00
Todd Poynor
e1e6edcf33 init.rc: create /data/misc/reboot owned by system
Directory will be read and modified by system uid.

Bug: 37251463
Test: Manual: reboot and inspect
Change-Id: I76212f65af991ff9ad0969b9c0b8460b80fb9cd2
2017-04-13 15:48:11 -07:00
Todd Poynor
dff584659c reboot: fix owner and permissions of last_reboot_reason file
Default signature WriteStringToFile creates world-writeable files.
Set owner and group system and remove read/write for non-owner.

Bug: 37251463
Test: Manual: reboot, inspect
Change-Id: I6a29c678168dcae611b120dc52170f4eee7069a9
2017-04-13 15:48:11 -07:00
Tom Cherry
ec1d24f522 Merge changes Ie5ec609a,I5a2ac369,I690137b5 am: 659b78ed10 am: 01b87aac9c am: 8d9eee4f2b
am: aa85663027

Change-Id: I69be112c0020f7b4ce1a9a92c1e60e8f2941c5a9
2017-04-13 22:25:29 +00:00
Keun-young Park
35a1be5c83 use s_max_mnt_count to detect mke2fs generated partition am: 1c438c1baa
am: 72b8964110

Change-Id: I29ff7632634c9a0c505a7b15bd84941de3eb792f
2017-04-13 22:25:12 +00:00
Steven Moreland
c28517f956 libbase: make vendor_available
By setting vendor_available, the following may become true:

* a prebuilt library from this release may be used at runtime by
  in a later releasse (by vendor code compiled against this release).
  so this library shouldn't depend on runtime state that may change
  in the future.
* this library may be loaded twice into a single process (potentially
  an old version and a newer version). The symbols will be isolated
  using linker namespaces, but this may break assumptions about 1
  library in 1 process (your singletons will run twice).

Background:

This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.

At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.

It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:

https://android-review.googlesource.com/368372

None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.

Bug: 33241851
Test: build and flash internal marlin
Test: m -j libbase
Test: build with BOARD_VNDK_VERSION := current
Change-Id: I720a00deada4e62628e6fbc4ac830265de9c669f
2017-04-13 22:23:11 +00:00
Tom Cherry
aa85663027 Merge changes Ie5ec609a,I5a2ac369,I690137b5 am: 659b78ed10 am: 01b87aac9c
am: 8d9eee4f2b

Change-Id: I5cd7d00f71bfd3970189481f381629cedc358c9b
2017-04-13 21:45:58 +00:00
Keun-young Park
72b8964110 use s_max_mnt_count to detect mke2fs generated partition
am: 1c438c1baa

Change-Id: I756e853149242eadb9e8ab0c3dd6855cc1b6ccb3
2017-04-13 21:42:56 +00:00
Tom Cherry
8d9eee4f2b Merge changes Ie5ec609a,I5a2ac369,I690137b5 am: 659b78ed10
am: 01b87aac9c

Change-Id: I283f720675ee25f9d0ec11c8e8468fbb2473613a
2017-04-13 21:39:52 +00:00
Tom Cherry
01b87aac9c Merge changes Ie5ec609a,I5a2ac369,I690137b5
am: 659b78ed10

Change-Id: I95c78e2f20e9a420855bcdbc08c8b0c3d6094a31
2017-04-13 21:33:30 +00:00
Tom Cherry
659b78ed10 Merge changes Ie5ec609a,I5a2ac369,I690137b5
* changes:
  ueventd: Fix up string handling in handle_*_device_event()
  ueventd: convert mkdir_recursive() to std::string
  ueventd: move subsystem logic from code to ueventd.rc
2017-04-13 21:22:45 +00:00
Wei Wang
00cdc10662 init.rc: start all 3 servicemanagers early
With the binder traffic of composer moved to vndbinder,
vndservicemanager is needed to be started early to get bootanim
displayed quickly.

Also servicemanager is required to be start early to support early
bootanim and sufaceflinger.

Bug: 37306311
Test: bootanim regression fixed
Change-Id: Ice1e05bdb3fe4e67a63a49f1db8afdb018c7b61b
2017-04-13 21:06:17 +00:00
Bowgo Tsai
e4496b85d1 Merge "fs_mgr_avb: refactors how vbmeta is loaded" am: fc500ddb52 am: a6db40c7cd am: 0265f55b44
am: 40ead9f41c

Change-Id: Ia44043112fa875b0f0d7ef0852fb279b5f2eda04
2017-04-13 21:04:59 +00:00
Bowgo Tsai
40ead9f41c Merge "fs_mgr_avb: refactors how vbmeta is loaded" am: fc500ddb52 am: a6db40c7cd
am: 0265f55b44

Change-Id: I4389b2d95fe1a7216e36422359311f23d6a0e768
2017-04-13 20:21:11 +00:00
Mark Salyzyn
7ecfd6ac10 liblog: android_log_event_list class permit -EBUSY retry
write() method was one-shot, a second shot on -EBUSY would always
return -EBUSY even if successful.  Reset internal error if -EBUSY
when retransmitting.  write() now reports a positive count for
transmission success.  Composition errors trump transmission errors.

Test: gTest logcat-unit-tests --gtest_filter=*.descriptive while
      under heavy DOS stress levels of logging.
Bug: 31456426
Change-Id: Ib1920c3f10cf1df8ad8eb6a884724794b577b29d
2017-04-13 13:16:59 -07:00
Bowgo Tsai
0265f55b44 Merge "fs_mgr_avb: refactors how vbmeta is loaded" am: fc500ddb52
am: a6db40c7cd

Change-Id: I353b7601d616aa736d82659ad90c4828aec07383
2017-04-13 20:15:05 +00:00
Bowgo Tsai
a6db40c7cd Merge "fs_mgr_avb: refactors how vbmeta is loaded"
am: fc500ddb52

Change-Id: Ia964c5180682a5b3929b11f801d943024e8db2f7
2017-04-13 20:09:27 +00:00
Treehugger Robot
fc500ddb52 Merge "fs_mgr_avb: refactors how vbmeta is loaded" 2017-04-13 19:58:37 +00:00
Steven Moreland
b084bc3545 libutils: export system_headers
vendor + vendor_available modules built with BOARD_VNDK_VERSION :=
current aren't allowed to use global headers. Since libutils uses
system headers itself, it should export them as well.

Also added some items into windows-deprecated.h. This file is supposed
to be in sync with the libnativewindow variant until all dependencies on
it can be fixed. However, it is missing some updates. This matters when
including libsystem_headers adds system headers before libnativewindow
headers in the lookup paths.

Bug: 33241851
Test: building with BOARD_VNDK_VERSION := current produces many fewer
errors.

Change-Id: I950821f1dae3ddc110db50869247913d5b1aa638
2017-04-13 12:05:16 -07:00
Jeffrey Vander Stoep
52ae5ce19e Merge "init: expand generated attributes on sepolicy compile" into oc-dev am: 57d4c59559
am: be2bfc55f7

Change-Id: I85b3cc759756f3df399c913eb98887cc7c6abccf
2017-04-13 18:45:43 +00:00
Jeffrey Vander Stoep
be2bfc55f7 Merge "init: expand generated attributes on sepolicy compile" into oc-dev
am: 57d4c59559

Change-Id: If3230f31ab3d680c411351d61dc68e5963355d33
2017-04-13 18:37:43 +00:00
Keun-young Park
1c438c1baa use s_max_mnt_count to detect mke2fs generated partition
- Old tool will set it to 10 while mke2fs will set it to -1.
- For now, only tag it.
- TODO: possibly add different policy per image tool version.

bug: 32246772
Test: check dmesg after reboot

(cherry picked from commit 95e233f9ff)

Change-Id: Icd4758e240009d7b37df2d8a0e2a20d5ddbe4906
2017-04-13 11:32:53 -07:00
Jeffrey Vander Stoep
57d4c59559 Merge "init: expand generated attributes on sepolicy compile" into oc-dev 2017-04-13 18:11:08 +00:00
Vijay Venkatraman
9d99f078b2 Merge "Moved include/backtrace to libbacktrace/include" into oc-dev am: 95f9a9678d -s ours
am: 80ea0166f2  -s ours

Change-Id: I7dbe8669719404c2c1d9e4836aa4aafcfe65bacb
2017-04-13 18:05:03 +00:00
Jeff Vander Stoep
d278253378 init: expand generated attributes on sepolicy compile
Expand auto generated attributes in selinux policy when doing
on-device compile of platform + vendor selinux policy.

Bug: 3650825
Test: Build and boot Marlin
Change-Id: Icc1c3af0b504236ae13fd8a5155c2109befd7688
2017-04-13 17:32:51 +00:00
Vijay Venkatraman
80ea0166f2 Merge "Moved include/backtrace to libbacktrace/include" into oc-dev
am: 95f9a9678d  -s ours

Change-Id: Idf9849a35af69c7ca98bc15be1a7d110b0b155da
2017-04-13 17:27:30 +00:00
Vijay Venkatraman
95f9a9678d Merge "Moved include/backtrace to libbacktrace/include" into oc-dev 2017-04-13 16:53:13 +00:00
Vijay Venkatraman
a130b80069 Moved include/backtrace to libbacktrace/include
Export libbacktrace_headers

cherry-pick from commit 8f2c28d572

Bug: 33241851
Test: Build sailfish
Change-Id: Ied4168425ded95724d051ffdc9965c5927bc05ae
Merged-In: Iba310ffc21d17ba542bed954a960ab305037061c
2017-04-13 09:26:20 -07:00
Bowgo Tsai
f07b0847e2 Merge "fs_mgr: adding fs_mgr_get_slot_suffix() public API" am: b26f48f135 am: 4c96971cee am: e203dbb2f6
am: 08d996678c

Change-Id: Iecfdb21bdaab29cdd47ddb9d196306d922fb5730
2017-04-13 14:04:32 +00:00
Bowgo Tsai
08d996678c Merge "fs_mgr: adding fs_mgr_get_slot_suffix() public API" am: b26f48f135 am: 4c96971cee
am: e203dbb2f6

Change-Id: Icca6f2dac8c9bef0d3b1d0d2202371f3e101be19
2017-04-13 13:56:54 +00:00
Bowgo Tsai
e203dbb2f6 Merge "fs_mgr: adding fs_mgr_get_slot_suffix() public API" am: b26f48f135
am: 4c96971cee

Change-Id: Icad63b84bb6de85b1a73db84a784ad8b5bdb0f38
2017-04-13 13:50:49 +00:00
Bowgo Tsai
4c96971cee Merge "fs_mgr: adding fs_mgr_get_slot_suffix() public API"
am: b26f48f135

Change-Id: I201aa8370395eca0ce63c6912df977019c2c2f3b
2017-04-13 13:42:49 +00:00
Treehugger Robot
b26f48f135 Merge "fs_mgr: adding fs_mgr_get_slot_suffix() public API" 2017-04-13 13:26:42 +00:00
Bowgo Tsai
80d1ad17ed fs_mgr: adds/changes some public APIs for early mount in init
Several changes in this CL:
  - Moves class FsManagerAvbHandle to public API
  - Adds a parameter 'wait_for_verity_dev' for FsManagerAvbHandle::SetUpAvb()
    to allow not to wait for verity device gets created
  - Adds FsManagerAvbHandle::AvbHashtreeDisabled() to query whether AVB is disabled
  - Adds fs_mgr_is_avb() to query whether a fstab_rec has MF_AVB flag

Bug: 33254008
Test: test AVB on bullhead
Change-Id: I89c43ca574ae632db8a700fc2590a1f80212c993
2017-04-13 18:29:10 +08:00
Bowgo Tsai
95c966a859 fs_mgr_avb: refactors how vbmeta is loaded
Adds two classes FsManagerAvbhandle and FsManagerAvbVerifier to replace the
following functions or struct:

    - fs_mgr_load_vbmeta_images() -> FsManagerAvbhandle::Open()
    - fs_mgr_unload_vbmeta_images() -> deleted
    - fs_mgr_setup_avb() -> FsManagerAvbhandle::SetUpAvb()

    - androidboot_vbmeta -> FsManagerAvbVerifier
    - load_vbmeta_prop() -> FsManagerAvbVerifier::Create()
    - verify_vbmeta_images() -> FsManagerAvbVerifier::VerifyVbmetaImages()

And only invokes FsManagerAvbhandle::Open() when there is a fstab entry having
'avb' flag (need HASHTREE descriptor). fs_mgr_is_avb_used() can be
removed as it only checks system property "ro.boot.vbmeta.hash_alg" to
decide whether vbmeta needs to be loaded, which might not be accurate.

For example, there are only HASH descriptors in the verified chain but
no HASHTREE descriptors. In this case, the fs_mgr doesn't have to do
anything because it only takes care of HASHTREE descriptors.

Also adds a new class FsManagerAvbOps to provide the C++ binding
FsManagerAvbOps::AvbSlotVerify() for libavb->avb_slot_verify().

Bug: 33254008
Test: test AVB on bullhead
Change-Id: I8fe15ba01c277152630a2a5c1c5c7f25fbf34030
2017-04-13 18:28:53 +08:00