...
The launch_cvd
command rus two commands assemble_cvd
and run_cvd
in its child processes. If both commands work as expected, the Android can launch successfully on Cuttlefish machine. The assemble_cvd
command generates root file system images with qcow2 overlay format, then the run_cvd
command invokes the virtual machine manager (either Crosvm or QEMU) to boot the generated images on virtual machine. The diagram below shows the Cuttlefish flow.
...
Using assemble_cvd
Let’s we assume we work on TRS and want to run Android Automotive OS on Xen virtual machine, in this case, it’s likely we cannot directly use launch_cvd
command for launching Xen virtual machine. Then we need to use assumble_cvd
command to help us to generate file system images, and we can execute QEMU command to launch Xen virtual machine. This is why we need to understand how to use assumble_cvd
command.
If directly run assumble_cvd
command, you will receive an error log and the program exits abnormaly:
Code Block |
---|
leoy@leoy-yangtze:~/Dev2/aosp_cuttlefish_test/cf$ HOME=$PWD ./bin/assemble_cvd
12-22 15:53:35.219 665720 665720 E assemble_cvd: assemble_cvd.cc:571 assemble_cvd failed:
12-22 15:53:35.219 665720 665720 E assemble_cvd: assemble_cvd.cc:571 | device/google/cuttlefish/host/commands/assemble_cvd/assemble_cvd.cc:484
12-22 15:53:35.219 665720 665720 E assemble_cvd: assemble_cvd.cc:571 | Result<int> cuttlefish::AssembleCvdMain(int, char **)
12-22 15:53:35.219 665720 665720 E assemble_cvd: assemble_cvd.cc:571 v CF_EXPECT(tty == 0)
12-22 15:53:35.219 665720 665720 E assemble_cvd: assemble_cvd.cc:571 stdin was a tty, expected to be passed the output of a previous stage. Did you mean to run launch_cvd?
Aborted |
The log reminds user to invoke launch_cvd
instead of the assemble_cvd
command. But this doesn’t mean we really cannot run assemble_cvd
command directly. Alternatively, we can save what’s the command and arguments into a shell script (we named it as test.sh
):
Code Block |
---|
HOME=$PWD ./bin/assemble_cvd --group_id=cvd_1 --report_anonymous_usage_stats=y --vm_manager=qemu_cli --webrtc_device_id=cvd_1-1 --gpu_mode=drm_virgl |
Then we can use the to launch the shell script with below command. This command can help use to close stdin and direct the stdout to the pipe :
Code Block |
---|
true | sh test.sh 2>&1 | cat |