This is a squash of the following commits:
Author: Chris Soyars <ctso@ctso.me>
Date: Thu Dec 23 00:44:33 2010 +0100
Add otapackage support for backuptool
Change-Id: I512554c579d444067cd3ccbb0e6946a5eb6bc964a
Modular backuptool.sh. Executes backup and restore methods defined in arbitrary /system/addon.d/*.sh scripts.
* Copy backuptool.functions alongside backuptool.sh.
* Delete both from /system/bin as they are not useful there.
Patch Series
============
http://review.cyanogenmod.com/#change,13265
CyanogenMod/android_build
* edify generator
http://review.cyanogenmod.com/#change,13266
CyanogenMod/android_system_core
* permissions on /system/addon.d
http://review.cyanogenmod.com/#change,13267
CyanogenMod/android_vendor_cm
* 50-cm.sh reference backup script
* modular backuptool.sh
* support backuptool.functions used by /system/addon.d/*.sh scripts
Change-Id: I26b4907d28f49c69627699d2accd2f0fa2d1b112
update ota_from_target_files to handle mounting/unmounting for backupscript
backupscript should not be mounting/unmounting itself as it makes other
scripts have unexpected results (such as modelid_cfg, which expects /system
to be mounted)
instead have the ota script handle the mounting/unmounting
Change-Id: I94511f4147c624d975cb3ecbeaa8b0e98f63437c
build: Don't run backuptool on GMS builds
Change-Id: I5dde27f9d16b88049171db9805221d92e67f3e5d
Author: Tom Marshall <tdm@cyngn.com>
Date: Wed Apr 9 16:14:07 2014 -0700
build: edify: use set_metadata for backuptool
Also use saner permissions on backuptool.sh
Change-Id: I50742b51867aa358f5924b8dc208833092a35bd9
Author: Ricardo Cerqueira <ricardo@cyngn.com>
Date: Wed Nov 5 18:16:43 2014 +0000
ota: Include copies of the recovery scripts even if shipping in block mode
Author: Ricardo Cerqueira <ricardo@cyngn.com>
Date: Wed Nov 5 19:58:59 2014 +0000
ota: Fix recovery-script cleanups in block mode
Change-Id: Iadb480f8062cfb7a0e6c9024e32ac0d71a7481d7
Author: Arian <arian.kulmer@web.de>
Date: Wed Jun 17 12:35:16 2020 +0200
build: Disable backuptool on user instead of GMS builds
* Backuptool is not exclusively used for GApps but
also used by other things (i.e. Magisk), hence
it shouldn't be disabled on all GMS builds.
Change-Id: Ia95c6fed21d7bed5e2e0610aa94264edc1d02c80
Author: Davide Garberi <dade.garberi@gmail.com>
Date: Tue Sep 24 18:45:17 2019 +0200
releasetools: Move system mount handling to backuptool
* This allows the ROM to be flashed on any recovery, whether it mounts
system to /system, /system_root or /mnt/system like Q recovery
* Remove any type of system mount with static paths from updater-script
to figure out the path dinamically through backuptool
Change-Id: I7b33726305cb6f3eec146d26135f0081002a25dc
Author: Jesse Chan <jc@lineageos.org>
Date: Fri Jun 12 21:53:18 2020 +0800
releasetools: support dynamic partitions for backuptool
Change-Id: I4a04e52f64e307a9852d786aabf17975a020b4b8
Signed-off-by: Jesse Chan <jc@lineageos.org>
Author: Jesse Chan <jc@lineageos.org>
Date: Tue Jul 7 23:50:10 2020 +0800
backuptool: do not unmap dynamic partition after finished
Keep partitions mapped so users can install addons.
Change-Id: Ic70621986bf136775e686dc8cc690ce076485907
Signed-off-by: Jesse Chan <jc@lineageos.org>
Author: Alessandro Astone <ales.astone@gmail.com>
Date: Mon Apr 12 18:40:10 2021 +0200
backuptool: Map extra dynamic partitions for Addon.d V3
Change-Id: Ia8fa1963c722c5aa2987b947e4e919e19909a9a8
Change-Id: I2401d334d8e16d18d3770b339ec2c787dd8e477c
This allows a subset of partitions to be updated in in full OTA fashion
when generating an incremental OTA. The benefit is faster OTA
generation(mostly for testing purposes).
Test: th
Bug: 365843325
Change-Id: Iff9f649c0646342eb9bdece9a46c942cb432b5e8
zucchini failure in OTA is observed. To unblock, disable
zucchini first. After the investigation are done and determined
zucchini is safe to enable, we will turn it back on.
Test: th
Bug: 342523982
Change-Id: I79c245356a356389328c788b3b7977b224e1df6a
With our version compatibility check, overriding our cow version no
longer works. Updating this check to only apply if a command line
vabc_cow_version is not specified.
NOTE: the ota may not successfully apply, depending on device if we
override the cow version
Test: th
Change-Id: Ibbed6cf94cc2e91597d0c249dc8ade314b8341a2
If boot_variable_file is not found locally, look for it inside
input_target_files.
Bug: 335732867
Test: generate OTA with file in target-files.zip and verify metadata
Change-Id: I2e61f50850e82a3795f2e0e1aefcaf2329a8cfb1
supporting negative compression levels in ota_from_target_files in the
format of zstd,-$compression_level
Test: ota_from_target_files
Change-Id: If2ca592829f10e7a0226cb41680cb47223d17c71
Check that device is shipped supporting v3 in order to enable it.
Otherwise fallback.
Bug: 331202590
Test: th
Change-Id: I218fbaa6a044420af39be70b055da5ffbfced158
Allow override for vabc_cow version if specified from the command line.
If OPTIONS.vabc_cow_version is already defined, then we don't want to
modify this value since it was defined by --vabc_compression_param=
Test: th
Change-Id: I57b8129faf5caf9de1dc8ad96e7570214a9f3313
If a device's source or target cow version is specified at 2 (or
undefined) we should fallback on using the v2 writer.
e.g.
1. v3 -> v2 downgrade OTA
2. v2 -> v3
Bug: 322279333
Test: ota_from_target_files
Change-Id: I8c5139eceeb64ee255ddea66017b3e17bbdc44c0
Adding 256k support for ota_from_target_files since this is the max
comperssion_factor allowed in v3 cow
Test: ota_from_target_files
Change-Id: Ic7826c82e53ec3fdbd04fdff9dfb7a76038f6a42
vabc_compression_param can be a combination of algorithm + level.
Updating this check so that it works with both.
Test: ota_from_target_files
Change-Id: I2f13ca31c728d7c8607ac085c9b663691f8dfa02
With the introduction of variable block sized compression. We want
ota_from_target_files to support a flag that confgures the max block
size for compression. This flag will be passed to delta_generator and
then used fro cow estimation + ota installation
Removing a function here as it looks like it's unused. We can modify the
specified values with ModifyTargetFilesDynamicPartitionInfo(). The other
function looks like it's just a wrapper.
Test: ota_from_target_files.
Change-Id: Ia17bf62d40f947ef1fbe543886f04d10acd5bcc9
Checking ro.build.date.utc to detect a downgrade is not enough in the
case where several target files are merged, as timestamps can differ
for each partition.
The solution is to check the build timestamp for each partition and
ro.build.date.utc.
With this change ota generation will be aborted during creation
instead of rejected when installing on device.
This also fixes the --override_timestamp so it is possible to generate
a package where timestamps are reversed, as was added in:
3e6161a3b3.
Issue: 315913966
Test: Manual, confirm that ota generation is aborted when timestamp
on post vendor partitions is newer than on pre.
Ota created successfully with --override_timestamp parameter and
installation successful
Test: atest --host releasetools_test
Change-Id: I275e67a3840f4ef2263381c253231068e72f47d2
Added a --vabc_cow_version flag to override cow version.
This enables testing on COW v3 without switching the android platform to
v3.
Test: th
Bug: 313962438
Change-Id: I9ff3ae6b6c7c8ef8c1423af6f25e420f94558d35
Move OTA signing flags to payload_signer.py so that we can re-use these
flags in multiple binaries.
Test: th
Bug: 293313353
Change-Id: I44f9910cee37c449397e174a5784f747ec9fb0d6
During OTA generation, we check the vabc compression param specified by
target files, and override compression param to gz if the specified
compression method is unsupported. Run the same validation on
compression param passed by --vabc_compression_param as well.
Test: th
Change-Id: If855a2ee8c3c280c74efd5a67df229ab6c5709c5
If a T launch device later changes to LZ4(which is supported since U),
we will fallback to older compression algorithms, because if the full
OTA is applied on an T build, the update_engine on device won't support
lz4.
Bug: 295989519
Test: generate full OTA for T launched devices, make sure lz4 is not
used
Change-Id: I82fdf788e47e2a6daeaa4479bfecf317d8ebb5d5
Adding option to ota_from_target_files to configure compression level.
This option can be configured via the --vabc_compression_param flag.
e.g. --vabc_compression_param=gz,9 specifies gz compression algorithm
using level 9 compression
Test: ota_from_target_files
Change-Id: Ifc851faccbb3fba466d45c9695aaab322a362081
The following log message would always be shown:
WARNING : Cannot find care map file in target_file package
Break out of the care map copying loop as soon a file has been
copied. This ensures that else statement is only executed if no
care map file exists.
Test: Manual. Run ota_from_target_files with target-zip with and
without care map files.
Change-Id: Ia196aa182ed81f21424317a7005f5634866b4b99
common.LoadInfoDict() already supports loading from extracted
directories, just use it.
Test: generate an incremental OTA where both inputs are directories
Bug: 227848550
Bug: 277028723
Change-Id: Iedba831bb4d65d971df6b2ac95279e3234a02e2f
This allows the build system to potentially paralleize generation of OTA
package and zipping of target files
Bug: 262185376
Bug: 227848550
Change-Id: I90b6c25761683ebe3803b22fc8e23540a5282c66
Adding an option to configure max number of threads used during
ota_from_target_files
Bug: 277794445
Test: tested ota_from_target_files
Change-Id: I9bae92ee43c21926434ab04563a2b4f0678b73eb
When building android, build system will first zip target_file directory
into a .zip file, and then invoke ota_from_target_files. We
ota_from_target_files can work directly on top of directories, we can
parallelize OTA generation and target_file zipping, making builds
faster.
Bug: 227848550
Bug: 277028723
Test: th
Change-Id: Id72bd7cca708af0e1bae2db754f39b27777cd601
Currently, ota_from_target_files(a python script) calls
brillo_update_payload(a bash script), which then calls delta_generator(a
C++ binary) to do the actual diffing. Having brillo_update_payload in
the middle does not offer any additional flexibility, but it makes
maintaince more difficult. Bash code is less readable and harder to
debug. Further more, everytime we want to add a new flag to
delta_generator, we have to add the flag in three places:
ota_from_target_files, brillo_update_payload, delta_generator.
Historically, brillo_update_payload was there because we inherited from
ChromeOS side. This bash scripts extracts target_files.zip and invoke
delta_generator to generate the actual OTA. Any customizations we want
on OTA must be implemented by modifying the input target_files.zip ,
Manipuating big zip files is slow and inefficient.
To make thing simpler/faster, remove the intermdiary call to
brill_update_payload. ota_from_target_files will now extract target
files and call delta_generator directly.
Test: th
Bug: 227848550
Change-Id: I44b296e43bf7921bcf48ef6a1e4021a12669739c
XOR only saves space if COW data is compressed. If compression parameter
is set to none, disable XOR as it does not save anything but still costs
CPU cycles.
Test: th
Change-Id: I674ad74140570ce4740c290d1adb9e9b5a08426e
Secondary payload is already handled by creating a new instance of
PayloadGenerator, when creating PayloadGenerator for primary payload,
we should not include the OPTIONS.secondary parameter.
Bug: 270100752
Test: ota_from_target_files --include_secondary
Change-Id: I908043bad11aa6d47dc4dc9b61da460fcfa4f0b9
This changes the generation of the target files with oem images to
operate in two passes. 1/ zip2zip is called without any filespec.
2/ oem images are replaced.
This allows to generate the target-files faster (as entries do not
need to be iterated one by one) and removes the need to escape
special file names.
Bug: 269397842
Change-Id: Ic1cf398b90344e01b2f1658079903d45bcc00b46
Different devices/builds might have different constraints on what
partitions should be updated together in a partial OTA. Add a convenient
feature to auto detect.
Test: generate ota with --partial , make sure output OTA contains only 4
partitions
Change-Id: Id79e4bc4c5fb9d1225cb2aa7c1823afccc0b61f2
In the old days, we hacked values of ZIP64LIMIT to get around size
limitations of non-zip64 supported zip files. Now that we switched to
python3 + zip64, there's no point in keeping those hacks.
Test: th
Bug: 255683436
Change-Id: I913db33dad5503736c68a7a1f1321aa952019f60