Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always attempt to download full set of system imgs #501

Merged
merged 2 commits into from Apr 18, 2024

Conversation

cjreynol
Copy link
Collaborator

@cjreynol cjreynol commented Apr 10, 2024

The current logic might only download the system and product images from the system build's img.zip. We want the full set of system images if they exist. That means we always expect a system.img, the rest are optional.

Since we always download the target files if there is a --system_build present we might as well skip the img.zip and extract them from the target files.

Removed init_boot from the list of system images to fetch. See bug for context.

This also fixes that files from this particular codepath were not added to the fetcher_config.json and not de-sparsed.

Bug: 333616172
Test: cvd fetch --target_directory=/tmp/cvd/chd_target_files --default_build=aosp-main --system_build=11692693
Test: # slightly older aosp-main build
Test: cd /tmp/cvd/fetch_test
Test: shasum -b vbmeta_system.zip
Test: bsdtar -xf system/<target_files_zip>
Test: shasum -b IMAGES/vbmeta_system.zip
Test: # the hashes should match

@cjreynol
Copy link
Collaborator Author

@Databean would you please review when you have time. Thanks!

@cjreynol
Copy link
Collaborator Author

@jemoreira brought up the concern that perhaps target_files/IMAGES/system.img might not exist. If we keep downloading it from the img.zip we are at least staying consistent with out current behavior and not potentially introducing a breaking change.

@Databean Databean added the kokoro:run Run e2e tests. label Apr 10, 2024
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Apr 10, 2024
The current logic might only download the `system` and `product` images
from the system build's `img.zip`.  We want the full set of system
images if they exist.

Since we always download the target files if there is a `--system_build`
present we might as well skip the `img.zip` and extract them from the
target files.

Bug: 333616172
Test: cvd fetch --target_directory=/tmp/cvd/chd_target_files
--default_build=git_main/cf_arm64_only_phone-trunk_staging-userdebug
--system_build=git_main/cheetah-trunk_staging-userdebug
Test: cd /tmp/cvd/fetch_test
Test: bsdtar -xf system/<target_files_zip>
Test: shasum -b vbmeta_system.zip
Test: shasum -b IMAGES/vbmeta_system.zip
Test: # the hashes should match
The fallback is intended to avoid a regression where the images are not
present in the target files but were in the img.zip.

It is also possible that we end up extracting the product.img twice with
this logic, but I image the case where the target files has the product
image but not the system image is rare enough that we are okay without
special handling for the case.
@cjreynol
Copy link
Collaborator Author

Added fallback logic for the case pointed out by @jemoreira.

@cjreynol cjreynol added the kokoro:run Run e2e tests. label Apr 18, 2024
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Apr 18, 2024
@cjreynol cjreynol merged commit 49ae15e into google:main Apr 18, 2024
5 checks passed
@cjreynol cjreynol deleted the single_system_fetch_path branch April 18, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants