Commit graph

29534 commits

Author SHA1 Message Date
Tom Cherry
672dd970f4 Merge "ueventd: do not reference init's sehandle" 2017-05-03 18:14:38 +00:00
Christopher Ferris
deb19a631f Merge "Move libc_logging to libasync_safe." 2017-05-03 17:43:35 +00:00
Treehugger Robot
c50245e43e Merge "libcutils: convert fs_config.cpp" 2017-05-03 16:48:44 +00:00
Treehugger Robot
499af38623 Merge "Don't display bugreport progress when it recedes, for real..." 2017-05-03 15:21:26 +00:00
Mark Salyzyn
163ecc68c7 libcutils: convert fs_config.cpp
C++ify fs_config.c

Test: gTest libcutils-test
Bug: 37703469
Change-Id: Id48ae22f203ed923942257575296c69b32345ae6
2017-05-03 08:04:35 -07:00
Christopher Ferris
ac225780dd Move libc_logging to libasync_safe.
Move the name of the "private/libc_logging.h" header to <async_safe/log.h>.

For use of libc_malloc_debug_backtrace, remove the libc_logging library.
The library now includes the async safe log functions.

Remove the references to libc_logging.cpp in liblog, it isn't needed because
the code is already protected by a check of the __ANDROID__ define.

Test: Compiled and boot bullhead device.
Test: Run debuggerd unit tests.
Test: Run liblog unit tests on target and host.
Test: Run libmemunreachable unit tests (these tests are flaky though).
Change-Id: Ie79d7274febc31f210b610a2c4da958b5304e402
2017-05-02 18:38:46 -07:00
Treehugger Robot
0447a3e5d1 Merge "init: fix first stage mount failure due to /dev/device-mapper not found" 2017-05-03 01:33:07 +00:00
Elliott Hughes
dd6e73f432 Merge "Preserve errno better in native_handle functions." 2017-05-03 01:02:21 +00:00
Elliott Hughes
66b25eb810 Merge "Improve "adb sideload" error reporting." 2017-05-03 00:51:09 +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
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
Treehugger Robot
8fc6cc8910 Merge "adb: Support 'adb enable/disable-verity' when using AVB." 2017-05-02 15:24:25 +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
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
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
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
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
6a8314c8bf Merge "ueventd: remove leftovers of the SELinux policy update mechanism" 2017-05-01 22:48:29 +00:00
Tom Cherry
c8877530c7 Merge "ueventd: fix typo from previous patchset" 2017-05-01 22:36:12 +00:00
Tom Cherry
7da548578c 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
Change-Id: If2cfea15a74ab417a7b909a60c264cb8eb990de7
2017-05-01 15:35:07 -07:00
Treehugger Robot
1879c00e64 Merge "base: remove execute bit from utf8.cpp, utf8_test.cpp." 2017-05-01 21:57:28 +00:00
Josh Gao
dd3667059b Merge "Revert "base: make boot_clock work on host linux, hide it on non-linux."" 2017-05-01 21:57:14 +00:00
Josh Gao
0b35b18f88 Revert "base: make boot_clock work on host linux, hide it on non-linux."
This reverts commit ae29339ca1, which broke the darwin build.

Change-Id: Ib33e2dab197532f04944cb12151002e9219b1bb5
2017-05-01 21:56:28 +00:00
Treehugger Robot
43e9106410 Merge "libcutils: fs_config.c mark vendor, odm and oem partitions in duplicate" 2017-05-01 21:01:58 +00:00
Elliott Hughes
05eed13247 Merge "Simplify "adb sync" documentation." 2017-05-01 20:51:43 +00:00
Josh Gao
eaad4e28e8 Merge "base: make boot_clock work on host linux, hide it on non-linux." 2017-05-01 20:49:50 +00:00
Erik Staats
d6f8b5f2d4 Merge "Change set_sched_policy to set slack for current thread." 2017-05-01 18:35:30 +00:00
Elliott Hughes
0754cb929c Simplify "adb sync" documentation.
Remove -p (which only applied to "adb sync"), explicitly mention
$ANDROID_PRODUCT_OUT in the "adb sync" help text, and add "adb sync all"
as a synonym for "adb sync" for ease of documentation.

Bug: http://b/33761074
Test: "adb sync" still works, "adb --help" looks good
Change-Id: Ie5b2459a7e5e4140298f78815be25fa7c7bb47d0
2017-05-01 11:04:31 -07:00
Tom Cherry
f51c66b23b ueventd: fix typo from previous patchset
An forward declaration for a function that was removed in later
patchsets was merged anyway.  Since it's not used anywhere, this CL
removes it.

Test: build bullhead
Change-Id: Ie7223f7d23305b71438cb063b64a574ce32f96bb
2017-05-01 10:53:39 -07:00
Tom Cherry
6daf514448 ueventd: remove leftovers of the SELinux policy update mechanism
Reloading sepolicy has been removed from the system, so this support
code can also now be removed.

Bug: 26544104
Test: Boot bullhead
Change-Id: If9dbc9d540d9a69340c1dd6a483c1f8fe5feb287
2017-05-01 10:39:03 -07:00
David Zeuthen
16c6fd1da7 fs_mgr: Clear AvbOps struct.
This ensures that future operations (e.g. function pointers in the
AvbOps struct) added to AvbOps are set to NULL.

Bug: 37709309
Test: Manually tested on UEFI-based bootloader.
Change-Id: If83ea57b7abad94e472768c594efa210e3351a4d
2017-05-01 13:25:20 -04:00
Treehugger Robot
16214f2955 Merge "logd: CTS test" 2017-05-01 16:50:50 +00:00
Treehugger Robot
ae10af6050 Merge "liblog: __android_log_error_write in vndk" 2017-05-01 16:23:39 +00:00
Mark Salyzyn
f0b53d0726 libcutils: fs_config.c mark vendor, odm and oem partitions in duplicate
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-01 16:17:31 +00:00
Steven Moreland
64328403b5 liblog: __android_log_error_write in vndk
Also added log_safetynet.h header. This contains a memory sensitive logging
function which is used to detect attack attempts.

Fixes: 37442967
Test: liblog-unit-tests on internal marlin
Test: build liblog with BOARD_VNDK_VERSION := current on aosp_arm
Test: libbinder vendor variant links with BOARD_VNDK_VERSION := current

Change-Id: Icfcc2b1acbb3712bf4c84403870dc93401eafb15
2017-05-01 14:40:55 +00:00
Elliott Hughes
4c8acafa25 Merge "Remove unused cruft from <cutils/bitops.h>." 2017-04-30 02:45:46 +00:00
Elliott Hughes
0e8810ccbe Remove unused cruft from <cutils/bitops.h>.
Bug: N/A
Test: builds
Change-Id: I5931f2b91b2d64d8e26f9ba092879c14d0ed3622
2017-04-29 10:22:40 -07:00
Treehugger Robot
6de56724a2 Merge "lmkd: Android.mk -> Android.bp" 2017-04-29 08:14:21 +00:00
Treehugger Robot
0914d2bdff Merge "fs_mgr: code clean up" 2017-04-29 03:21:33 +00:00
Chenjie Luo
fafea32468 Modularize logd.
Separates logd body into a static library liblogd and
virtualize LogBuffer::log to be in a new interface class
LogBufferInterface. User could have different implementation.

Bug: 37756450
Test: liblog-unit-tests, logd-unit-tests and logcat-unit-tests
with (b/37791296).
Change-Id: I1504ff0e992744001b5a2e9abd45692d1318a152
2017-04-28 17:30:25 -07:00
Steven Moreland
1457c9290d lmkd: Android.mk -> Android.bp
Test: links
Change-Id: I19aa62270488af02d64830ca90faf80b35423009
2017-04-28 15:20:18 -07:00
Mark Salyzyn
2bd06f2895 logd: CTS test
Utilize logd-unit-tests as a CTS test

Goal is to check if the kernel logger is enabled.

Test: run cts tests
Bug: 31772697
Change-Id: I6d80350f3e40aff095f81b6600c40dd7d376bd74
2017-04-28 13:50:56 -07:00
Keun-young Park
483d2f9a59 Merge "combine wait for exec log with service exit log" 2017-04-28 20:12:00 +00:00
Josh Gao
ae29339ca1 base: make boot_clock work on host linux, hide it on non-linux.
boot_clock was previously returning zero on any platform that doesn't
define __ANDROID__, including host bionic. Instead of returning a bogus
value, just hide it on non-Linux platforms.

Bug: http://b/37758947
Test: libbase_test32/64 on linux
Change-Id: I96e1d8b92dc44c6308408900cf0d27e1e7db5569
2017-04-28 13:00:00 -07:00
Treehugger Robot
9349b72a67 Merge changes I5b1a1ce0,I483a18f9
* changes:
  fastboot: Add 'get_staged' command
  fastboot: Add 'stage' command
2017-04-28 18:34:08 +00:00
Keun-young Park
4de31e1481 combine wait for exec log with service exit log
- allows easier tracking of wait time from monitoring tools
- this change also reduces unnecessary log spam
- service exit log looks like this:
  init: Service 'exec 4 (/system/bin/otapreopt_slot)' (pid 611) exited with status 0 waiting took 0.060771 seconds

bug: 37752410
Test: reboot and check log
Change-Id: I122902538697f33939eede548e39f155ec419e03
2017-04-28 11:20:12 -07:00