Commit graph

29705 commits

Author SHA1 Message Date
Mark Salyzyn
fa39110a8f libcutils: fs_config test report aliases
Instead of requiring aliases, let's report when we see
system/<partition>/ all by itself, or in the company of the alias
<partition>/.  Report if we see duplicate entries.  Add checking for
overrides as well.  Report any simple corruptions in internal table
or in the override files.

Test: gTest libcutils_test --gtest_filter=fs_config.*
Bug: 37703469
Change-Id: Ia6a7e8c9bc9f553d0c1c313937b511b2073318a9
2017-05-18 15:55:48 -07:00
Mark Salyzyn
2d37797b68 libcutils: fs_config: alias "system/<partition>/" to "<partition>/"
For the known partitions entrenched in the build system: vendor, oem
and odm only. We will alias entries that reference system/<partition>
and <partition>/ so that if either are specified, the rule will apply
to both possible paths.

Test: gTest libcutils-tests
Bug: 37703469
Change-Id: Ida9405cbed323489a3d0599c1645e9be2c7b9d08
2017-05-18 15:54:31 -07:00
Treehugger Robot
64e3f88d69 Merge "init should #include <sys/sysmacros.h>" 2017-05-18 22:47:59 +00:00
Keun-young Park
7fe28d9d9a Merge "add ueventd to shutdown critial process" 2017-05-18 20:59:50 +00:00
Keun-young Park
7264bee975 add ueventd to shutdown critial process
- In some devices, some drivers still try to load firmware while shutting
  down, and crashes the kernel. So keep ueventd to prevent such case.

bug: 38203024
Test: reboots
Change-Id: I4f1910723254ccb69f8e9c78e8727fbd8c7eed3e
2017-05-18 20:58:10 +00:00
Tom Cherry
3d33dae74d Merge "fs_mgr: convert libfs_mgr to Android.bp" 2017-05-18 20:18:00 +00:00
Elliott Hughes
51056c49d2 init should #include <sys/sysmacros.h>
Bug: https://github.com/android-ndk/ndk/issues/398
Test: builds
Change-Id: I6428a6344a3ce649bd03ff9e9b0f156425c67f0c
2017-05-18 09:13:15 -07:00
Treehugger Robot
9397adabd8 Merge "libnetutils: Rename dhcptool to dhcpdbg" 2017-05-18 01:11:32 +00:00
Treehugger Robot
7868a0d82f Merge "Add the functionality for logging counters." 2017-05-17 22:59:55 +00:00
Treehugger Robot
8cfd2971ec Merge "Revert "logd: remove start filtration from flushTo"" 2017-05-17 21:30:20 +00:00
Treehugger Robot
7ce0f00c08 Merge "adb: Allow disabling verity on eng builds when using AVB." 2017-05-17 21:11:46 +00:00
Treehugger Robot
c3b931aad3 Merge "libcutils should #include <sys/sysmacros.h>" 2017-05-17 20:39:39 +00:00
Ruchi Kandoi
b63072e4d0 Add the functionality for logging counters.
Also correct clang-format for libmetricslogger

Test: Run libmetriclogger_test
Change-Id: If61f0bdc394a43e249ec4691da70175eeaf4cec6
2017-05-17 13:18:16 -07:00
Mark Salyzyn
eb45db2cf4 Revert "logd: remove start filtration from flushTo"
Regressed by introducing too much overlap in the results.

This reverts commit 982ad208b5.

Bug: 38341453
Change-Id: I9d630a6b9f3e464f523424b640090f7e268da9bd
2017-05-17 19:55:12 +00:00
Elliott Hughes
d77b537732 libcutils should #include <sys/sysmacros.h>
Bug: https://github.com/android-ndk/ndk/issues/398
Test: builds
Change-Id: I8ca21a74e2856fde09c284aee1343c627d8381e6
2017-05-17 11:36:51 -07:00
David Zeuthen
abddbc2cdf adb: Allow disabling verity on eng builds when using AVB.
Unlike VB1.0, if a device is using AVB then dm-verity is used on any
build (userdebug, eng, etc.). Therefore, we should allow disabling
verity on any build (except USER), not just userdebug. This bug was
pointed out in https://android-review.googlesource.com/#/c/371372/

Bug: 34124301
Test: Manually tested on -eng build on device using AVB.
Change-Id: I314550c13d7458d5d1ef68eb06f98849e11fbe15
2017-05-17 14:28:47 -04:00
Treehugger Robot
67529d29ca Merge "Fix "fastboot flashing"." 2017-05-17 18:25:23 +00:00
Dmitry Shmidt
d3b2d4ff2e libnetutils: Rename dhcptool to dhcpdbg
Also print warning that IP will not allow full connectivity.

Test: Manual

Change-Id: I264c478f07236108a01e766c5264897c2000f008
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2017-05-17 10:47:28 -07:00
Treehugger Robot
75a8233c7e Merge "port metrics_logger to v2 format" 2017-05-17 17:21:55 +00:00
Chris Wren
936fbbdef8 port metrics_logger to v2 format
Bug: 34450377
Test: manual, needs to be a cross-language test
Change-Id: Ib89a48f2c52428deff863b0c28f3c10e7333c8a2
(cherry picked from commit 081492552c)
2017-05-17 10:18:26 -07:00
Treehugger Robot
b03d5a4ba6 Merge "libnetutils: Restore dhcptool" 2017-05-16 23:13:57 +00:00
Dmitry Shmidt
bc592761c9 libnetutils: Restore dhcptool
Despite it is not used for network management, it is
very convenient tool for wifi bringup and debugging.

Test: Manual

Change-Id: I045301acc2dd15d0e68d6b99c8e214865f19ebad
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2017-05-16 14:24:18 -07:00
Treehugger Robot
337b4dd661 Merge "Remove libbase's trivial libutils-headers dependency." 2017-05-16 17:51:14 +00:00
Treehugger Robot
c8c49988b1 Merge "logd: remove start filtration from flushTo" 2017-05-16 15:11:34 +00:00
Treehugger Robot
b9b95ee3a9 Merge "fs_mgr: support different dm-verity error modes" 2017-05-16 01:04:34 +00:00
Elliott Hughes
282ec458be Remove libbase's trivial libutils-headers dependency.
Bug: N/A
Test: builds
Change-Id: I59eb464a0127564a42775bf19b516ad8a53ee235
2017-05-15 17:31:15 -07:00
Elliott Hughes
1eec97af07 Fix "fastboot flashing".
...without breaking "fastboot oem". Turns out the bootloader actually needs
to know whether it's getting a "flashing" or "oem" command.

Bug: http://b/38321935
Test: "fastboot flashing unlock" "fastboot oem uart enable"
Change-Id: I2b3c0b42b01e3c884aa794fa273034a366985089
2017-05-15 16:53:53 -07:00
Treehugger Robot
3cfc1ab89d Merge "logcat: -v thread help missing" 2017-05-15 22:52:29 +00:00
Mark Salyzyn
982ad208b5 logd: remove start filtration from flushTo
We have already searched for the start point, the start filter check
is paranoia that removes out-of-order entries that we are undoubtably
interested in.  Out-of-order entries occur under reader pressure, as
the writer gets pushed back from in-place sorted order and lands it
at the end for the reader to pick it up.  If this occurred during a
batch run or a logger thread wakeup, the entry could be filtered out
and never output to the reader.

Found one case where logcat.tail_time* tests failed which was fixed
with this adjustment.

Test: gTest logd-unit-tests, liblog-unit-tests and logcat-unit-tests
Bug: 38046067
Bug: 37791296
Change-Id: Icbde6b33dca7ab98348c3a872793aeef3997d460
2017-05-15 15:13:20 -07:00
Josh Gao
55ddb99527 Merge changes I8e8e0963,I3c714f63,Id157412e,Ib7c26fbd
* changes:
  adb: libusb: recognize devices with multiple interfaces.
  adb: libusb: wait for devices to become accessible.
  adb: libusb: switch to hotplug for device detection.
  adb: silence noise.
2017-05-15 20:45:06 +00:00
Mark Salyzyn
c74f8d91a5 logcat: -v thread help missing
KISS documentation for -v thread added

Test: manual logcat -v --help
Bug: 37030280
Change-Id: If1ad9d3862a68dfe570b524c36efd4fae5b03262
2017-05-15 13:41:16 -07:00
Treehugger Robot
3d0186b97e Merge "logd: logcat --clear respect pruneMargin" 2017-05-15 20:27:06 +00:00
Treehugger Robot
b8e428110b Merge "fastboot: Add DTS partition support for 'flashall' command" 2017-05-15 19:28:29 +00:00
Dmitry Shmidt
de8c08c612 fastboot: Add DTS partition support for 'flashall' command
Hikey960 has DTS partiton for DT image

Test: Manual
Bug: 38310807

Change-Id: I9f8e9b27ed40ebdd225f3c4e4b30f53e7cdb5ee7
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2017-05-15 10:25:31 -07:00
Mark Salyzyn
0878a7c167 logd: logcat --clear respect pruneMargin
While a reader is present, consider it a success, and not busy, if a
buffer is pruned down to pruneMargin plus one second of additional
margin of logspan.  If not busy, no need to trigger any mitigations
regarding the readers, or to report any errors.

Side Effects are we no longer mitigate the reader when performing
chatty filtration. This is a positive side effect because we were
getting --wrap wakeups that seemed premature.

Add kickMe() and isBusy() methods to ease maintenance and uniformity
of actions.

Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-tests
Test: manual: 'logcat -b all -c' repeat in a loop, at various logging
      load levels, simultaneously 'logcat -b' all in another session.
Bug: 38046067
Change-Id: I3d0c8a2d416a25c45504eda3bfe70b6f6e09ab27
2017-05-15 07:01:42 -07:00
Bowgo Tsai
6879cc1e2e fs_mgr: support different dm-verity error modes
AVB is going to support different modes to handle dm-verity errors.
See the following CL for more details:

  - https://android-review.googlesource.com/#/c/392873/

The verity mode is controlled by bootloader through androidboot.veritymode in
kernel command line. fs_mgr should read the value from there and specify the
corresponding flag when loading dm-verity table into kernel.

Also removes some unused #include libraries.

Bug: 38157502
Test: Manually tested different dm verity modes:
      - "restart_on_corruption" (androidboot.veritymode=enforcing)
      - "ignore_corruption" (androidboot.veritymode=logging)
      - None, default mode is EIO in kernel (androidboot.veritymode=eio)

Change-Id: I80e1e817a148b54fb67ba58112d376dc2cf37c98
2017-05-13 13:24:12 +08:00
Elliott Hughes
81824ebf1f Merge "Add libkeyutils." 2017-05-13 00:28:28 +00:00
Josh Gao
425aefdcf0 adb: libusb: recognize devices with multiple interfaces.
A bug was introduced by commit 8bf37d7a wherein we accidentally only
look at the first interface of a device when checking whether a USB
device was an ADB device or not.

Bug: http://b/38201318
Test: none
Change-Id: I8e8e0963c77cd2cb03538d926ab735f4b57e52b7
2017-05-12 17:08:50 -07:00
Josh Gao
3f60a968e3 adb: libusb: wait for devices to become accessible.
Android's host linux libusb uses netlink instead of udev for device
hotplug notification, which means we can get hotplug notifications
before udev has updated ownership/perms on the device.

When detecting a new device, poll the device file for a while until we
can access it, before trying to open it.

Bug: http://b/38170349
Test: manually incrased timeout and chmodded a device betwen 0 and 664
Change-Id: I3c714f630940df02b407442592301e2bbb3d9653
2017-05-12 17:08:50 -07:00
Josh Gao
6da1cd49b5 adb: libusb: switch to hotplug for device detection.
Switch from polling in a loop to using libusb's hotplug API to detect
when devices arrive and leave. Use this to remove devices that were
inaccessible when they're unplugged.

Bug: http://b/38170349
Test: plugged in device
Change-Id: Id157412eb46834debecb0cd45b47b1ced50c2274
2017-05-12 17:08:50 -07:00
Josh Gao
723258a4c7 adb: silence noise.
Remove logging statements that don't provide any benefit.

Test: none
Change-Id: Ib7c26fbdb019f4d6bbce2b7fb192cb5e6066e53f
2017-05-12 17:08:50 -07:00
Tom Cherry
37b5ada05e fs_mgr: convert libfs_mgr to Android.bp
Test: Build
Change-Id: Ieda384745adbd119020e90c76bcc649ffdffef5f
2017-05-12 17:06:55 -07:00
Treehugger Robot
f218210f6e Merge "liblog: tests: crashes in logcat.descriptive" 2017-05-12 21:58:22 +00:00
Mark Salyzyn
f7690d9196 liblog: tests: crashes in logcat.descriptive
scanTagLine has some loops that do not check for a terminating nul,
problematic for responses from the logger via __getEventTag.

Test: gTest logcat-unit-tests --gtest_filter=*.descriptive
Bug: 37791296
Change-Id: Ib4e900b765b407bdee43e009d6625fe289863ddc
2017-05-12 13:07:08 -07:00
Treehugger Robot
44673da3eb Merge "Enable libprocessgroup on host bionic" 2017-05-12 02:28:06 +00:00
Treehugger Robot
5ed7d39857 Merge "fs_mgr: Update for new libavb API." 2017-05-12 01:17:45 +00:00
Tom Cherry
efa81080fd Enable libprocessgroup on host bionic
Bug: 31559095

Test: Build
Change-Id: I1ee9fb492137c6c16f0d02586393837616127972
2017-05-11 17:55:04 -07:00
Treehugger Robot
dbe9ab1074 Merge "Fix "fastboot oem"." 2017-05-11 23:40:59 +00:00
Elliott Hughes
29d5d7d718 Fix "fastboot oem".
Broken by d6365a7052.

Bug: https://issuetracker.google.com/38216236
Test: "fastboot oem uart enable"
Change-Id: I672d5b96bb16fd77e7af61115b8a38606c691ea8
2017-05-11 15:05:13 -07:00
Treehugger Robot
17254f59a2 Merge "logd: validate and fill in socket credentials" 2017-05-11 21:49:30 +00:00