Commit Graph

42368 Commits

Author SHA1 Message Date
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
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
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 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
Anton Hansson 6a581b7b66 Merge "Remove init_second_stage.recovery dep." 2018-08-16 06:48:50 +00:00
Tri Vo 1738693f00 Merge "Remove libsuspend from VNDK." 2018-08-15 21:05:31 +00:00
Tao Bao 308129d274 Merge "adb: Drop the unneeded dependency on libfec_rs.so." 2018-08-15 18:14:16 +00:00
Tao Bao d262346b57 Merge "fs_mgr: Drop some unneeded dependencies." 2018-08-15 18:14:16 +00:00
Treehugger Robot 1e6a318b7a Merge "fastbootd: Complete the implementation of getvar has-slot." 2018-08-15 15:09:15 +00:00
Anton Hansson 904bbd8405 Remove init_second_stage.recovery dep.
This makes the init module only produce artifacts in
/system. A simultaneous change in the core product
makefiles explicitly adds init_second_stage.recovery.

Bug: 112318375
Test: lunch mainline_arm64 && m nothing
Change-Id: I33f0f0c869dfb1ffe781fc682eeb20589a4ffe90
2018-08-15 08:50:43 +01:00
David Anderson 79ab0e3e98 fastbootd: Complete the implementation of getvar has-slot.
Bug: 78793464
Test: fastboot getvar has-slot:super returns "no"
Change-Id: I80f171df062c008718b810bbe12070834d4aa3fb
2018-08-14 16:24:07 -07:00
Treehugger Robot c48943165d Merge "lmkd: Do not downgrade/ignore events when swap is full" 2018-08-14 21:31:56 +00:00
Tom Cherry cecf5480fe Merge "Include some warnings about vendor_available for fsmgr." 2018-08-14 21:26:26 +00:00
Treehugger Robot 3231be66ce Merge "Add sideload, fastboot as reboot targets in init" 2018-08-14 21:25:50 +00:00
Tri Vo f8398ee24c Remove libsuspend from VNDK.
Only platform should ever have access to libsuspend

Test: presubmit
Change-Id: I5d58aeb98d5e777d81d4d65f7a62fe2fb50a72d4
2018-08-14 13:39:55 -07:00
Roberto Pereira a5d5c9debc Merge changes I31b6a66a,I682e5c98
* changes:
  Switch from old style KM2 HAL to new KM3 HAL
  Add Keymaster 3.0 binderized Trusty HAL
2018-08-14 20:27:40 +00:00
Tom Cherry 066fcdf820 Include some warnings about vendor_available for fsmgr.
The interface to fsmgr is subpar and while we haven't had time to
revisit it, we absolutely do not want to expose this to vendors in a
way that would force us to keep this interface in the future.

Test: n/a
Change-Id: I970048aa2e45d7f7eca357d052141e90d6e01123
2018-08-14 13:11:14 -07:00
Treehugger Robot 90668749e9 Merge "adb: make disconnect stop reconnection immediately." 2018-08-14 19:51:50 +00:00