By default, the helper program is invoked in a way that is compatible
with avbtool's --signing_helper. However, the arguments have been
extended slightly to allow passing in the passphrase file or environment
variable for non-interactive use.
Fixes: #310
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This is never reachable due to additional checks in every code path that
invokes sign() and verify(), but still better to be correct.
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
lz4_flex appears to compress system images better than the original lz4
implementation used in libsnapshot_cow, so the estimates are too low.
Fixes: #306
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
Otherwise, if the partition size increases or the data becomes more
incompressible, update_engine might fail to flash the partition due to
the CoW block device running out of space.
Since all known VABC-enabled OTAs in the wild currently use CoW v2 with
lz4 compression, this is the only configuration we support. CoW v3 also
exists in AOSP's libsnapshot_cow, but is much more complicated to
implement and is not yet used, even in the Android 15 beta OTAs.
Fixes: #306
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
The precompiled binaries are compiled for aarch64 API 31, which should
work for every device that avbroot supports.
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
`specified file not found in archive` is a useless error message when
there's no additional context.
Issue: #301
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
Magisk no longer puts both magisk64 and magisk32 in the ramdisk.
Instead, it just puts a single binary for the target ABI.
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
Previously, there was no way to easily see the values of the recomputed
fields without unpacking the newly built image. This commit adds a new
`--output-info` option to the `avb pack` subcommand to write/overwrite a
new `avb.toml` file.
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
Previously, for resizable images, the user had to guess an appropriate
size for the final image that could fit all the AVB metadata. This
commit adds a new `--recompute-size` option to the `avb pack` subcommand
to generate a minimally sized image.
Fixes: #294
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
OnePlus seems to be getting worse and worse with some devices not being
recoverable.
Issue: #290
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This way, all of the patchers are constructed in the same place and we
don't have to pass their parameters through multiple functions.
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This allows the user to boot GSIs signed by the same key. The option is
disabled by default because some Android builds disable DSU support by
removing all keys to reduce the attack surface. We don't want to
reenable DSU support on these builds unless the user asks for it.
Closes: #286
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This includes a fix for yet another infinite-loop-on-drop bug in the
bzip2::write::BzDecoder implementation. This could be easily triggered
when interrupting an avbroot command while it is extracting a bzip2
compressed payload.bin chunk.
Fixes: #285
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>