Commit Graph

8154 Commits

Author SHA1 Message Date
Tao Bao
7d47aebd79 Update OWNERS.
Test: N/A
Change-Id: I290fe43ee14fa3751f9ddb2c009bff235d8e1cff
2019-10-08 20:32:42 -07:00
Tianjie Xu
8316f2f09a Merge "Run BORINGSSL_self_test() in updater_main" 2019-10-07 22:51:44 +00:00
Tao Bao
e0e34a7f5c Merge "minadbd: Return battery level via getprop." 2019-10-07 15:17:40 +00:00
Tianjie Xu
97692467a1 Run BORINGSSL_self_test() in updater_main
We need to run the these tests when starting updater to verify the
statically linked libcrypto. The test function is based on the known
answer tests, and it doesn't compute the hash of the libcrypto library.

Bug: 141003171
Test: unit tests pass, run a updater on cuttlefish
Change-Id: I897918a54bca76ea0c928102e7287df27505e1cc
2019-10-05 17:06:48 -07:00
Bill Peckham
3903b26368 Merge "Moving recovery resources from /system to /vendor" 2019-10-05 03:14:12 +00:00
Tao Bao
b548bea778 minadbd: Return battery level via getprop.
`adb rescue getprop rescue.battery_level` returns the current battery
level.

Bug: 134560109
Test: Build and boot into rescue mode.
Test: `adb rescue getprop ro.build.fingerprint`
Test: `adb rescue getprop rescue.battery_level`
Test: `adb rescue getprop` to dump all the properties.
Test: Run recovery_unit_test.
Change-Id: I78a9e8ab9783ffc8532cb93e6a64fb2157c19bd5
2019-10-04 15:33:27 -07:00
Bill Peckham
341644d657 Moving recovery resources from /system to /vendor
This change is part of a topic that moves the recovery resources from the
system partition to the vendor partition, if it exists, or the vendor directory
on the system partition otherwise. The recovery resources are moving from the
system image to the vendor partition so that a single system image may be used
with either an A/B or a non-A/B vendor image. The topic removes a delta in the
system image that prevented such reuse in the past.

The recovery resources that are moving are involved with updating the recovery
partition after an update. In a non-A/B configuration, the system boots from
the recovery partition, updates the other partitions (system, vendor, etc.)
Then, the next time the system boots normally, a script updates the recovery
partition (if necessary). This script, the executables it invokes, and the data
files that it uses were previously on the system partition. The resources that
are moving include the following.

* install-recovery.sh
* applypatch
* recovery-resource.dat (if present)
* recovery-from-boot.p (if present)

This makes the applypatch executable a vendor module.

This change supports making dependencies of the applypatch executable available
to applypatch, which is now on vendor.

Since install-recovery.sh is now a vendor service, we add the
applypatch/vendor_flash_recovery.rc file to /vendor/etc/init to start the
service.

Bug: 68319577
Test: Ensure that recovery partition is updated correctly.
Change-Id: I01c0800ee6078aa6c9d716d5f154ad2d63c7af84
2019-10-04 00:04:56 +00:00
Treehugger Robot
4782e79324 Merge "recovery_utils: Use libvoid_headers." 2019-10-04 00:01:53 +00:00
Tao Bao
640175e9d1 recovery_utils: Use libvoid_headers.
Test: mmm bootable/recovery
Change-Id: I2ad7620d0f967cb018a415358379c34804e232c5
2019-10-03 08:48:49 -07:00
Tao Bao
678d6395b3 Merge "Refactor battery info querying functions into librecovery_utils." 2019-10-03 15:40:23 +00:00
Tao Bao
832c9cd24f Refactor battery info querying functions into librecovery_utils.
Bug: 134560109
Test: Run recovery_unit_test.
Change-Id: Ibbcdcfd507fa23657ee7ff677208b0003ec382ba
2019-10-02 22:04:25 -07:00
Tao Bao
c6fb9f9df5 Merge "otautil: Factor out the utils that're private to recovery." 2019-10-02 21:00:08 +00:00
Tao Bao
e3f09a72f5 otautil: Factor out the utils that're private to recovery.
A number of utility functions are intended for serving recovery's own
use. Exposing them via libotautil (which is a static lib) would pass the
dependencies onto libotautil's users (e.g. recovery image, updater, host
simulator, device-specific recovery UI/updater extensions etc). This CL
finds a new home for the utils that are private to recovery.

Test: mmma bootable/recovery
Change-Id: I575e97ad099b85fe1c1c8c7c9458a5a43d4e11e1
2019-10-02 10:56:46 -07:00
Treehugger Robot
36f72131ff Merge "otautil: Drop a few unneeded includes." 2019-10-02 02:00:52 +00:00
Tao Bao
f6ed376b20 otautil: Drop a few unneeded includes.
Test: mmma bootable/recovery
Change-Id: I6ed8f9eca7183f84537c770baaffddd22b6e9f28
2019-10-01 16:00:17 -07:00
Tao Bao
c3f32b95e5 Merge changes I6c35d2e4,If16c3e19
* changes:
  Move mounts.cpp from libotautil into libupdater.
  otautil: roots.cpp no longer needs 'mounts.h'.
2019-10-01 21:18:42 +00:00
Tao Bao
d628cfc153 Move mounts.cpp from libotautil into libupdater.
All the active users of mounts.h now live in updater/.

Test: mmma bootable/recovery
Test: Run recovery_unit_test on taimen.
Test: Code search shows no reference to otautil/mounts.h in device dirs.
Change-Id: I6c35d2e403e92a0111102d00aa4773f4f524650e
2019-10-01 12:13:04 -07:00
Tao Bao
331e5c4c98 otautil: roots.cpp no longer needs 'mounts.h'.
Commit 0f339e27bb moved part of the mounts
implementation into libfs_mgr. As a result, otautil/roots.cpp no longer
depends on anything in the local otautil/mounts.h.

Test: mmma bootable/recovery
Change-Id: If16c3e19a62933358fb0002a10e8556a99f9d29a
2019-10-01 12:02:56 -07:00
Steven Moreland
e2ca8ba293 Merge "Remove libhidltransport deps" 2019-09-30 15:56:03 +00:00
Tao Bao
ec734e5851 Merge "minadbd: Update README.md." 2019-09-27 23:47:06 +00:00
Tao Bao
0cc2c5b453 minadbd: Update README.md.
Test: N/A
Change-Id: I7f4648f2b357de7d9700e38552a0156d13c1bd0b
2019-09-27 13:17:16 -07:00
Tao Bao
ffa9ffbd2b Merge "minadbd: Export minadbd/types.h to libinstall." 2019-09-26 22:46:14 +00:00
Colin Cross
4c4c7dc26b Merge "Use libcrypto_static instead of libcrypto" 2019-09-26 14:32:33 +00:00
Tao Bao
3305d48b0b minadbd: Export minadbd/types.h to libinstall.
Test: mmma bootable/recovery
Change-Id: I503e942b23cc51024aa752c1eb3db5455a44a9d1
2019-09-26 00:04:11 -07:00
Steven Moreland
ff9b62b781 Remove libhidltransport deps
Since this was combined into libhidlbase.

Bug: 135686713
Test: build only (libhidltransport is empty)
Change-Id: I253e50726967044714275ab995fb8a8a57bcde36
2019-09-25 15:12:30 -07:00
Tao Bao
86b54dc493 Merge "applypatch: Add backup_source parameter to PatchPartition." 2019-09-23 23:07:40 +00:00
Colin Cross
0e643e4d7f Use libcrypto_static instead of libcrypto
Replace libcrypto with libcrypto_static, which can be protected through
visibility to ensure only modules that don't affect FIPS certification
can use it.

Bug: 141248879
Test: m checkbuild
Change-Id: I0affaa292237bdbc772d3adc36086905ed6fbe9d
2019-09-23 13:54:09 -07:00
Treehugger Robot
4f86af7b9a Merge "applypatch: Use static libs for libbrotli and libbz." 2019-09-23 19:33:30 +00:00
Tao Bao
5234ad466c applypatch: Add backup_source parameter to PatchPartition.
And set it to false when installing recovery image via applypatch. We
only need to back up the source partition when doing in-place update
(e.g. when updating a given partition under recovery). When installing
recovery image via applypatch, we won't touch the source partition (i.e.
/boot).

Removing the backup step also allows dropping the dac_override_allowed
permission. Previously it was needed due to the access to /cache.
Because applypatch runs as root:root, while /cache is owned by
system:cache with 0770.

Bug: 68319577
Test: Invoke the code that installs recovery image; check that recovery
      is installed successfully without denials.
Test: recovery_unit_test passes on taimen.
Change-Id: I549a770b511762189d6672a2835b6e403d695919
2019-09-23 11:26:48 -07:00
Tao Bao
71c35b9fba applypatch: Use static libs for libbrotli and libbz.
Prior to this CL, applypatch was the only user of libbrotli.so and
libbz.so (update_engine and puffin have been using the static versions).
This CL switches applypatch to their static versions to save space in
/system.

Sizes prior to the change (aosp_taimen-userdebug):
  /system/bin/applypatch      91296
  /system/lib64/libbrotli.so 688536
  /system/lib64/libbz.so      79560

After:
  /system/bin/applypatch     272368

Test: `m dist`
Test: Check the built blueline-userdebug target. libbrotli.so and
      libbz.so are not installed.
Change-Id: I08422a0d5a287bbac69aa9f6cfd9c97e5b2e9078
2019-09-23 09:17:52 -07:00
Treehugger Robot
785d0b4efa Merge "recovery: Don't report unrecognized option in recovery_main." 2019-09-19 20:07:04 +00:00
Tao Bao
15a381e52c Merge "tests: recovery_unit_test requires root." 2019-09-19 17:43:54 +00:00
Tao Bao
dfb053e815 tests: recovery_unit_test requires root.
Bug: 141272654
Test: TreeHugger (recovery_unit_test no longer fails)
Change-Id: I47cbee274e659e3d90be5a77b215466d2973c7d6
2019-09-19 08:08:54 -07:00
Tao Bao
ff185865fd recovery: Don't report unrecognized option in recovery_main.
recovery_main is only interested in a subset of options. Suppress the
warning for unrecognized options (which are likely intended for
recovery).

Fixes: 141239600
Test: On Pixel 3a, write `--security` flag into /misc and reboot
      recovery. Check that recovery_main no longer reports
      "unrecognized option" warning.
      # echo "recovery\n--security\n" | \
          dd of=/dev/block/by-name/misc conv=notrunc bs=1 seek=64
      # killall -9 recovery
      # cat /tmp/recovery.log
Test: Write `--show_text=foo` instead, and check that recovery reports
      "option `--show_text' doesn't allow an argument".
Change-Id: I1cb3a5ed6db91e41453b8aad00c8608f78ac1fa6
2019-09-18 16:12:59 -07:00
Tao Bao
2d6e8f2ea8 Merge "Update the instruction for building recovery image on Pixels." 2019-09-13 17:08:37 +00:00
Tobias Thierer
54100d3348 Merge "Link libcrypto dynamically for recovery unit tests." 2019-09-13 16:56:06 +00:00
Tobias Thierer
0af65d8c4a Merge "Set LOCAL_INJECT_BSSL_HASH for updater" 2019-09-13 16:56:06 +00:00
Pete Bentley
189d424ced Link libcrypto dynamically for recovery unit tests.
Tested by running recovery_unit_test as described in
https://android.googlesource.com/platform/bootable/recovery/+/refs/heads/master/README.md

Attempted to build and boot a recovery image with the
same change to confirm it still works, but
m recoveryimage-nodeps
fails for me.

Bug: 140940227
Test: See above
Change-Id: I00545968a0e5684823e505f2ddbe7e993319b5d4
2019-09-13 12:18:44 +01:00
Tao Bao
95656827dd Update the instruction for building recovery image on Pixels.
Test: N/A
Change-Id: I14d7bba5b214cc0bf43d6294cff1b7dcbea72ee8
2019-09-12 13:10:44 -07:00
David Anderson
4878f6a31c Merge "Improve error messaging when bootcontrol HAL fails to load." 2019-09-10 00:09:07 +00:00
Steven Moreland
a44f947b6d Merge "Remove reference to libhwbinder_noltopgo." 2019-09-06 17:59:21 +00:00
Colin Cross
d81519400c Set LOCAL_INJECT_BSSL_HASH for updater
updater is built in Make and statically links libcrypto,
so it needs to set LOCAL_INJECT_BSSL_HASH to make the FIPS self
test pass.

Bug: 137267623
Test: m checkbuild
Change-Id: Ib253c870090ac8026f5cbb005d6b0e935c73edd1
2019-09-05 15:34:50 -07:00
Steven Moreland
e4f1a781f5 Remove reference to libhwbinder_noltopgo.
No longer needed.

Bug: 135558503
Test: build only
Change-Id: Ia1257513c6276cdb01604fbedb411e7412d02b84
2019-09-05 14:29:23 -07:00
David Anderson
9c0f102828 Merge "boot_control: Don't allow current_slot_ to be -1." 2019-09-05 20:21:47 +00:00
Xin Li
e0364db712 Merge "DO NOT MERGE - Merge Android 10 into master" 2019-09-05 16:53:28 +00:00
David Anderson
b18f153b12 Improve error messaging when bootcontrol HAL fails to load.
Bug: N/A
Test: manual test
Change-Id: I6bf849dba4ae66353c44875ece30917283557327
2019-09-04 18:12:35 -07:00
David Anderson
643ddd99df boot_control: Don't allow current_slot_ to be -1.
If the HAL is run on a non-A/B device, it does not fail gracefully; it
will segfault because the current_slot is -1 and methods do not protect
against this. Instead, have Init() fail if we can't determine the
current slot.

Bug: 130078382
Test: vts tests
Change-Id: I2d3094518a842b1a764427d2da9d46781a9f26da
2019-09-04 18:12:23 -07:00
Xin Li
007ac2d5fb DO NOT MERGE - Merge Android 10 into master
Bug: 139893257
Change-Id: Id844b347e95335800502d9b5aeb15e18aabd29e1
2019-09-04 13:32:49 -07:00
David Anderson
388d2a591c Merge "Make libboot_control vendor available."
am: e3a35dc808

Change-Id: Ia5661bdf289cbff91faf629f6b746920b0299a8e
2019-09-03 13:00:16 -07:00
David Anderson
754e7fc190 Merge "Refactor boot_control into a separate library."
am: eb35817830

Change-Id: I330e599f7a8bf2aed111186ec54886b4c21b071a
2019-09-03 12:59:35 -07:00