Files
avbroot/e2e/e2e.toml
T
Andrew Gunnerson 7113fb32ef Add support for outputting zip files with no data descriptors
This commit adds a new `--zip-mode` parameter to `avbroot ota patch` to
control whether the patched OTA zip is written with data descriptors or
not. By default, the `streaming` mode is used, which matches the current
behavior where the zip is hashed for signing as it is being written. The
new `seekable` mode fully writes the zip before rereading it to hash the
contents.

The new mode is useful for devices with broken zip parsers that fail to
properly handle data descriptors.

All of the end-to-end tests have been duplicated to test both modes.

Adding the seekable mode necessitated a couple other changes:

* BufWriter is no longer used. Type erasure is very painful in Rust, so
  we need to keep the writer types the same for both the streaming and
  seekable modes. BufWriter is unusable in the seekable mode because we
  need to be able to read back what was written, which isn't supported.

* HolePunchingWriter has been removed. It was a simple way to produce
  sparse files by seeking whenever a write buffer consists fully of
  zeros. When combined with BufWriter, there was previously never a
  situation where this was undesirable. However, with the new seekable
  mode and the zip library's pattern of writing one field at a time, the
  final 2 zero bytes (representing an empty archive comment) is never
  written and the file size is not increased either.

  Removing this is not a big deal since we no longer use stripped OTAs
  for the end-to-end tests. Those were really the only OTAs that
  benefitted from sparse files. A real OTA has very few zero bytes due
  to compression.

Issue: #328

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-08-20 21:31:33 -04:00

177 lines
5.0 KiB
TOML

# Metadata used when generating OTAs. These values don't affect behavior at all.
[ota_info]
# Make sure generated OTAs aren't flashable on real devices.
device = "avbroot_fake_device"
fingerprint = "avbroot/avbroot_fake_device:14/UQ1A.240101.000/12345678:user/release-keys"
build_number = "UQ1A.240101.000"
incremental_version = "12345678"
android_version = "14"
sdk_version = "34"
security_patch_level = "2024-01-01"
# Google Pixel 7 Pro
# What's unique: init_boot (boot v4) + vendor_boot (vendor v4)
[profile.pixel_v4_gki]
vabc_algo = "Lz4"
[profile.pixel_v4_gki.partitions.boot]
avb.signed = true
data.type = "boot"
data.version = "v4"
data.kernel = true
[profile.pixel_v4_gki.partitions.init_boot]
avb.signed = true
data.type = "boot"
data.version = "v4"
data.ramdisks = [["init", "first_stage"]]
[profile.pixel_v4_gki.partitions.system]
avb.signed = false
data.type = "dm_verity"
data.content = "system_otacerts"
[profile.pixel_v4_gki.partitions.vbmeta]
avb.signed = true
data.type = "vbmeta"
data.deps = ["boot", "init_boot", "vendor_boot", "vbmeta_system"]
[profile.pixel_v4_gki.partitions.vbmeta_system]
avb.signed = true
data.type = "vbmeta"
data.deps = ["system"]
[profile.pixel_v4_gki.partitions.vendor_boot]
avb.signed = false
data.type = "boot"
data.version = "vendor_v4"
data.ramdisks = [["otacerts", "first_stage", "dsu_key_dir"]]
[profile.pixel_v4_gki.hashes_streaming]
original = "c00f891f941f3dddb28966f7b07f3acea773bee104dace82b37c2d1341f09422"
patched = "ce9d8ee97828d233809742a5d3f23aa27b042675b1935ca9e3df0592c55788fd"
[profile.pixel_v4_gki.hashes_seekable]
original = "96a6c366b5de1c3b10d4d6cb4ca503c83ac4cd9ca952a965cceb041990ba7022"
patched = "e7b4609ba7a23609211dcae143bc43f091f286fbbb3a9301c02ee25614d35deb"
# Google Pixel 6a
# What's unique: boot (boot v4, no ramdisk) + vendor_boot (vendor v4, 2 ramdisks)
[profile.pixel_v4_non_gki]
vabc_algo = "Lz4"
[profile.pixel_v4_non_gki.partitions.boot]
avb.signed = true
data.type = "boot"
data.version = "v4"
data.kernel = true
[profile.pixel_v4_non_gki.partitions.system]
avb.signed = false
data.type = "dm_verity"
data.content = "system_otacerts"
[profile.pixel_v4_non_gki.partitions.vbmeta]
avb.signed = true
data.type = "vbmeta"
data.deps = ["boot", "vendor_boot", "vbmeta_system"]
[profile.pixel_v4_non_gki.partitions.vbmeta_system]
avb.signed = true
data.type = "vbmeta"
data.deps = ["system"]
[profile.pixel_v4_non_gki.partitions.vendor_boot]
avb.signed = false
data.type = "boot"
data.version = "vendor_v4"
data.ramdisks = [["init", "otacerts", "first_stage", "dsu_key_dir"], ["dlkm"]]
[profile.pixel_v4_non_gki.hashes_streaming]
original = "4d692bc777b568b0626d3c08d2e6f83f1b472db5ad903486daaec6a78d0cc26e"
patched = "e27673e4f30933710c11d51f0e73849068cbe9bc9f54e6076bdd93f9a5c8ea0a"
[profile.pixel_v4_non_gki.hashes_seekable]
original = "ea27ecd9718c17b63400b2548680bb3cee93ce63b4fc44ff9654ca0d9c5372a8"
patched = "3456b14e014cf565a808a9e834d9105a23539f07b2c460db19c9384aadbc3b93"
# Google Pixel 4a 5G
# What's unique: boot (boot v3) + vendor_boot (vendor v3)
[profile.pixel_v3]
vabc_algo = "Lz4"
[profile.pixel_v3.partitions.boot]
avb.signed = true
data.type = "boot"
data.version = "v3"
data.kernel = true
data.ramdisks = [["init"]]
[profile.pixel_v3.partitions.system]
avb.signed = false
data.type = "dm_verity"
data.content = "system_otacerts"
[profile.pixel_v3.partitions.vbmeta]
avb.signed = true
data.type = "vbmeta"
data.deps = ["boot", "vendor_boot", "vbmeta_system"]
[profile.pixel_v3.partitions.vbmeta_system]
avb.signed = true
data.type = "vbmeta"
data.deps = ["system"]
[profile.pixel_v3.partitions.vendor_boot]
avb.signed = false
data.type = "boot"
data.version = "vendor_v3"
data.ramdisks = [["otacerts", "first_stage", "dsu_key_dir"]]
[profile.pixel_v3.hashes_streaming]
original = "f432dc7931520feb238474aa707dd5299747562ffe6129f3f763b5f11ac473ab"
patched = "3850a2e73bd783a1ec4a70c59f37d2374e017c20df7ab4b591182b14d187c18e"
[profile.pixel_v3.hashes_seekable]
original = "7d29ecc6780953c22052a576b8dc85066c8667a875e918a786a08ff4545b47d1"
patched = "9f6342940b7cfbeb27b0567f006bb35cbee910ef038ec535403c662d5252ca71"
# Google Pixel 4a
# What's unique: boot (boot v2)
[profile.pixel_v2]
vabc_algo = "Gzip"
[profile.pixel_v2.partitions.boot]
avb.signed = false
data.type = "boot"
data.version = "v2"
data.kernel = true
data.ramdisks = [["init", "otacerts", "first_stage", "dsu_key_dir"]]
[profile.pixel_v2.partitions.system]
avb.signed = false
data.type = "dm_verity"
data.content = "system_otacerts"
[profile.pixel_v2.partitions.vbmeta]
avb.signed = true
data.type = "vbmeta"
data.deps = ["boot", "vbmeta_system"]
[profile.pixel_v2.partitions.vbmeta_system]
avb.signed = true
data.type = "vbmeta"
data.deps = ["system"]
[profile.pixel_v2.hashes_streaming]
original = "1b45235b58054009cc496f6c3ee11d3dc16ed5c388c861761e26a6fce83103a0"
patched = "193b2dc70dd465d686f35c7b7f74d2cc1b06a55e48cf5c2e4df0f667e03032fc"
[profile.pixel_v2.hashes_seekable]
original = "52284308fae10cbaf09ade14e92f3bbe6149751a42bff15432982fcef8d890ab"
patched = "7ad74ac87ddcaf34938017e6149a646041d70926e31ecda93e156e9397467b3b"