Skip to content

Commit 3257ff8

Browse files
committed
Fix launch with kernel repacking
At some point assemble_cvd expected `cpio` to return non-zero values on success, which is no longer true. Newer versions of cpio return 0 on success. Ignoring the return value of cpio seems to work, the kernel is replaced successfully. Tested with: ``` bazel-bin/cuttlefish/package/cuttlefish-common/bin/cvd fetch --default_build=git_main/aosp_cf_x86_64_only_phone-trunk_staging-userdebug --target_directory=$HOME/dl_kernel --kernel_build=aosp_kernel-common-android-mainline/kernel_virt_x86_64 bazel-bin/cuttlefish/package/cuttlefish-common/bin/cvd create --host_path=$HOME/dl_kernel --product_path=$HOME/dl_kernel ``` Bug: b/427835411 Bug: b/510369069
1 parent fcea51c commit 3257ff8

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

base/cvd/cuttlefish/host/commands/assemble_cvd/boot_image_utils.cc

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,12 @@ Result<void> UnpackRamdisk(const std::string& original_ramdisk_path,
174174
CF_EXPECT(EnsureDirectoryExists(ramdisk_stage_dir));
175175

176176
SharedFD input = SharedFD::Open(original_ramdisk_path + kCpioExt, O_RDONLY);
177-
int cpio_status;
178-
do {
179-
LOG(ERROR) << "Running";
180-
cpio_status = Command(CpioBinary())
181-
.AddParameter("-idu")
182-
.SetWorkingDirectory(ramdisk_stage_dir)
183-
.RedirectStdIO(Subprocess::StdIOChannel::kStdIn, input)
184-
.Start()
185-
.Wait();
186-
} while (cpio_status == 0);
177+
Command(CpioBinary())
178+
.AddParameter("-idu")
179+
.SetWorkingDirectory(ramdisk_stage_dir)
180+
.RedirectStdIO(Subprocess::StdIOChannel::kStdIn, input)
181+
.Start()
182+
.Wait();
187183
return {};
188184
}
189185

base/cvd/cuttlefish/package/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package_files(
2424
"cuttlefish-common/bin/cf_vhost_user_input": "//cuttlefish/host/commands/vhost_user_input:cf_vhost_user_input",
2525
"cuttlefish-common/bin/console_forwarder": "//cuttlefish/host/commands/console_forwarder",
2626
"cuttlefish-common/bin/control_env_proxy_server": "//cuttlefish/host/commands/control_env_proxy_server",
27-
# "cuttlefish-common/bin/cpio": "@libarchive//cpio:cpio", # TODO(b/510369069)
27+
"cuttlefish-common/bin/cpio": "@libarchive//cpio:cpio",
2828
"cuttlefish-common/bin/cuttlefish_example_action_server": "//cuttlefish/host/example_custom_actions:cuttlefish_example_action_server",
2929
"cuttlefish-common/bin/cvd_import_locations": "//cuttlefish/host/commands/cvd_import_locations",
3030
"cuttlefish-common/bin/cvd_internal_display": "//cuttlefish/host/commands/display:cvd_internal_display",

0 commit comments

Comments
 (0)