Commit Graph

29705 Commits

Author SHA1 Message Date
Josh Gao ae80841ac7 adb: kill adb_thread_{create, join, detach, exit}. am: e1dacfc1b6
am: d56eebd6c2

Change-Id: Ifde4ae5035c4caf5df66c640bfc28e163dd60b5a
2017-04-14 20:09:58 +00:00
Josh Gao 677a73e5f1 adb: don't try to resolve 'localhost' am: 46de1d7f03
am: 32d7ede78b

Change-Id: If87595c35e362f1fa5c34cba4d7bc1766ec51cd0
2017-04-14 20:09:53 +00:00
Josh Gao d56eebd6c2 adb: kill adb_thread_{create, join, detach, exit}.
am: e1dacfc1b6

Change-Id: I5e0324b33d40f873d196946cee7591de0b7b949c
2017-04-14 20:08:04 +00:00
Josh Gao 32d7ede78b adb: don't try to resolve 'localhost'
am: 46de1d7f03

Change-Id: Ie419c5ddd80938760d7eaa3f50605c9874ca33d7
2017-04-14 20:07:56 +00:00
Todd Poynor d2a6783e25 Merge changes I6a29c678,I76212f65 am: e771b69e72
am: 8e7ba95674

Change-Id: If8aa875c3238da829a2ed8ccc52598386c0f63af
2017-04-14 14:34:28 +00:00
Todd Poynor 8e7ba95674 Merge changes I6a29c678,I76212f65
am: e771b69e72

Change-Id: Icfa83c8939b8fc9fc43f47051d0e42ce9111f48b
2017-04-14 14:28:00 +00:00
Treehugger Robot e771b69e72 Merge changes I6a29c678,I76212f65
* changes:
  reboot: fix owner and permissions of last_reboot_reason file
  init.rc: create /data/misc/reboot owned by system
2017-04-14 14:16:20 +00:00
Bowgo Tsai 0b2d83a64b Merge changes from topic 'avb-early-mount' am: d7381375bb
am: 04989a7a4b

Change-Id: I45d89c806076842ee75a772b1a8bbba2157eb46c
2017-04-14 06:34:00 +00:00
Bowgo Tsai 04989a7a4b Merge changes from topic 'avb-early-mount'
am: d7381375bb

Change-Id: I842610d5812420b93ef43d008f29abff83d9206c
2017-04-14 06:27:02 +00:00
Treehugger Robot d7381375bb Merge changes from topic 'avb-early-mount'
* changes:
  fs_mgr: support AVB in fs_mgr_update_verity_state()
  init: support early_mount with vboot 2.0 (external/avb/libavb)
2017-04-14 06:20:42 +00:00
Bowgo Tsai aaf70e77dc fs_mgr: support AVB in fs_mgr_update_verity_state()
fs_mgr_update_verity_state() is invoked by 'verity_update_state' in
init.rc. It will then set property "partition.system.verified" and
"partition.vendor.verified" to verify_mode. We should support this for
AVB as well.

Also change the order of static libs in init to fix the build error
after this change:
  system/extras/ext4_utils/ext4_crypt.cpp:69: error: undefined reference to 'property_get'

Bug: 35416769
Test: Mount /system and /vendor with vboot 2.0 (AVB), check the following properties exist.
      - [partition.system.verified]: [2]
      - [partition.vendor.verified]: [2]
Test: Mount /system and /vendor with vboot 1.0, check the following properties exist.
      - [partition.system.verified]: [0]
      - [partition.vendor.verified]: [0]

Change-Id: I4328d66a8cb93f26e7960e620a0b2292d5f15900
2017-04-14 12:10:49 +08:00
Bowgo Tsai 8bba52fc4b init: support early_mount with vboot 2.0 (external/avb/libavb)
libavb requires verifying AVB metadata on all verified partitions at
once. For example, /vbmeta, /boot, /system and /vendor. We need to
invoke device_init() for those partitions even if we only want to early
mount some of them, like /vendor and /system.

This CL gets all AVB partitions and the early mount partitions from
device tree through "firmware/android/vbmeta" and "firmware/fstab",
respectively. The following is an example to early mount /vendor
partition on bullhead:

firmware {
    android {
        compatible = "android,firmware";
        vbmeta {
            compatible = "android,vbmeta";
            parts = "boot,system,vendor";
            by_name_prefix="/dev/block/platform/soc.0/f9824900.sdhci/by-name"
        };
        fstab {
            compatible = "android,fstab";
            vendor {
                compatible = "android,vendor";
                dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor";
                type = "ext4";
                mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
                fsmgr_flags = "wait,avb";
            };
        };
    };
};

Bug: 33254008
Test: early mount /vendor with vboot 2.0 (AVB) on bullhead
Test: early mount /system without dm-verity on bullhead
Test: early mount /vendor with vboot 1.0 on sailfish

Change-Id: I89a1f77c97124f309346b33d9e700544b92ecf05
2017-04-14 12:10:20 +08:00
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
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 9e3756f532 Merge "liblog: android_log_event_list class permit -EBUSY retry" 2017-04-14 01:23:02 +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 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
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
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
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
Bowgo Tsai 87d0836cda fs_mgr: adding fs_mgr_get_slot_suffix() public API
The function returns "_a" or "_b" based on two possible values in
kernel cmdline:

  - androidboot.slot = a or b OR
  - androidboot.slot_suffix = _a or _b

Bug: 33254008
Bug: 36533366
Test: boot sailfish
Change-Id: Ia0a524e4145ebf61af5821f42ecad212c95ed748
2017-04-13 18:28:48 +08:00
Hidehiko Abe 8becca0b44 Merge "Force set timezone to UTC in logd." am: 0de940c26d
am: 5cadd1399b

Change-Id: I3b3f9af4e461fab3cde1dca2d4a7785a5ce84089
2017-04-13 07:26:53 +00:00
Hidehiko Abe 5cadd1399b Merge "Force set timezone to UTC in logd."
am: 0de940c26d

Change-Id: I2c68d784b134461bd82bc1d8fe05f95b1ad98225
2017-04-13 07:21:24 +00:00
Treehugger Robot 0de940c26d Merge "Force set timezone to UTC in logd." 2017-04-13 07:14:02 +00:00
Steven Moreland 45d079ac73 Merge "libutils: mark as vendor_available" am: 86c725a4c2
am: 7c8b168c4e

Change-Id: Ie78167b0b908bf97fa018c03ec1c07d8be6158f6
2017-04-13 01:58:29 +00:00
Steven Moreland 7c8b168c4e Merge "libutils: mark as vendor_available"
am: 86c725a4c2

Change-Id: I8e46dc744dca4d0d3400fe1f8325c43ee3d03677
2017-04-13 01:52:29 +00:00
Treehugger Robot 86c725a4c2 Merge "libutils: mark as vendor_available" 2017-04-13 01:40:56 +00:00
Dmitri Plotnikov cff6544e2e Merge "Passing additional parameter to powerctl" am: e0ab2557d4
am: 0c146e6572

Change-Id: Ifd007a10f0a352cb86b61f22608d382696331544
2017-04-13 00:46:54 +00:00
Dmitri Plotnikov 0c146e6572 Merge "Passing additional parameter to powerctl"
am: e0ab2557d4

Change-Id: I9afd4fe2a0c8c1c9de9da7ca1758f4cba6d38a72
2017-04-13 00:41:53 +00:00
Vijay Venkatraman 0a80ee0357 Merge "Moved include/backtrace to libbacktrace/include" am: 83f50843cb
am: 7d9be3527e

Change-Id: I5dde1c0757d2f259c08d7dbd3c4b91655dca56da
2017-04-13 00:33:25 +00:00
Dmitri Plotnikov e0ab2557d4 Merge "Passing additional parameter to powerctl" 2017-04-13 00:30:24 +00:00
Vijay Venkatraman 7d9be3527e Merge "Moved include/backtrace to libbacktrace/include"
am: 83f50843cb

Change-Id: I60786aa4a55bb410dd458c3bb34844678c1d8f44
2017-04-13 00:28:56 +00:00
Vijay Venkatraman 83f50843cb Merge "Moved include/backtrace to libbacktrace/include" 2017-04-13 00:17:13 +00:00
Josh Gao e1dacfc1b6 adb: kill adb_thread_{create, join, detach, exit}.
We have std::thread now, so we can delete this cruft.

Test: python test_device.py
Test: adb_test
Test: wine adb_test.exe
Test: /data/nativetest/adbd_test/adbd_test
Change-Id: Ie1c1792547b20dec45e2a62ce6515fcb981c3ef8
2017-04-12 17:12:32 -07:00
Tom Cherry 3fa467338f ueventd: Fix up string handling in handle_*_device_event()
Bug: 36250207

Test: Boot bullhead
Test: Boot sailfish, observe no boot time regression
Test: init unit tests

Change-Id: Ie5ec609a3f74bb03f5920734ada4d7de57508de4
2017-04-12 16:36:53 -07:00
Tom Cherry 060b74baad ueventd: convert mkdir_recursive() to std::string
Bug: 36250207

Test: Boot bullhead
Test: Boot sailfish, observe no boot time regression
Test: init unit tests

Change-Id: I5a2ac369d846e044230b709fd07eb21ad12d47bb
2017-04-12 16:36:44 -07:00
Tom Cherry 780a71e779 ueventd: move subsystem logic from code to ueventd.rc
Test: Boot bullhead
Test: Boot sailfish, observe no boot time regression
Test: init unit tests

Change-Id: I690137b584fcc2b9cd2dd932a2678f75a56d6737
2017-04-12 16:36:20 -07:00
Jaesoo Lee f560cc78af Merge "disable module loading after BOOT_COMPLETED broadcast" am: 20b7f78204
am: 65c8cb8935

Change-Id: I40a636fba58a0ccaeeeaab3510229dfebf0925a9
2017-04-12 23:13:19 +00:00