Commit graph

4797 commits

Author SHA1 Message Date
Treehugger Robot
6b09b895be Merge "Remove the obsolete reference to /file_contexts." 2017-07-23 03:56:42 +00:00
Tao Bao
338be53ed3 Remove the obsolete reference to /file_contexts.
This file no longer exists:
- /file_contexts has been split into plat_file_contexts and
  nonplat_file_contexts since commit
  b236eb6ca204cefcb926e19bd5682f9dcad4021d (system/sepolicy).
- It was named /file_contexts.bin prior to the split.

'-S file_contexts' is also no longer required by e2fsdroid, since commit
2fff6fb036cbbb6dedd7da3d208b312a9038a5ce (external/e2fsprogs). It will
load the file contexts via libselinux.

Test: Trigger the path by performing a data wipe for converting to FBE.
Change-Id: I179939da409e5c0415ae0ea0bf5ddb23f9e6331e
(cherry picked from commit 7af933b6a6)
2017-07-22 16:16:21 -07:00
Tao Bao
5a1dee01df update_verifier: Handle legacy care_map.txt gracefully.
update_verifier should be backward compatible to not reject legacy
care_map.txt from old releases, which could otherwise fail to boot into
the new release.

For example, we've changed the care_map format between N and O. An O
update_verifier would fail to work with an N care_map.txt - a) we have
switched update_verifier to read from device mapper in O; b) the last
few blocks that contain metadata can't be read via device mapper. This
could be a result of sideloading an O OTA while the device having a
pending N update.

Bug: 63544345
Test: As follows on sailfish:
 1. Flash the device with this CL;
 2. Put a copy of N care_map.txt at /data/ota_package/. Restore the
    permissions properly ('cache' group);
 3. `adb reboot bootloader`;
 4. `fastboot set_active <current_slot>`
 5. Device boots up into home screen, with a warning in logcat that says
    it has skipped legacy care_map.txt.
Change-Id: I6acc88c9e655a9245e6531f176fef7953953935f
2017-07-21 17:17:03 -07:00
Tao Bao
4fb2825dc2 Merge "Avoid crashing recovery with unwritable /cache."
am: 9187f1cc51

Change-Id: Ie5708c2f703aefbfcad85ad0d2d24ae36b725c78
2017-07-21 23:22:31 +00:00
Treehugger Robot
9187f1cc51 Merge "Avoid crashing recovery with unwritable /cache." 2017-07-21 23:14:08 +00:00
Tianjie Xu
80acaab52f Merge "Fix a case when brotli writer fails to write last few blocks of data"
am: e45c8f0057

Change-Id: I337e8ec26f59a5245ab299080d7251331823e2da
2017-07-21 21:04:17 +00:00
Tianjie Xu
e45c8f0057 Merge "Fix a case when brotli writer fails to write last few blocks of data" 2017-07-21 20:59:24 +00:00
Tao Bao
ec57903a7e Avoid crashing recovery with unwritable /cache.
When /cache is unwritable, recovery hits a crash loop. Because it
passes nullptr to fileno(3) when writing back the locale file. This
prevents user from recovering a device - it cannot boot far enough to
recovery menu which allows wiping /cache.

Bug: 63927337
Test: Corrupt /cache and boot into recovery on bullhead:
 1. m -j recoveryimage
 2. fastboot erase cache
 3. fastboot boot $OUT/recovery.img
 4. recovery menu shows up.
Change-Id: I1407743f802049eb48add56a36298b665cb86139
2017-07-21 13:40:56 -07:00
Jin Qian
9203641742 Merge "recovery: replace make_ext4 with e2fsprogs"
am: f7c00ddaf6

Change-Id: I17167b59242c709b18d09fccb52058b0bc25bf09
2017-07-21 19:06:06 +00:00
Treehugger Robot
f7c00ddaf6 Merge "recovery: replace make_ext4 with e2fsprogs" 2017-07-21 19:00:46 +00:00
Tianjie Xu
6ed175d541 Fix a case when brotli writer fails to write last few blocks of data
receive_new_data may exit too early if the zip processor has sent all
the raw data. As a result, the last few 'new' commands will fail even
though the brotli decoder has more output in its buffer.

Restruct the code so that 'NewThreadInfo' owns the decoder state solely;
and receive_brotli_new_data is responsible for the decompression.

Also reduce the test data size to 100 blocks to avoid the test timeout.

Bug: 63802629
Test: recovery_component_test. on bullhead, apply full updates with and
w/o brotli compressed entries, apply an incremental update.

Change-Id: I9442f2536b74e48dbf7eeb062a8539c82c6dab47
2017-07-21 11:44:00 -07:00
Jin Qian
ded2dac082 recovery: replace make_ext4 with e2fsprogs
Execute mke2fs to create empty ext4 filesystem.
Execute e2fsdroid to add files to filesystem.

Test: enter recovery mode and wipe data
Bug: 35219933
Change-Id: I10a9f4c1f4754ad864b2df45b1f879180ab33876
(cherry picked from commit ac31808cd3)
2017-07-20 11:42:17 -07:00
Tianjie Xu
6d8827e0d3 Merge "Fix the android-cloexec-* warnings in bootable/recovery"
am: 94a8ea1797

Change-Id: I57ae57bab58f603540654bb24df9facca9a7d625
2017-07-19 23:06:50 +00:00
Tianjie Xu
94a8ea1797 Merge "Fix the android-cloexec-* warnings in bootable/recovery" 2017-07-19 23:00:19 +00:00
Tianjie Xu
de6735e80c Fix the android-cloexec-* warnings in bootable/recovery
Add the O_CLOEXEC or 'e' accordingly.

Bug: 63510015
Test: recovery tests pass
Change-Id: I7094bcc6af22c9687eb535116b2ca6a59178b303
2017-07-19 12:17:41 -07:00
Jerry Zhang
d428e79139 Add libasyncio.
libadbd_usb depends on libasyncio.

Bug: 37916658
Test: Use adb in recovery on bullhead/marlin
Change-Id: I77ac3bb2a580d29551e7b5c471bc3cfbf1a3219d
2017-07-18 11:42:59 -07:00
Tao Bao
c61bbe158e Merge "Fix the missing char when showing recovery logs."
am: 8155a8ba74

Change-Id: I237241a661838e914e3c3e5c7bd2ba113e6a0501
2017-07-13 20:42:18 +00:00
Treehugger Robot
8155a8ba74 Merge "Fix the missing char when showing recovery logs." 2017-07-13 20:34:55 +00:00
Tao Bao
ca6ce2c848 Fix the missing char when showing recovery logs.
This is a regression when adding support for margin space in commit
171b4c4c.

We're losing one char when showing long log lines. Because text_ is
aware of kMarginWidth, but not the the added indent (TEXT_INDENT).

Test: 'View recovery logs' on angler, with no missing character.
Change-Id: I284d54681d603e85e69d8e9c25173b1437a704df
2017-07-13 11:44:11 -07:00
Tianjie Xu
43bdf6cad6 Merge "Add support to decompress brotli compressed new data"
am: 918e6ea1b2

Change-Id: I4fd9cea71716ad1574ecb4bb7f612bc8734711c5
2017-07-10 22:33:37 +00:00
Tianjie Xu
918e6ea1b2 Merge "Add support to decompress brotli compressed new data" 2017-07-10 22:19:24 +00:00
Tianjie Xu
107a34f9fc Add support to decompress brotli compressed new data
Add a new writer that can decode the brotli-compressed system/vendor
new data stored in the OTA zip.

Brotli generally gives better compression rate at the cost of slightly
increased time consumption. The patch.dat is already compressed
by BZ; so there's no point to further compress it.

For the given 1.9G bullhead system image:
Size: 875M -> 787M; ~10% reduction of package size.
Time: 147s -> 153s; ~4% increase of the block_image_update execution time.
(I guess I/O takes much longer time than decompression.)

Also it takes 4 minutes to compress the system image on my local
machine, 3 more minutes than zip.

Test: recovery tests pass && apply a full OTA with brotli compressed
system/vendor.new.dat on bullhead

Change-Id: I232335ebf662a9c55579ca073ad45265700a621e
2017-07-07 16:08:18 -07:00
Tianjie Xu
8542502f1f Merge "Fix a rare failure for imgdiff when random data equals gzip header"
am: b87a166a16

Change-Id: Ic3c7d102cc7a2b992c699add012076a4bda549c6
2017-07-07 17:52:26 +00:00
Tianjie Xu
b87a166a16 Merge "Fix a rare failure for imgdiff when random data equals gzip header" 2017-07-07 17:42:12 +00:00
Tianjie Xu
14ebc1e5ae Fix a rare failure for imgdiff when random data equals gzip header
In a rare case, a random chunk will pass both the gzip header check
and the inflation process; but fail the uncompressed length check in the
footer. This leads to a imgdiff failure. So, we should treat this chunk
as 'normal' instead of 'inflated' while generating the patch.

Bug: 63334984
Test: imgdiff generates patch successfully on previous failing images.
Change-Id: Ice84f22d3653bce9756bda91e70528c0d2f264a0
2017-07-06 16:49:11 -07:00
Tao Bao
c24d97fafa Merge "Update ScreenRecoveryUI::Draw* function signatures."
am: c8e338fa9c

Change-Id: I8754a10003053459407cbc633a527943a622385a
2017-07-02 02:47:16 +00:00
Treehugger Robot
c8e338fa9c Merge "Update ScreenRecoveryUI::Draw* function signatures." 2017-07-02 02:42:46 +00:00
Tao Bao
ea78d86b44 Update ScreenRecoveryUI::Draw* function signatures.
Move away from taking int* for the Y-offset. Change it to int and return
the offset instead.

Test: Check the recovery menu and 'Wipe data' menu.
Change-Id: Ib15e070a0d576a0f8f66f35605cb8479e7071f26
2017-07-01 17:41:24 -07:00
Tao Bao
1783254c3f Merge "screen_ui: Compute the top and bottom gaps."
am: 344778c4ef

Change-Id: If58672e390c4794bc93946e6a090da88a7acc90a
2017-06-30 04:06:26 +00:00
Tao Bao
344778c4ef Merge "screen_ui: Compute the top and bottom gaps." 2017-06-30 03:59:25 +00:00
Tao Bao
3250f72360 screen_ui: Compute the top and bottom gaps.
We're not actually following the gaps as in the comments. For example,
Nexus 6P is supposed to use 220dp and 194dp gaps (top and bottom
respectively), but the actual numbers are 185dp and 194dp. Because the
animation icon and text sizes don't match the ones claimed (animation:
expected 200dp or 700px, actual 800px; text: claimed 14sp, actual 76px).
The top gap changes (shrinks) as we compute the baselines bottom-up.

This CL switches to using computed gaps: the major UI elements always
stay vertically centered, with identical top and bottom gaps.

Bug: 63093285
Test: 'Run graphics test' on angler/volantis/fugu/ryu.
Change-Id: I3cadbb34f728cf034afa47ac02a6deba8cb6b4e7
2017-06-29 14:59:08 -07:00
Tao Bao
c9e411858f Merge "wear_ui: Remove dead/duplicate codes."
am: f722fcf0d4

Change-Id: I621c528b73da0fade1473235ce2710cbd8d9bc95
2017-06-29 04:03:25 +00:00
Tao Bao
f722fcf0d4 Merge "wear_ui: Remove dead/duplicate codes." 2017-06-29 03:55:53 +00:00
Tao Bao
0bc54dd83f wear_ui: Remove dead/duplicate codes.
WearRecoveryUI::draw_progress_locked() has declaration only, where
the definition was deleted in commit
5e7cfb9af6.

WearRecoveryUI::ClearText() is a duplicates of
ScreenRecoveryUI::ClearText().

Test: Build swordfish recovery image. 'Run graphics test' and 'View
      recovery logs'.
Change-Id: Ib66955d1d496f04359b4d6487160218e8f954478
2017-06-28 15:32:23 -07:00
Elliott Hughes
78ff0832cb Merge "Add missing libziparchive dependency."
am: f9fe6a705d

Change-Id: Iface325955657b6c8f72d19fbbe7b8e475a15fbb
2017-06-28 16:41:12 +00:00
Treehugger Robot
f9fe6a705d Merge "Add missing libziparchive dependency." 2017-06-28 16:35:39 +00:00
Elliott Hughes
e1bb7a5752 Add missing libziparchive dependency.
Bug: http://b/37560614
Test: builds even after removing system/core/include/ziparchive
Change-Id: Ib7ed45cafe83d24ed55aac28b4f41a073c371bc2
2017-06-28 08:00:17 -07:00
Tao Bao
2e20c11828 Merge "Add override specifier and member constness to RecoveryUI classes."
am: d6fb1c6367

Change-Id: I9b012c3096563e3c0187f644ed4fa930e785c502
2017-06-27 22:35:32 +00:00
Tao Bao
d6fb1c6367 Merge "Add override specifier and member constness to RecoveryUI classes." 2017-06-27 22:29:36 +00:00
Tao Bao
076aba3d8a Merge "Formatting RecoveryUI related files."
am: 8e7db8f4a6

Change-Id: I81e0e1e088da045f217aff957c7c5730d09cabbe
2017-06-27 19:06:17 +00:00
Treehugger Robot
8e7db8f4a6 Merge "Formatting RecoveryUI related files." 2017-06-27 19:00:48 +00:00
Tianjie Xu
170aa1c923 Merge "avoid assuming build number is a 32-bit integer"
am: 30afdee987

Change-Id: Ibe47feaf6d00838db24b76a51e2418772f329e0d
2017-06-26 21:56:49 +00:00
Tianjie Xu
30afdee987 Merge "avoid assuming build number is a 32-bit integer" 2017-06-26 21:12:09 +00:00
Daniel Micay
a29d8d69d2 avoid assuming build number is a 32-bit integer
The install logging currently assumes that the build number is a 32-bit
integer and prints an error when that doesn't hold true. However, that's
only a convention used by Google builds.

From build/core/version_defaults.mk:

    ifeq "" "$(BUILD_NUMBER)"
      # BUILD_NUMBER should be set to the source control value that
      # represents the current state of the source code.  E.g., a
      # perforce changelist number or a git hash.  Can be an arbitrary string
      # (to allow for source control that uses something other than numbers),
      # but must be a single word and a valid file name.
      #
      # If no BUILD_NUMBER is set, create a useful "I am an engineering build
      # from this date/time" value.  Make it start with a non-digit so that
      # anyone trying to parse it as an integer will probably get "0".
      BUILD_NUMBER := eng.$(shell echo $${USER:0:6}).$(shell $(DATE) +%Y%m%d.%H%M%S)
    endif

Change-Id: I8e7cec0618783f69545ba76d0dce2bbc1681784c
2017-06-26 10:53:03 -04:00
Tao Bao
99b2d77475 Add override specifier and member constness to RecoveryUI classes.
Test: mmma bootable/recovery
Change-Id: I66e328614423488a4027d7878f4569fbf3a3721e
2017-06-23 23:06:01 -07:00
Tao Bao
5d2e3bd109 Formatting RecoveryUI related files.
All cosmetic changes about indentation reformatting in this CL.

Test: mmma bootable/recovery
Change-Id: I4539e6244697d1f356b7eb10b961b52d7db561f7
2017-06-23 23:05:56 -07:00
Luke Song
799cd0bb5d Merge "Restructure vr_ui" am: 20d40ce53a
am: 674851dc86

Change-Id: Ie94f4e605713dc9bb4a4e312edadc1e8120d860d
2017-06-24 01:24:29 +00:00
Luke Song
674851dc86 Merge "Restructure vr_ui"
am: 20d40ce53a

Change-Id: I83efb71cf8d36be932660645a36191be0f12ddc7
2017-06-24 01:19:28 +00:00
Treehugger Robot
20d40ce53a Merge "Restructure vr_ui" 2017-06-24 01:11:04 +00:00
Luke Song
9d4839c60f Restructure vr_ui
Get rid of pixel offset variables, and use makefile variables in
BoardConfigs.

Bug: 37779982
Test: Verified vr ui has same behavior.
Change-Id: Ifbf44e27d7101aedbe3c0e6db4b8181d56efadfd
(cherry picked from commit 81a8e4cab2)
2017-06-23 16:51:00 -07:00