Commit Graph

32821 Commits

Author SHA1 Message Date
Elliott Hughes dd6e73f432 Merge "Preserve errno better in native_handle functions." 2017-05-03 01:02:21 +00:00
Elliott Hughes df3dc783af Merge "Improve "adb sideload" error reporting." am: 66b25eb810 am: f2fe436d32
am: 2b0d807531

Change-Id: I9540db5d8095aa81b8bbc9dca646b61a186a462c
2017-05-03 01:01:10 +00:00
Elliott Hughes 2b0d807531 Merge "Improve "adb sideload" error reporting." am: 66b25eb810
am: f2fe436d32

Change-Id: I38f7972668504f902f3924a0c1872c6f2fad017b
2017-05-03 00:59:08 +00:00
Elliott Hughes f2fe436d32 Merge "Improve "adb sideload" error reporting."
am: 66b25eb810

Change-Id: I46c6ec422611f6f930aa8658f8a91ca41b3b1824
2017-05-03 00:56:08 +00:00
Elliott Hughes 66b25eb810 Merge "Improve "adb sideload" error reporting." 2017-05-03 00:51:09 +00:00
Nick Kralevich fa60816271 Merge "Stop writing NUL bytes in adbkey.pub." into oc-dev
am: 39225a131b

Change-Id: I605a444d9f1b421800f152e281ba93675fcefc2b
2017-05-02 23:01:16 +00:00
Nick Kralevich 39225a131b Merge "Stop writing NUL bytes in adbkey.pub." into oc-dev 2017-05-02 22:56:55 +00:00
Colin Cross 74a923614f Merge "Convert libnetutils to Android.bp" into oc-dev
am: 178b0492ba  -s ours

Change-Id: I8e0b9a3aa56240d44997a422dbb243727427cd8a
2017-05-02 22:21:58 +00:00
TreeHugger Robot 178b0492ba Merge "Convert libnetutils to Android.bp" into oc-dev 2017-05-02 22:09:25 +00:00
Elliott Hughes 09e794c05d Improve "adb sideload" error reporting.
Rather than quietly fall through to the legacy code with no explanation,
say why the first connection failed, and that the second attempt is only
going to be relevant for folks trying to sideload to a pre-KitKit device.

Before:

  $ adb sideload mysid-ota-424425.zip
  opening 'mysid-ota-424425.zip'...
  connecting...
  falling back to older sideload method...
  error: closed

After:

  $ adb sideload mysid-ota-424425.zip
  adb: sideload connection failed: no devices/emulators found
  adb: trying pre-KitKat sideload method...
  adb: pre-KitKat sideload connection failed: no devices/emulators found

Also switch the legacy code to just read+write blocks rather than trying to
load the whole OTA package into RAM (which is in short supply on Win32).
This is probably of no practical use other than that it lets us report a
better error message (better than "terminate called after throwing an
instance of 'std::bad_alloc'").

Bug: https://issuetracker.google.com/37139736
Test: "adb sideload" with no device/a mysid/an angler
Change-Id: Ia568044aac61bd054301ebfd7fcd5ad5d6f3147a
2017-05-02 14:41:04 -07:00
Elliott Hughes a761231b96 Stop writing NUL bytes in adbkey.pub.
In N we moved some code from C to C++ without realizing that EVP_EncodedLength
includes space for a terminating NUL and EVP_EncodeBlock writes one. Because
our key reading code copes with the NUL, we never noticed.

Distinguish between the required space returned by EVP_EncodedLength and the
actual number of bytes (not including NUL) used return by EVP_EncodeBlock.

Bug: http://b/36187819
Test: hexdump of ~/.android/adbkey.pub

(cherry picked from commit 0b771b33fd)

Change-Id: I6e16b8d48d097b4054417c1d1a225bf7ece985b9
2017-05-02 14:11:49 -07:00
Mark Salyzyn 9432fb8d8b libcutils: fs_config.c mark vendor, odm and oem partitions in duplicate
am: fde19425f3

Change-Id: Id2d51a818161b8345332ecbac82784eea4d82dab
2017-05-02 21:07:11 +00:00
Mark Salyzyn fde19425f3 libcutils: fs_config.c mark vendor, odm and oem partitions in duplicate
(cherry picked from commit f0b53d0726)
(added "system/vendor/bin/hostapd" to list)

Cover both direct and symlink indirect paths to the referenced
files in the vendor, odm and oem partitions.

Test: compile and hand-verify properties
Bug: 37703469
Change-Id: I5b3a887e904baee2ac193ac4a73aaaee0bbfdb9f
2017-05-02 11:17:54 -07:00
Felipe Leme 4cc03611cd Don't display bugreport progress when it recedes, for real...
The previous fix was taking account just the progress reported by dumpstate,
not progress/percentage. As such, it was not detecting the cases where the
percentage decreased but the progress didn't.

Bug: 37878670
Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.*

Change-Id: I5830028f3191a9b17f63aeed5c049b29fa7d1179
2017-05-02 10:08:39 -07:00
Bowgo Tsai ea5fca4cd0 init: fix first stage mount failure due to /dev/device-mapper not found
It has been reported that fs_mgr failed to open /dev/device-mapper
during the first stage mount. It's because other uevent (e.g., i2c
charger device) happens to be sent at the same time we're triggering
the device-mapper uevent to be sent. Current implementation returns
COLDBOOT_STOP unconditionally so it will only process the first received
uevent, leaving device-mapper uevent unhandled when the race happens.

Fix this by only returning COLDBOOT_STOP when the received uevent->path
matches that of device mapper.

Bug: 37745254

Test: first stage mount /vendor with vboot 2.0 (avb) on bullhead
Test: first stage mount /vendor with vboot 1.0 on sailfish
Change-Id: I4a77093ec8f90a5ca981a088f34d082d0270533b
2017-05-03 00:38:43 +08:00
Jiwen Cai 9815189c9d Merge "Add NATIVE_WINDOW_CONSUMER_IS_PROTECTED enum" into oc-dev
am: 6399d45725

Change-Id: Ic1b31382ccf4d658a1d36c23bbf276c8d143c620
2017-05-02 16:06:43 +00:00
Jiwen Cai 6399d45725 Merge "Add NATIVE_WINDOW_CONSUMER_IS_PROTECTED enum" into oc-dev 2017-05-02 15:59:26 +00:00
Steven Moreland 525ddd2ceb Merge "libsysutils: Android.mk -> Android.bp" into oc-dev
am: d512ac99d9

Change-Id: Ib65757a4316106bdf09c3f4235dacb46c5712868
2017-05-02 15:41:10 +00:00
TreeHugger Robot d512ac99d9 Merge "libsysutils: Android.mk -> Android.bp" into oc-dev 2017-05-02 15:36:34 +00:00
David Zeuthen c14134bf1b Merge "adb: Support 'adb enable/disable-verity' when using AVB." am: 8fc6cc8910 am: 2b3a568171
am: 1855c98ac2

Change-Id: I2a3946408b9543dfd40343698161a64eebf54277
2017-05-02 15:34:59 +00:00
David Zeuthen 1855c98ac2 Merge "adb: Support 'adb enable/disable-verity' when using AVB." am: 8fc6cc8910
am: 2b3a568171

Change-Id: I59cbbdaf00664f17cf04ee56c10f836e8daff0ab
2017-05-02 15:32:28 +00:00
David Zeuthen 2b3a568171 Merge "adb: Support 'adb enable/disable-verity' when using AVB."
am: 8fc6cc8910

Change-Id: I00ac80a2b878525a543e5fe080a9c5b147b0b141
2017-05-02 15:29:57 +00:00
Tom Cherry 2bdde6d241 init: add an initializer for keychord_id_
am: 3ac3c02b25  -s ours

Change-Id: Iaec2c9a46ade3962e920e5833882456c83bd3264
2017-05-02 15:28:12 +00:00
Treehugger Robot 8fc6cc8910 Merge "adb: Support 'adb enable/disable-verity' when using AVB." 2017-05-02 15:24:25 +00:00
David Zeuthen 91a0f9e970 Merge "fs_mgr: Clear AvbOps struct." am: 6ea4f213d8 am: 983d542d49
am: 86da4a42e8

Change-Id: I3ef678bce70cca718fdb9be28f570b58f1da8f40
2017-05-02 13:44:21 +00:00
David Zeuthen 86da4a42e8 Merge "fs_mgr: Clear AvbOps struct." am: 6ea4f213d8
am: 983d542d49

Change-Id: I77f3230373de0aff17fd66a784b7b25834b97f1b
2017-05-02 13:41:51 +00:00
David Zeuthen 1e033d6804 adb: Support 'adb enable/disable-verity' when using AVB.
Link with libavb_user and use this to enable/disable dm-verity if AVB
is in use.

Bug: 34124301
Test: Manually tested.
Change-Id: Ic03651312b955081cb3c126f6dafc46d6eeec0da
2017-05-02 09:39:55 -04:00
David Zeuthen 983d542d49 Merge "fs_mgr: Clear AvbOps struct."
am: 6ea4f213d8

Change-Id: Ie0e7ff7f1c2c0640912f10d4384f048a49820bea
2017-05-02 13:39:20 +00:00
Treehugger Robot 6ea4f213d8 Merge "fs_mgr: Clear AvbOps struct." 2017-05-02 13:35:58 +00:00
Elliott Hughes bf0492a9a1 Preserve errno better in native_handle functions.
So a caller of native_handle_clone can trust errno to be relevant.

Bug: http://b/37215366
Test: builds
Change-Id: I0992f38ad559db4a02fce07123842dbad8e3f473
2017-05-01 21:34:15 -07:00
Elliott Hughes 5ccb3b97b6 Merge "Stop writing NUL bytes in adbkey.pub." am: d340c1ebbe am: 68c9642a9d
am: a404e8ffe8

Change-Id: Ibc21fe68f20ac9df1cb1683073b7abd7651cf0b7
2017-05-02 00:58:30 +00:00
Chenjie Luo f5e8d05be5 Merge "Modularize logd." am: ab28acef76 am: c955d890de
am: e49500a041

Change-Id: I16c4c6eb7b13a98862a059e17d5c3703beec2370
2017-05-02 00:57:00 +00:00
Elliott Hughes a404e8ffe8 Merge "Stop writing NUL bytes in adbkey.pub." am: d340c1ebbe
am: 68c9642a9d

Change-Id: Ib0ebb4bd8a88437e221d448c545d7698634cd2ff
2017-05-02 00:56:59 +00:00
Elliott Hughes 68c9642a9d Merge "Stop writing NUL bytes in adbkey.pub."
am: d340c1ebbe

Change-Id: Ia0980152cdd937c440aa42c36577670d1e853eea
2017-05-02 00:55:01 +00:00
Chenjie Luo e49500a041 Merge "Modularize logd." am: ab28acef76
am: c955d890de

Change-Id: I2ab27da508f2a1212d3c0617bbf5037665cf3737
2017-05-02 00:55:00 +00:00
Chenjie Luo c955d890de Merge "Modularize logd."
am: ab28acef76

Change-Id: I4d60aa75895a335c9e79f9e069da1d8c873d74a5
2017-05-02 00:53:08 +00:00
Treehugger Robot d340c1ebbe Merge "Stop writing NUL bytes in adbkey.pub." 2017-05-02 00:51:48 +00:00
Chenjie Luo ab28acef76 Merge "Modularize logd." 2017-05-02 00:44:47 +00:00
Tom Cherry 67dfc3e691 Merge "init: add an initializer for keychord_id_" am: 7c3f147070 am: e2865c0f54
am: ea3434e0dd

Change-Id: Ib640d4e04f223d353e6dd8f762acf57792532150
2017-05-02 00:38:32 +00:00
Tom Cherry ea3434e0dd Merge "init: add an initializer for keychord_id_" am: 7c3f147070
am: e2865c0f54

Change-Id: I204d6f0b6ca5bdc58932f9da28fc9630f3453253
2017-05-02 00:36:30 +00:00
Tom Cherry e2865c0f54 Merge "init: add an initializer for keychord_id_"
am: 7c3f147070

Change-Id: I4fd25f216591ad19be6670be79a485995e377b19
2017-05-02 00:33:59 +00:00
Tom Cherry 3ac3c02b25 init: add an initializer for keychord_id_
Add unit test to ensure all POD types of Service are initialized.

Bug: 37855222
Test: Ensure bugreport is triggered via keychord properly.
Test: New unit tests
Merged-In: If2cfea15a74ab417a7b909a60c264cb8eb990de7
Change-Id: If2cfea15a74ab417a7b909a60c264cb8eb990de7
(cherry picked from commit 7da548578c)
2017-05-01 17:32:30 -07:00
Tom Cherry 7c3f147070 Merge "init: add an initializer for keychord_id_" 2017-05-02 00:30:17 +00:00
Tom Cherry e7656b7200 ueventd: do not reference init's sehandle
Init exposes a global 'sehandle' that ueventd references as part of
devices.cpp and util.cpp.  This is particularly dangerous in
device_init() in which both uevent and init write to this global.

This change creates a separate local copy for devices.cpp and puts
restrictions on where init.h can be included to make sure the global
used by init is not reference by non-init code.  Future changes to
init should remove this global.

Test: Boot bullhead

Change-Id: Ifefa9e1932e9d647d06cca2618f5c8e5a7a85460
2017-05-01 17:22:49 -07:00
Jiwen 'Steve' Cai faa4c188d0 Add NATIVE_WINDOW_CONSUMER_IS_PROTECTED enum
The enum is being introduced into libnativewindow, but back ported here
since window-deprecated.h is still being depended by other system
componenets.

Bug: 35726763
Test: videoplayer-nodrm-protected.apk and videoplayer-drm-protected.apk
both works.

Change-Id: I9298ff9b1ddd7f868e59db41e1a84e2cdd3d02b5
2017-05-01 16:41:26 -07:00
Elliott Hughes 0b771b33fd Stop writing NUL bytes in adbkey.pub.
In N we moved some code from C to C++ without realizing that EVP_EncodedLength
includes space for a terminating NUL and EVP_EncodeBlock writes one. Because
our key reading code copes with the NUL, we never noticed.

Distinguish between the required space returned by EVP_EncodedLength and the
actual number of bytes (not including NUL) used return by EVP_EncodeBlock.

Bug: http://b/36187819
Test: hexdump of ~/.android/adbkey.pub
Change-Id: I81a487ddbb5c884593b6426d1f41cfaece26ff90
2017-05-01 16:05:16 -07:00
Tom Cherry 31c0221c04 Merge "ueventd: remove leftovers of the SELinux policy update mechanism" am: 6a8314c8bf am: c2c8f5e0dc
am: e1977a3afb

Change-Id: I9f1df3427e3b3c7f1fa62d86f9b6996d86e21b22
2017-05-01 22:59:29 +00:00
Tom Cherry e1977a3afb Merge "ueventd: remove leftovers of the SELinux policy update mechanism" am: 6a8314c8bf
am: c2c8f5e0dc

Change-Id: I6f6ea1d4f1cef4a6e2f50d95d594e1c53b76c3ce
2017-05-01 22:57:23 +00:00
Tom Cherry c2c8f5e0dc Merge "ueventd: remove leftovers of the SELinux policy update mechanism"
am: 6a8314c8bf

Change-Id: I14053438d05ae8f9be8ddf7e4444c542706a974c
2017-05-01 22:55:22 +00:00
Tom Cherry d5b743c3f3 Merge "ueventd: fix typo from previous patchset" am: c8877530c7 am: 4be091d588
am: 977f21e7bc

Change-Id: I8823eb8f73249424ebc57d7d3551b21e01e8badf
2017-05-01 22:51:21 +00:00