Commit graph

8537 commits

Author SHA1 Message Date
Yifan Hong
35d5e9f4cf Add slot suffix to DAP ops
If device supports both A/B and non-A/B, when applying a
non-A/B package, add current slot suffix and apply the update
to the partition at current slot.

This includes:
- (un)map_partition in edify script. For example,
  map_partition("system") will automatically append slot suffix
  to "system" before calling CreateLogicalPartition.
- All operations in dynamic_partitions_op_list. For example,
  add foo group_foo
  will automatically append slot suffix to foo and group_foo
  before editing the super partition metadata.

Test: apply update
Bug: 153581609
Change-Id: Idbd0bfea142529a33dddb4d2debfc74513290730
(cherry picked from commit bc7e1db211)
Merged-In: Idbd0bfea142529a33dddb4d2debfc74513290730
2020-05-19 15:20:14 -07:00
Yifan Hong
f2af5629d2 Detect non-A/B vs. A/B packages correctly.
Check the package metadata to determine whether this is an
A/B or non-A/B update package. This is more accurate.

Also checks ro.virtual_ab.allow_non_ab flag. This is useful for
continuously supporting (and testing) non-A/B.

Bug: 153581609
Test: apply non-A/B update on cuttlefish

Change-Id: I629a533a67966d46d9cd87a59c6b9af26daf1667
(cherry picked from commit 2a4afd29a1)
Merged-In: I629a533a67966d46d9cd87a59c6b9af26daf1667
2020-05-19 15:20:14 -07:00
Treehugger Robot
4577dff5a0 Merge "Address the warnings in recovery code" 2020-03-16 04:35:13 +00:00
Tianjie Xu
a69c69b26f Merge "Consolidate the wait in recovery's reboot" 2020-03-14 22:33:29 +00:00
Tianjie Xu
00c4aba9bf Consolidate the wait in recovery's reboot
After a reboot function call, we should always wait for it to finish
without executing other instructions.

Bug: 151110322
Test: build
Change-Id: I1dda291a0835ff96df7eaf42eba1a38267a3beeb
2020-03-13 16:09:48 -07:00
Treehugger Robot
95101e7fca Merge "recovery: Remove HOST_OS guard for f2fs tools" 2020-03-13 22:40:02 +00:00
Tianjie Xu
fb08b015f2 Address the warnings in recovery code
The following warnngs generate when compile with WITH_TIDY=1

.../bootable/recovery/applypatch/imgdiff.cpp:968:7: warning: 'src_ranges' used after it was moved [bugprone-use-after-move]
      src_ranges.Clear();
      ^
.../bootable/recovery/applypatch/imgdiff.cpp:966:27: note: move occurred here
        split_src_ranges->push_back(std::move(src_ranges));

The logic itself seems correct since the class is meant to be cleared
after move. I feel the std::move in 966 is actually useful to call the
move constructor in RangeSet. So I just modify L968 to suppress the
warning.

Less important ones:
bootable/recovery/applypatch/applypatch_modes.cpp:79:34: warning: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg]
bootable/recovery/applypatch/imgdiff.cpp:1038:30: warning: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg]
bootable/recovery/applypatch/imgdiff.cpp:1054:48: warning: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg]
bootable/recovery/updater/include/private/commands.h:310:16: warning: std::move of the variable 'patch' of the trivially-copyable type 'PatchInfo' has no effect; remove std::move() [performance-move-const-arg]
bootable/recovery/updater/install.cpp:663:43: warning: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg]

Bug: 150955971
Test: build
Change-Id: Ieb75f0229c47d470d4f5ac93fab39c5698d3f914
2020-03-07 17:54:11 -08:00
Bill Yi
917b666966 Merge "Merge stage-aosp-master to aosp-master - DO NOT MERGE" 2020-03-05 18:27:29 +00:00
Bill Yi
42ac06e560 Merge stage-aosp-master to aosp-master - DO NOT MERGE
Change-Id: I07b5b396b277573f276cec97ed0f0684e8a72885
2020-03-05 09:50:55 -08:00
Automerger Merge Worker
ff9ca5b4fa Merge "Add libavb as a dependency" am: 6038661eec
Change-Id: I5c77634e039ccdffadcd821725e13986466c915c
2020-02-28 21:58:47 +00:00
Tianjie Xu
6038661eec Merge "Add libavb as a dependency" 2020-02-28 21:47:14 +00:00
Tianjie Xu
2bb374a86d Add libavb as a dependency
It's needed by libfec

Test: mma
Change-Id: Ic82671f6506e7718afa965a511261b1b329ea38f
2020-02-28 11:41:31 -08:00
Automerger Merge Worker
d7df83c4bd Merge "Move libboot_control to boot_control 1.1" am: feb6b91ed4
Change-Id: I9b99e64e747cdc3fb11ef3042108fe9e6a5b11d8
2020-02-25 21:57:24 +00:00
Tianjie Xu
feb6b91ed4 Merge "Move libboot_control to boot_control 1.1" 2020-02-25 21:43:07 +00:00
Automerger Merge Worker
616db72209 Merge "Generate recovery.img for unittest during build time" am: bf885b6b21
Change-Id: I75f0fa79c3e8d2c771edb18bcdc8faa344f273f9
2020-02-24 19:01:14 +00:00
Tianjie Xu
bf885b6b21 Merge "Generate recovery.img for unittest during build time" 2020-02-24 18:49:05 +00:00
Automerger Merge Worker
c9b0fe7172 Merge "Recovery UI meet issue if image size is too large" am: f5b94d6e9b
Change-Id: I358dc2c378a2301b46046832ae4c168e7a6fb649
2020-02-22 17:46:03 +00:00
Elliott Hughes
f5b94d6e9b Merge "Recovery UI meet issue if image size is too large" 2020-02-22 17:39:19 +00:00
zhang sanshan
0d81b89472 Recovery UI meet issue if image size is too large
When display screen size is too small, some images in recovery
resource cannot caculate the right display position. So the
image cannot show in the screen.
Limit the calculated position to avoid such issue.

Change-Id: Iebebfe0dfbc568ee3a6b6a31b81d060b3ce5f940
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
2020-02-21 16:20:47 +00:00
Tianjie Xu
fa77ee8470 Generate recovery.img for unittest during build time
The unit tests for imgpatch is comparing the compressed bytes. As
a result, these unit tests will fail with libz change.

Since the recovery image is just a gzipped ramdisk with some wrappings,
we can generate with minigzip it during the build time. This matches
the usage in the real world, where we generate the patch with the host
side libz; and apply the patch with the library on the device.

Bug: 149443852
Test: tests pass on Pixel3
Change-Id: I7885765a161c6bf765671bc55a72cfcaa04b4138
2020-02-20 23:09:44 -08:00
Automerger Merge Worker
9af39bf5c4 Merge "recovery: add a way to enable metadata_csum for ext4" am: 5ac6163822
Change-Id: I9957761c02094993bc84192e86069bd0832baee7
2020-02-21 05:41:19 +00:00
Jaegeuk Kim
5ac6163822 Merge "recovery: add a way to enable metadata_csum for ext4" 2020-02-21 05:40:48 +00:00
Automerger Merge Worker
a599c6ca45 Merge "updater_sample: add internet access permission" am: c760702633
Change-Id: If92f9b1c1afa05dcd50e1f121d04fccba6e9aed8
2020-02-20 23:13:53 +00:00
Treehugger Robot
c760702633 Merge "updater_sample: add internet access permission" 2020-02-20 22:58:32 +00:00
Jaegeuk Kim
a8d36e1ea9 recovery: add a way to enable metadata_csum for ext4
Requires to add "metadata_csum" in fsmgr_flag of fstab.

Bug: 149039306
Change-Id: I2b95dcaaf2ba224135ad51f117b7b01bbf342b7e
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2020-02-12 12:16:05 -08:00
Automerger Merge Worker
ecfa97375f Merge "rm libbinderthreadstate" am: 2015fe5dbc
Change-Id: Ia4e229316898c37513c9f025877eb77a730df346
2020-02-07 00:17:33 +00:00
Treehugger Robot
2015fe5dbc Merge "rm libbinderthreadstate" 2020-02-07 00:02:40 +00:00
Steven Moreland
c7647926f4 rm libbinderthreadstate
This library is empty, and its functionality has moved
into libbinder/libhwbinder.

Bug: 148692216
Test: N/A
Change-Id: Ie50d9130a8e43de7d5b222883169c26ab958e6d7
2020-02-06 13:28:52 -08:00
Automerger Merge Worker
88efe3ea38 [automerger skipped] Merge "Import translations. DO NOT MERGE" am: 8501ef04ea -s ours
am skip reason: subject contains skip directive

Change-Id: I816a0cb5930289bc2120394521398d6eb2487303
2020-02-01 20:15:57 +00:00
Treehugger Robot
8501ef04ea Merge "Import translations. DO NOT MERGE" 2020-02-01 20:05:23 +00:00
Bill Yi
3147b682cf Import translations. DO NOT MERGE
Change-Id: I81fcbdc2d6c21f6ffdefcf3c10792ebe5ade6e18
Auto-generated-cl: translation import
2020-02-01 07:19:31 -08:00
Automerger Merge Worker
d93d116134 Merge "Show warning message if sideload failed or is interrupted." am: e1d76ef395
Change-Id: I1f87047c256d49cd498e545b4899528c9d5a0ed3
2020-01-30 22:20:06 +00:00
Yifan Hong
e1d76ef395 Merge "Show warning message if sideload failed or is interrupted." 2020-01-30 22:03:58 +00:00
Yifan Hong
13b099696f Show warning message if sideload failed or is interrupted.
For non A/B and Virtual A/B devices where sideloading may affect
the existing OS,
- If sideload has failed, show a warning message in recovery menu header.
- If sideload has interrupted, automatically reboot back into recovery and
  show the warning message in recovery menu header.

Test: the above
Fixes: 140749209
Change-Id: Ifdfc28b45975cdc31b6fce2ecb99acc31bc61fa8
2020-01-29 16:59:07 -08:00
Yifan Hong
05eec42808 Merge "Prompt for confirmation before reboot if installation fails."
am: 1b208af5d4

Change-Id: I04be948b2c16b0f838ec37fe310006baeb5f1604
2020-01-29 13:26:18 -08:00
Yifan Hong
1b208af5d4 Merge "Prompt for confirmation before reboot if installation fails." 2020-01-29 20:32:27 +00:00
Yifan Hong
c9163fdacc Prompt for confirmation before reboot if installation fails.
If previous installation fails, menu item 'Reboot system now'
and 'Power off' now prompts for confirmation from the user.

Known issues:
- If the sideload is interrupted, it'll still boot into normal
Android in the next cycle.
- If 'Enter fastbootd' is chosen, and then 'Enter recovery', such
prompt do not show up.

Test: manual
Fixes: 142892891

Change-Id: I929b80e0520bd3b9f56d88a4b2203fcdd8d7b013
2020-01-28 12:47:55 -08:00
David Anderson
79ce1d3420 Merge "Remove fsck_unshare_blocks."
am: 699ea0f325

Change-Id: Iec58138809dd2809abb5de133810ba30a224dcce
2020-01-27 17:08:31 -08:00
Treehugger Robot
699ea0f325 Merge "Remove fsck_unshare_blocks." 2020-01-28 00:57:47 +00:00
David Anderson
969787cffd Remove fsck_unshare_blocks.
This code is dead. It was briefly used to support "adb remount" with
deduplicated partitions, but was very quickly obsoleted by overlayfs
support. There is no reason to include it anymore.

Bug: N/A
Test: N/A
Change-Id: I4cdcbf66bec80092f954826eaae037934ff37765
2020-01-27 09:30:55 -08:00
Daniel Rosenberg
ddb9dbb52b Merge "Set Casefold and PrjQuotas in Factory Reset"
am: 1cf5b0b591

Change-Id: I445400a7ee2ed293a712fad28eb4f8d0c750fa17
2020-01-24 19:09:33 -08:00
Treehugger Robot
1cf5b0b591 Merge "Set Casefold and PrjQuotas in Factory Reset" 2020-01-25 01:03:43 +00:00
Daniel Rosenberg
f25b977740 Set Casefold and PrjQuotas in Factory Reset
This sets up devices to have casefolding and project quotas if they have
enabled the relevant product properties. For ext4, we must set wide
inodes at makefs time, but other things are enabled by fs_mgr with
tune2fs at boot time.

Bug: 138321217
Bug: 138322712
Test: Enable on a device.
      Reformat from recovery. Check that /data has the expected values
      using tune2fs/f2fs.fsck
Change-Id: If706a3cad591f311eb904df4deca531d0b3fe0c4
2020-01-24 15:49:00 -08:00
Automerger Merge Worker
8de3a75e87 Merge "Mark libedify library as recovery_available." am: e3c7b067c8
Change-Id: I038243c757cfc755893f3d468da6498c1c67d2fd
2020-01-24 02:42:06 +00:00
Yifan Hong
e3c7b067c8 Merge "Mark libedify library as recovery_available." 2020-01-24 02:31:05 +00:00
P.Adarsh Reddy
cd46c1a860 Mark libedify library as recovery_available.
Mark libedify library as recovery_available so that
this is available in recovery.

Bug: 148189099
Test: Tested compilation, library is recovery available.
Functionality wise, tested sideloading in recovery.
Change-Id: Ie4a7a3af1fd32b7ec1bf2016938550e9312a519b
2020-01-23 14:06:55 +00:00
Tianjie Xu
fed0b90045 Merge "Retire the Tron metrics reporting for non-A/B update"
am: 6bdacc40ef

Change-Id: I3cb646b40746b06de19d7c50504a8699b2081fdc
2020-01-21 11:21:35 -08:00
Tianjie Xu
6bdacc40ef Merge "Retire the Tron metrics reporting for non-A/B update" 2020-01-21 19:10:46 +00:00
Tianjie Xu
eb27bfe1e8 Retire the Tron metrics reporting for non-A/B update
This is part of the effort to remove libmetricslogger in platform.
Remove the reporting since the status from non-A/B update is less
important to us. Plus the gmscore already has a copy of the logic
to parse the contents from last_install and report non-A/B metrics
to the clearcut log.

bug: 147776349
Test: build
Change-Id: I4fc5d58fb616edb3eb1edadf4614d3eca15c7ce1
2020-01-16 15:17:41 -08:00
Xin Li
777a1965f3 DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master
Bug: 146167222
Change-Id: I2819646a4508345ecb63d46a1b1e9666e680d0cc
2020-01-15 15:59:08 -08:00