Commit Graph

39227 Commits

Author SHA1 Message Date
Ryan Prichard 1325ec8cfb init: use signalfd to catch SIGCHLD
Previously, if init received too many SIGCHLD signals, then the write to
signal_write_fd could fail with EAGAIN. The handler tried to log the
EAGAIN error, and init deadlocked if the interrupted init process had
already acquired a logging-related lock.

Bug: b/77867680
Test: manual
Change-Id: Ief0b5e94d8517827a5a7d03773391ba3ba9447c4
2018-04-12 14:15:26 -07:00
Tom Cherry a1dbeb8d33 init: do not impose vendor_init restrictions on old vendor images
Do not restrict vendor_init restrictions on vendor images that were
built before P, as they will not have the correct permissions.

Bug: 77732028
Test: test new devices and see vendor_init still works
Change-Id: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
2018-04-12 10:17:45 -07:00
David Anderson 04cc5c3616 Merge "storaged: lower capabilities in init"
am: 183b575e78

Change-Id: I087ef881f696b9a23a15d9812248db3da2c09a9c
2018-04-12 09:14:02 -07:00
Pirama Arumuga Nainar b2206b0d43 Merge "Remove more semicolons at the end of namespaces"
am: d652a9e231

Change-Id: I9b75e15b47aada0b95a1364b907a83fe069f4242
2018-04-12 09:03:48 -07:00
Treehugger Robot 183b575e78 Merge "storaged: lower capabilities in init" 2018-04-12 15:55:26 +00:00
Treehugger Robot d652a9e231 Merge "Remove more semicolons at the end of namespaces" 2018-04-12 14:50:07 +00:00
David Anderson 2e0f524713 Merge "storaged: update OWNERS"
am: ffc325a3b2

Change-Id: I6b1d3592d8d3686f2fa78f9a39d2e97e082f8615
2018-04-12 03:28:25 -07:00
Treehugger Robot ffc325a3b2 Merge "storaged: update OWNERS" 2018-04-12 10:18:48 +00:00
Fernando Lugo 11f27f42f5 Merge "fastboot: fix header_actual calculation"
am: 53135a4772

Change-Id: Ic14a7785f248ce15b3e01da0e6cd94b5f7a68921
2018-04-11 23:24:09 -07:00
Pirama Arumuga Nainar 90affce0c8 Remove more semicolons at the end of namespaces
These warnings are triggered by -Wextra-semi (and not -Weverything, as
incorrectly mentioned in I49b6e6af483e011632e6a34c0663c93e5c385aa6).
This warning is added to Hidl-generated libs.

To appease clang-format, this patch also fixes some extra newlines.

Test: Build
Change-Id: I63cf5d8ecba46ad87876ff21848bfff04b12ec6e
2018-04-11 23:14:13 -07:00
Treehugger Robot 53135a4772 Merge "fastboot: fix header_actual calculation" 2018-04-12 05:56:27 +00:00
Jaekyun Seok 00ef7d560c Allow vendor-init-actionable for vold-related properties
Bug: 75987246
Bug: 73871799
Test: succeeded building and tested with taimen
Change-Id: Ifec879f07705a52501757b58b1562a97c668b8b0
Merged-In: Ifec879f07705a52501757b58b1562a97c668b8b0
(cherry picked from commit 65ce3b2cd8)
2018-04-12 12:51:09 +09:00
Fernando Lugo 91dfaecca7 fastboot: fix header_actual calculation
Bug: 77920157
Test: fastboot boot $OUT/kernel
Change-Id: Ibe2f4b9a6476ac11937448e6547b5159af011633
Signed-off-by: Fernando Lugo <flugo@google.com>
2018-04-11 19:02:59 -07:00
Luis Hector Chavez 2980f57f2c init: Use android::base::boot_clock instead of /proc/uptime
/proc/uptime internally uses whatever would be returned by
clock_gettime(CLOCK_BOOTTIME), so use android::base::boot_clock instead
which avoids parsing strings and rounding errors.

Bug: 77273909
Test: CtsBootStatsTestCases
Change-Id: Ic162eefcf226073949a18cca55db3c2324b98749
2018-04-12 01:50:50 +00:00
David Anderson 3214731cc8 storaged: update OWNERS
Bug: N/A
Test: N/A
Change-Id: Ic3e3fbcb4c4357a286ef05feab68e65390e2eab3
2018-04-11 18:50:14 -07:00
Elliott Hughes a0ce036b91 Merge "Build /vendor/bin/logwrapper too."
am: af15fbf9aa

Change-Id: I38612acc94b4379768513b6f13f31d07faaf9f4f
2018-04-11 15:28:11 -07:00
Elliott Hughes af15fbf9aa Merge "Build /vendor/bin/logwrapper too." 2018-04-11 22:14:28 +00:00
Elliott Hughes 689cd77bd1 Merge "Add SIZEOF_MEMBER."
am: 1e4764e90c

Change-Id: Id5feb90cc9e8867b4ea3fd05bead333d385cfe9d
2018-04-11 15:13:01 -07:00
Treehugger Robot 1e4764e90c Merge "Add SIZEOF_MEMBER." 2018-04-11 21:56:25 +00:00
Josh Gao 2e93df2e14 adb: win32: cleanup winsock initialization.
Instead of doing it in 3 arbitrary functions, do it at startup always.

Test: wine adb_test.exe
Change-Id: Ida272d218aee6c331471250edce64d512d3b628a
2018-04-11 12:54:38 -07:00
Josh Gao 011ba4b9bf adb: win32: properly set EBADF in some functions.
Test: treehugger
Change-Id: If3f29f9ee586e29652e9709b3f594a1376ed4bb3
2018-04-11 12:54:38 -07:00
Josh Gao 64a63acba9 adb: partially clang-format sysdeps_win32.cpp.
clang-format some functions that I'm about to touch, but do it in a
separate commit to avoid making the actual changes unreadable.

Test: treehugger
Change-Id: I7dc5258d9ecc1c091d42311149d9e18ae483715b
2018-04-11 12:54:38 -07:00
Josh Gao 116aa0a4ad adb: implement adb_writev.
Change-Id: I55258c155d7b07368ebb45577b2e01ca804cf258
Test: adb_test
Test: python test_device.py
2018-04-11 12:54:36 -07:00
Josh Gao 1ce99576f0 adb: switch apacket payload to a type that doesn't initialize its contents.
Switch from using std::string as the type we use to hold our payload in
apacket to a custom reimplementation that doesn't zero initialize. This
improves bulk transfer throughput in the adb_benchmark microbenchmark
on walleye by ~20%.

Test: adb shell taskset f0 /data/benchmarktest64/adb_benchmark/adb_benchmark
Change-Id: Ibad797701eb1460c9321b0400c5b167b89b2b4d0
2018-04-11 12:54:07 -07:00
David Anderson e54ca5fa0e storaged: lower capabilities in init
Lower storaged's capabilities to DAC_READ_SEARCH as an initial step
toward running it non-root.

Bug: 77634061
Test: storaged still runs and its /proc/pid/status has lower CapPrms
Change-Id: Ibfe0349fc059e2f37efba33f587176e8ce6be9fe
2018-04-11 12:33:02 -07:00
Elliott Hughes 1b86d41c78 Add SIZEOF_MEMBER.
Bug: N/A
Test: ran tests
Change-Id: Icb7e8ae83d242c867b71a990b08eb1a62ed1482c
2018-04-11 12:29:50 -07:00
Elliott Hughes 0b539f3bcb Build /vendor/bin/logwrapper too.
Bug: https://issuetracker.google.com/77284669
Test: builds
Change-Id: Iaafc856f2a7441d318f7b9376caa6629e02a8e23
2018-04-11 08:28:37 -07:00
Dan Willemsen 808c7351c5 Merge "Fix mac build (ldflags -> ldlibs)"
am: 1b2f2ee621

Change-Id: Iff8e64c33629786ca125a53b696eb0ab90eaec20
2018-04-11 01:21:22 -07:00
Treehugger Robot 1b2f2ee621 Merge "Fix mac build (ldflags -> ldlibs)" 2018-04-11 08:11:33 +00:00
Dan Willemsen d81279f7ed Fix mac build (ldflags -> ldlibs)
Test: mmma system/core/fastboot   (on mac)
Change-Id: Ib917758c59fc33d6f8d9bd4f8716cf530c646f54
2018-04-10 22:55:55 -07:00
Elliott Hughes ab30bec294 Merge changes I983f361d,I899c8433,Ie6f4b029,Ic3cb9c82,I27107d05
am: 002959e492

Change-Id: Id80394fb62ce5892a5fbffd6cc73eafa26b55e46
2018-04-10 20:31:11 -07:00
Treehugger Robot 002959e492 Merge changes I983f361d,I899c8433,Ie6f4b029,Ic3cb9c82,I27107d05
* changes:
  Remove unused variable.
  Remove -i vendor id matching.
  Add quotes to -v INFO/OKAY/FAIL for clarity.
  Remove legacy slot-suffix support.
  Add fastboot_test.cpp and test --os-version/--os-patch-level parsing.
2018-04-11 03:22:26 +00:00
Elliott Hughes bcf24c21e7 Merge "Fix Darwin build."
am: fef56f13bb

Change-Id: I9b688db4e00645ac22f366297a3f99fbd68ab7cd
2018-04-10 18:15:18 -07:00
Elliott Hughes fef56f13bb Merge "Fix Darwin build." 2018-04-11 01:02:32 +00:00
Elliott Hughes 7678ffd6d9 Fix Darwin build.
TEMP_FAILURE_RETRY in fs.cpp.

Bug: N/A
Test: N/A
Change-Id: If77da90eeb59e485d5caf4a2e73f7aa91801be2a
2018-04-10 18:01:08 -07:00
Pirama Arumuga Nainar c309a0715f Merge "Remove extra semicolon at end of namespace"
am: 1d2bf45b55

Change-Id: I7209341dea742dc1cdcb2743462b875e95caed10
2018-04-10 17:37:17 -07:00
Josh Gao 994a47cc98 Merge "adb: properly calculate packet size on Mac."
am: ee63d74b6c

Change-Id: I2c4228a1d5bff33ca2db3249e261f98054eb342e
2018-04-10 17:36:33 -07:00
Treehugger Robot 1d2bf45b55 Merge "Remove extra semicolon at end of namespace" 2018-04-11 00:29:29 +00:00
Treehugger Robot ee63d74b6c Merge "adb: properly calculate packet size on Mac." 2018-04-11 00:27:36 +00:00
Elliott Hughes bd86420b83 Remove unused variable.
Bug: N/A
Test: builds
Change-Id: I983f361d3d5a779600077a78b121c4ee399089db
2018-04-10 15:59:46 -07:00
Elliott Hughes f3192bd052 Remove -i vendor id matching.
We removed this from adb years ago.

Bug: N/A
Test: N/A
Change-Id: I899c8433665e64a0c0302d2c30a8e689b8c83d65
2018-04-10 15:38:08 -07:00
Elliott Hughes 234910bc3b Add quotes to -v INFO/OKAY/FAIL for clarity.
This makes it easier to see which part came from the device.

Bug: N/A
Test: fastboot -v flashall
Change-Id: Ie6f4b02933cab21f343998b5fc84f8e487dd3984
2018-04-10 15:34:19 -07:00
Elliott Hughes 42b18a518b Remove legacy slot-suffix support.
Bug: N/A
Test: flashed Pixel
Change-Id: Ic3cb9c8225c75697099723347f7fd820bcadca6e
2018-04-10 15:32:21 -07:00
Pirama Arumuga Nainar eab48ce0d5 Remove extra semicolon at end of namespace
Upcoming clang update to r328903 adds a new warning:
  warning: extra ';' outside of a function is incompatible with C++98
  [-Wc++98-compat-extra-semi]

which is included in -Weverything.

We can just delete the extra semicolon (even though we use gnu99), and
save the extra byte.

Test: Build

Change-Id: I49b6e6af483e011632e6a34c0663c93e5c385aa6
2018-04-10 22:10:54 +00:00
Josh Gao 2ea46521f3 adb: properly calculate packet size on Mac.
OS X reports maxPacketSize as wMaxPacketSize * (bMaxBurst + 1) in the
deprecated GetPipeProperties function. Use the also-deprecated
GetPipePropetiesV2 API to get bMaxBurst and figure out what
wMaxPacketSize is. (This file is going to go away eventually, so don't
bother with switching to the recommended GetPipePropertiesV3, since
it would be a substantially larger charge.)

libusb is unaffected.

Bug: http://b/77733422
Test: python test_device.py
Change-Id: I66517d699a4f39b93ba5eb7882bd8ee6c70f3672
2018-04-10 14:46:34 -07:00
Elliott Hughes 6ebec932d6 Add fastboot_test.cpp and test --os-version/--os-patch-level parsing.
Also switch all remaining headers over to #pragma once, and actually
use FB_COMMAND_SZ.

Bug: http://b/77340848
Test: ran tests
Change-Id: I27107d054c206e66c39208099e36a55df604e08f
2018-04-10 14:24:02 -07:00
Elliott Hughes e60df9a559 Merge "Minimal changes to build fastboot as a library."
am: 20d2159803

Change-Id: Ic24a9abfeb591552b617161112a00e7741bde977
2018-04-10 07:47:01 -07:00
Treehugger Robot 20d2159803 Merge "Minimal changes to build fastboot as a library." 2018-04-10 14:38:50 +00:00
Elliott Hughes 11ff345979 Minimal changes to build fastboot as a library.
Bug: http://b/77809061
Test: builds
Change-Id: I0c388334d643a0a2abf0c03a29f336dc3af2f83f
2018-04-09 20:40:45 -07:00
Dan Willemsen 504696f5c2 Merge "Fix fastboot dist to be compatible with adb"
am: 9e8e19a722

Change-Id: Id99fcf0d421f1cb47b173154af5b61941ccb7dcb
2018-04-09 20:05:59 -07:00