Commit graph

42410 commits

Author SHA1 Message Date
Chih-Hung Hsieh
3487e22b66 Use multiple patterns and emails in per-file syntax.
Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: I60460b93903afbb01a87d7f11ac526fbde9f392c
2018-08-27 10:19:32 -07:00
Treehugger Robot
472223ee35 Merge "getevent: O_RDWR -> O_RDONLY | O_CLOEXEC" 2018-08-25 15:22:59 +00:00
Treehugger Robot
993ae1f271 Merge changes Ifab22a4c,I03eb9c78
* changes:
  fs_mgr: add fs_mgr_has_shared_blocks and make default if overlayfs
  fs_mgr: add overlayfs for small-space filesystems
2018-08-25 00:14:47 +00:00
Tao Bao
eff7027a8c Merge changes from topic "init_defaults"
* changes:
  init: Build init_tests only for the first arch.
  init: init_defaults uses more shared libraries.
2018-08-24 21:48:41 +00:00
Nick Kralevich
38e9f2320a getevent: O_RDWR -> O_RDONLY | O_CLOEXEC
No need to open the device read write. Just open it read-only.

This is a partial redo of
https://android-review.googlesource.com/c/platform/system/core/+/334583
which was reverted in
https://android-review.googlesource.com/c/platform/system/core/+/342483

Bug: 30861057
Test: ran getevent, saw correct output, played with device
Change-Id: I426efd68f39dcd97d3ee23c13ed1a9ed96cb4c2e
2018-08-24 12:16:17 -07:00
Tao Bao
a3d36a8ce7 init: Build init_tests only for the first arch.
Not all the dependent shared libs are installed on device with both
arches. For example, we don't have 32-bit `libfs_mgr.so` or
`libbootloader_message.so` on marlin, which would cause 32-bit
`init_tests` to fail.

Bug: 112494634
Test: Run (64-bit) init_tests on marlin.
Test: `m -j continuous_native_tests` with aosp_marlin-userdebug. Check
      that only 64-bit init_tests is included in
      `continuous_native_tests.zip`.
Change-Id: I999d58750d48c34df7dbabccf8863a6ccaf0b83c
2018-08-24 11:28:54 -07:00
Treehugger Robot
07c2c9a58d Merge "Added support to fuzzy_fastboot for more sparse tests" 2018-08-24 17:54:24 +00:00
Tao Bao
66209ca9bf init: init_defaults uses more shared libraries.
This CL switches init_defaults and thus init_second_stage to depend on
commonly used shared libraries. In particular, use the following shared
libs that have been available on device (under both of normal boot and
recovery):
 - libbootloader_message
 - libext4_utils
 - libfs_mgr
 - libhidl-gen-utils
 - libkeyutils
 - liblogwrap

The following transitive dependencies have been dropped. They were only
needed when including the above libs statically. Dropping them doesn't
further affect the size though.
 - libfec
 - libfec_rs
 - libsquashfs_utils

With the change, the second stage init size has been reduced from
1094328 to 627992 bytes (aosp_taimen-userdebug), with no new shared libs
installed.

Also evaluated the impact of using `libprotobuf-cpp-lite.so` and
`libseccomp_policy.so`. It doesn't look beneficial -- at least not right
now with `init` as the singler user.
 - statically linked them both: 627992-byte
 - with libprotobuf-cpp-lite.so: 605880 (init) + 262624 (.so)
 - with libseccomp_policy.so: 605848 (init) + 32208 (.so)

Bug: 112494634
Test: `mmma -j system/core/init` with aosp_marlin-userdebug
Test: Flash the marlin build on device. Run init_test.
Test: Boot into recovery successfully.
Change-Id: I49debe9066ff36dfda55b08266862e29e2bfc96b
2018-08-24 10:54:24 -07:00
Treehugger Robot
a37dada049 Merge "Fix mac build breakage due to missing usb_osx.cpp in Android.cpp file for libfastboot2" 2018-08-24 17:25:10 +00:00
Aaron Wisner
ab2645514d Added support to fuzzy_fastboot for more sparse tests
Test: Pixel 2
Change-Id: Ibd491336ace4f346c3900a61bca30ac3023e4f21
2018-08-24 16:22:54 +00:00
Aaron Wisner
a5ad20aecc Fix mac build breakage due to missing usb_osx.cpp in
Android.cpp file for libfastboot2

https://android-review.googlesource.com/c/platform/system/core/+/722153

Test: Build on osx
Change-Id: I6151e37581ac332e4d5cfb5e40feb3ea0e3093df
2018-08-24 10:53:04 -05:00
Treehugger Robot
c86b01baa1 Merge "trusty_keymaster_ipc: Use ALOGV instead of ALOGE for info/debug message" 2018-08-24 00:47:44 +00:00
Roberto Pereira
37996b6c67 trusty_keymaster_ipc: Use ALOGV instead of ALOGE for info/debug message
This message was originally ALOGV but got accidentally changed during a
refactoring in 81ebcb1943

Bug:110153632
Test: VtsHalKeymasterV3_0TargetTest
Change-Id: Ibdfa0ab50cb8544c6f23c15049904f1741769647
2018-08-23 15:56:09 -07:00
Treehugger Robot
5d3edb1422 Merge changes from topic "fastbootd-flashall"
* changes:
  fastbootd: Support flashall with logical partitions.
  fastboot: Use _WIN32 instead of WIN32.
2018-08-23 18:55:42 +00:00
David Anderson
32e376f848 fastbootd: Support flashall with logical partitions.
Currently, fastboot flashall will try to flash every partition in the
image list. For devices with logical partitions, this will cause those
partitions to be flashed twice (once via super.img, and again for each
individual image). Additionally, super.img is needed to synchronize the
logical partition list, but it is only generated with "make dist",
making it inconvenient for most workflows.

This patch removes automatic flashing of super.img. Instead, devices
with a super partition must now generate a "super_empty.img"
describing the super geometry and logical partition layout. Before
flashing any other partitions, this image is used to ensure the device
has created all necessary logical partitions.

Additionally, before flashing (but after updating super), all logical
partitions that will be flashed are resized to 0. This ensures that
logical partitions will receive more optimal space allocation.

Finally, during flashing of individual images, logical partitions are
resized to the image size, since they do not have hardcoded sizes in the
build.

Bug: 78793464
Test: fastboot flashall can flash vendor, product, product_services
      without a make dist/super.img.

Change-Id: I18c2291e0d0cb10de729c5646b75ac84dde8c871
2018-08-23 10:43:46 -07:00
David Anderson
c3ade7f48a fastboot: Use _WIN32 instead of WIN32.
Bug: N/A
Test: fastboot.exe builds
Change-Id: I316611f581c80ec813b953a7e6074293399ab7d7
2018-08-23 10:42:59 -07:00
Treehugger Robot
d8f419d4d1 Merge "Address style and efficiency post-merge feedback from previous change (ed409eaec2)." 2018-08-23 17:27:28 +00:00
Idries Hamadi
7f51e007a2 Address style and efficiency post-merge feedback from previous change (ed409eaec2).
Test: mm
Test: adb install -r -f --force-agent --local-agent ~/example_apks/example.apk
Test: adb install -r -f --no-streaming --force-agent --local-agent ~/example_apks/example.apk
Change-Id: I44105a78c78c6d3c77a6b3b5e14f53cd1707b704
2018-08-23 17:24:07 +01:00
Treehugger Robot
e58548e5f5 Merge "Fix typo in parseint.untouched_on_failure test" 2018-08-23 03:25:27 +00:00
Treehugger Robot
f6d707ba93 Merge "adb: fix spurious usb write failure on Windows." 2018-08-23 03:12:30 +00:00
Treehugger Robot
ddb2bfeae4 Merge "adb: don't spew push/pull progress to dumb terminals." 2018-08-23 02:20:21 +00:00
Tom Cherry
958fcbdf8a Fix typo in parseint.untouched_on_failure test
This test means to check both that ParseInt() and ParseUint() do not
change the result on failure, however it erroneously tested ParseInt()
twice.

Test: unit tests
Change-Id: If534e2525827e19aba6cae0eef45668d57623efb
2018-08-23 02:00:17 +00:00
Tom Cherry
d68121f670 Merge "init: always allow clearing a property" 2018-08-23 01:59:45 +00:00
Tom Cherry
792fb8e2c8 Merge changes Ie28ff622,I0179b42e
* changes:
  init: accept -1 or 'unlimited' for an infinite rlimit
  Fix two ParseInt edge cases
2018-08-23 01:54:51 +00:00
Treehugger Robot
e41cb2e767 Merge "fastbootd: Add an update-super command to sync the super partition." 2018-08-23 00:54:26 +00:00
Treehugger Robot
3a6b3e4429 Merge "bionic supplies PR_SET_VMA now." 2018-08-23 00:49:45 +00:00
Treehugger Robot
9dc6f90cb8 Merge "adbd: use unique_fd for the usb file descriptors." 2018-08-23 00:45:03 +00:00
Treehugger Robot
e37c5ca4dd Merge "Create fuzzy-fastboot pen tester" 2018-08-23 00:42:54 +00:00
Josh Gao
7e7ab56e8e adb: don't spew push/pull progress to dumb terminals.
Bug: http://b/113070277
Test: adb push 100mb /data/local/tmp | cat
Test: adb sync | cat
Change-Id: I252bdbdbde825bba903f43bd892262786a58c4e4
2018-08-22 17:28:33 -07:00
Josh Gao
5d799cd454 adb: fix spurious usb write failure on Windows.
We were accidentally returning 0 instead of the number of bytes written
whenever we wrote a USB packet that had a size that was a multiple of
the USB packet size, which resulted in the device getting kicked.

Bug: http://b/113070258
Test: python test_device.py
Change-Id: Ib3d6415545e90e1f4730afc8ad8713d10bb1534a
2018-08-22 17:11:40 -07:00
Treehugger Robot
6ec934bc9d Merge "Add /dev/stdin, /dev/stdout, and /dev/stderr." 2018-08-22 22:57:37 +00:00
Tom Cherry
2096558837 init: always allow clearing a property
An unintended consequence of property types is that it makes clearing
a property, by setting it to an empty string, impossible.  This change
explicitly allows that case:

Test: new (and old) unit tests
Change-Id: I188693bfd3a71b64c194c3858544230b87d8d891
2018-08-22 15:41:56 -07:00
Josh Gao
860cc5ae39 adbd: use unique_fd for the usb file descriptors.
Test: adb shell
Change-Id: I8b5e31377bbda9b02e522e3a4b75ac908197912f
2018-08-22 15:33:08 -07:00
Tom Cherry
ab434c70ce init: accept -1 or 'unlimited' for an infinite rlimit
Due to a bug with ParseUint(), init would defacto accept -1 for an
infinite rlimit, but only on 64bit devices.  That bug is now fixed,
such that -1 would be rejected by ParseUint() for all devices.

This change explicitly checks for -1 for all devices or 'unlimited' to
match ulimit's reporting and accepts either as an infinite rlimit.

Bug: 112668205
Test: new (and old) unit tests
Change-Id: Ie28ff622cdf375a65ceb5f32ffb14fb3d5d9f2ba
2018-08-22 15:07:53 -07:00
David Anderson
38b3c7a122 fastbootd: Add an update-super command to sync the super partition.
This change introduces an "update-super" command to the fastboot
protocol. Unlike the "flash" command, which copies raw or sparse data to
a partition, the "update-super" command requires the data to be a super
image generated by lpmake.

If the super partition is not yet formatted (or is corrupt), then it
will be formatted using the given image. Otherwise, "update-super" will
preserve the existing partition layout, and only ensure that logical
partition entries exist for all the new partitions in the given image.
All new partitions added this way will have a zero size, and it is the
host's responsibility to size them as needed afterwards with the
"resize-logical-partition" command.

In addition, the "update-super" command supports a "wipe" argument,
which will force the super partition to be reformatted with the given
image, overwriting any existing partition tables.

Bug: 78793464
Test: fastboot flashall with a super partition
Change-Id: If37d839a03e396e11b6c08a9c32984106613d1dc
2018-08-22 15:05:03 -07:00
Tom Cherry
8e3f0b1b2a Fix two ParseInt edge cases
1) ParseInt and ParseUint accept strings that have spaces followed by
   a valid number, however the base check for determining hex numbers
   does not take this into account currently, but now does this this
   change.
2) ParseUint rejects negative numbers except in the case that the
   template argument is unsigned long long.  That is a mistake; it
   should reject negative numbers in all cases and this change does
   that by rejecting any string with a - prefix.

Bug: 112668205
Test: new (and old) unit tests
Change-Id: I0179b42e50adc1b169cf0e6d830283b71210a029
2018-08-22 15:02:57 -07:00
Treehugger Robot
22c1eefb0d Merge "logd: crash dumps on userdebug only" 2018-08-22 21:48:25 +00:00
Elliott Hughes
5a0a51b81f Add /dev/stdin, /dev/stdout, and /dev/stderr.
Bug: http://b/31824379
Test: `adb shell ls -l /dev/std*`
Change-Id: I6af7ff205e12c10e958be263c3f1c429d48c0bbc
2018-08-22 13:21:21 -07:00
Mark Salyzyn
4b42ea523a logd: crash dumps on userdebug only
Test: none
Change-Id: I98ff8743d787b8edc013e49380b6321dfbd9b660
2018-08-22 20:09:34 +00:00
Treehugger Robot
895c13fe22 Merge changes I9ad08b0d,I7fb1ef4f,I5b24b9d9
* changes:
  liblp: Add ReadImageFromBlob.
  liblp: Refactor ParseMetadata to read from non-descriptors.
  liblp: Always copy geometry to LpMetadata.
2018-08-22 19:14:31 +00:00
Elliott Hughes
95c34a72af bionic supplies PR_SET_VMA now.
Bug: N/A
Test: builds
Change-Id: I8254711543cbf11bdf905ea441655ca1c1e82aac
2018-08-22 12:06:20 -07:00
Chris Fries
1572771495 Merge "Add support to fastboot_driver for sending sparse images with CRC check" 2018-08-22 18:39:16 +00:00
David Anderson
ee4075d84d liblp: Add ReadImageFromBlob.
This change enables reading metadata images from memory, for situations
where using file descriptors is not practical (such as fastbootd flash).

Bug: 78793464
Test: liblp_test gtest
Change-Id: I9ad08b0ddd4cbb96e87583237a90785e0f4befa4
2018-08-22 10:03:09 -07:00
David Anderson
1eb3ea37dc liblp: Refactor ParseMetadata to read from non-descriptors.
This is in preparation for "fastboot flash super", where we want to
verify the validity of a super image before writing it. To do so, we
need to parse the image from the download buffer, and it is useful to do
this from memory rather than a file descriptor.

Bug: 78793464
Test: liblp_test gtest
Change-Id: I7fb1ef4fdf2e8f1d93aea38f75626157fcb4bfc1
2018-08-22 10:03:09 -07:00
David Anderson
f1222908f4 liblp: Always copy geometry to LpMetadata.
Callers of ParseMetadata must manually copy geometry to the final
LpMetadata structure, which is error-prone. Instead, force callers to
pass geometry to ParseMetadata to ensure it is always propagated.

Bug: N/A
Test: liblp_test gtest

Change-Id: I5b24b9d94ab1857db600c40bf6d3c9d8aaa47368
2018-08-22 10:03:09 -07:00
Treehugger Robot
d1d06109ed Merge "liblp: FlashPartitionTable should update all slots." 2018-08-22 16:45:33 +00:00
Aaron Wisner
00737b3939 Create fuzzy-fastboot pen tester
Test: Run on Sailfish, Walleye, and other devices
Bug: http://b/111126621
Change-Id: I309af79411d0a16d11874a048ce0db024770d7b2
2018-08-22 11:30:29 -05:00
Aaron Wisner
9812b58fc4 Add support to fastboot_driver for sending sparse images with CRC check
The default argument will prevent anything from breaking

Test: Build on glinux
Change-Id: Ib427ab210476db1ec1c69c0a3238d0653e98b79a
2018-08-22 11:02:47 -05:00
Treehugger Robot
56d079b40a Merge "libdm: remove libbase dependency in header." 2018-08-22 15:30:43 +00:00
Treehugger Robot
6d2ace3684 Merge "adb: fix test_adb.py's adb server spawning on Windows." 2018-08-22 00:09:56 +00:00