Commit graph

42382 commits

Author SHA1 Message Date
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
Treehugger Robot
6ec934bc9d Merge "Add /dev/stdin, /dev/stdout, and /dev/stderr." 2018-08-22 22:57:37 +00: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
David Anderson
c720aa1893 liblp: FlashPartitionTable should update all slots.
Logical partition metadata has "slots" for AB purposes, but when
flashing or updating the partition table via fastboot, there is no
reason not to synchronize all copies of the metadata. It makes the state
of the super partition much more clear. It also makes the super
partition less likely to break on a slot change from the user, for
example if a "_b" partition is created before changing to the "b" slot.

Bug: 78793464
Test: liblp_test gtest
Change-Id: I3c44f0362f21f87d0bfc3a5c3394e26dc3dd38be
2018-08-21 16:18:32 -07:00
Tao Bao
7cbebb2ba0 Merge "Install ld.config.recovery.txt to $(TARGET_RECOVERY_ROOT_OUT)/system/etc." 2018-08-21 22:35:49 +00:00
Treehugger Robot
7151d20362 Merge "debuggerd: delete accidentally merged log spam." 2018-08-21 22:12:33 +00:00
Treehugger Robot
627a74b714 Merge "adb: add better logging for connection failure." 2018-08-21 21:41:02 +00:00
Josh Gao
92cd59fc31 adb: fix test_adb.py's adb server spawning on Windows.
Test: test_adb.py on windows vm
Change-Id: I918678be7ececd167969789ecff7cfb58829fa1d
2018-08-21 14:28:56 -07:00
Josh Gao
3e27bd5a8f debuggerd: delete accidentally merged log spam.
Test: none
Change-Id: I4237b4f0c8d5cdc559766fc3c73742b013c1df86
2018-08-21 13:54:31 -07:00
Josh Gao
ec54ef7a8d Merge "Fix MacOS SDK build error caused by deprecated stl call." 2018-08-21 20:06:55 +00:00
Idries Hamadi
1d197931b7 Fix MacOS SDK build error caused by deprecated stl call.
Test: lunch sdk-eng && cd system/core/adb && mm
Test: adb install -r -f --force-agent --local-agent ~/example_apks/example.apk
Change-Id: Idf59cc30b7bc2150fc0d68289c3230c6a1057908
2018-08-21 19:25:01 +01:00
Treehugger Robot
ca10a6ffd3 Merge changes Ic3c5095c,I87bc3e37,Ifd21e25b
* changes:
  storaged: Cap io_history when loading stats from disk.
  storaged: Don't duplicate uid_records from proto files.
  storaged: Fix-up private variable names in uid_monitor.
2018-08-21 17:01:20 +00:00
David Anderson
dec6a881ba storaged: Cap io_history when loading stats from disk.
Similar to add_record_locked, load_uid_io_proto should respect the
maximum number of records.

Bug: 111578975
Test: storaged_test.load_uid_io_proto
Change-Id: Ic3c5095cdd09d2184f436813b5ab50d3ee0007b2
Merged-In: Ic3c5095cdd09d2184f436813b5ab50d3ee0007b2
2018-08-21 09:20:40 -07:00
David Anderson
0026a14ff2 storaged: Don't duplicate uid_records from proto files.
It is possible for storaged to load the same saved proto file multiple
times, for example, if system_server crashes. In this case we do not
want to fill io_history with duplicate entries. This patch elides
records for which an app+userid record already exists for the same
timestamp.

Bug: 111578975
Test: gtest storaged_test.load_uid_io_proto
Change-Id: I87bc3e37d6464079cece03b5852285d79067b935
Merged-In: I87bc3e37d6464079cece03b5852285d79067b935
2018-08-21 09:20:33 -07:00
David Anderson
3488d9f9dd storaged: Fix-up private variable names in uid_monitor.
Bug: N/A
Test: storaged builds
Change-Id: Ifd21e25baa7b1c6ce41c5e0ec5247f47ba716e6e
Merged-In: Ifd21e25baa7b1c6ce41c5e0ec5247f47ba716e6e
2018-08-21 09:20:29 -07:00
Treehugger Robot
15eb065bbb Merge "Integrate adb with fastdeploy" 2018-08-21 06:28:49 +00:00
Yifan Hong
de39afd1e0 Merge "s/product-services/product_services/g" 2018-08-21 01:07:56 +00:00
Dario Freni
ab5583b585 s/product-services/product_services/g
Attempting to reduce the number of different spellings we have for
"product services" partition in the codebase.

Bug: 112431447
Test: m
Change-Id: I1a87d7e040a8b1f91f973ac7d90d6360b5b54f71
Merged-In: I1a87d7e040a8b1f91f973ac7d90d6360b5b54f71
2018-08-20 17:46:42 +00:00
Tao Bao
e82b83201b Install ld.config.recovery.txt to $(TARGET_RECOVERY_ROOT_OUT)/system/etc.
Bug: 112780007
Test: Build with other changes in the topic (aosp_taimen-userdebug).
Test: Boot into recovery. Verify basic functionalities (`adb shell` and
      `adb sideload`, factory reset).
Change-Id: I8686bbc68c9c8a1570289ecd21bcfcb551d1700c
2018-08-18 10:22:03 -07:00
Hans Boehm
59cd823752 Merge "Check sp<>::clear() for data races" 2018-08-17 22:20:39 +00:00
Elliott Hughes
572d33347b Merge "libutils: remove unused strzcmp16_h_n." 2018-08-17 19:05:17 +00:00
Hans Boehm
f4f76205fe Check sp<>::clear() for data races
sp<>::clear() presents the same risks of heap corruption in the presence
of data races as does assignment. Add the same data race check.

Bug: 112651574
Test: Build and boot AOSP
Change-Id: I75d4eedd756d521920e61ff9187509f9145d4235
2018-08-17 11:40:39 -07:00
Elliott Hughes
7b6751d2f8 libutils: remove unused strzcmp16_h_n.
Bug: N/A
Test: builds
Change-Id: I864bfb3597da76cd0a4fecce67e39d5d81538764
2018-08-17 09:59:29 -07:00
Treehugger Robot
cdad28c4d5 Merge "Add NDK folks to OWNERS for library configuration." 2018-08-17 16:50:35 +00:00
Tao Bao
157a2e7341 Merge "charger: screen blank on disconnect and 0% not displayed" 2018-08-17 16:35:30 +00:00
kentsou
ba61ea462f charger: screen blank on disconnect and 0% not displayed
Bug: 74771887
Test: m -j succeeded and confirm offmode charge UI behavior
Change-Id: I8c97230f6c1e32ac9949601a86added79a3ead82
Signed-off-by: kentsou <kentsou@google.com>
2018-08-17 03:58:19 +00:00
Dario Freni
c0f60b7e4d Merge "s/PRODUCTSERVICES/PRODUCT_SERVICES/g" 2018-08-17 00:43:47 +00:00
Dario Freni
ad58bf9b1d s/PRODUCTSERVICES/PRODUCT_SERVICES/g
Attempting to reduce the number of different spellings we have for
"product-services" in the codebase.

Bug: 112431447
Test: m
Change-Id: I8714cc9c1ca63eb54745054aaeebd6b51f203f11
2018-08-17 00:20:11 +01:00
Yifan Hong
d449e2e59f libdm: remove libbase dependency in header.
libbase logging macros conflicts with libchrome's logging macros.
Test: compiles

Change-Id: I02697baa87c1466caf2e4ef58b0c8b2635982527
2018-08-16 11:12:36 -07:00