Utilize crosvm's new --initrd feature

We will shortly be bringing back the ramdisk for use by dynamic
partitions, this means we need ramdisk support in the crosvm manager.
This feature wasn't implemented when the crosvm support was first
added, but now it is. Use it.

Bug: 113175337
Change-Id: Iec51d909daf5f5c436091b03af6f143da95fdcfc
Merged-In: Iec51d909daf5f5c436091b03af6f143da95fdcfc
Signed-off-by: Alistair Strachan <astrachan@google.com>
diff --git a/host/libs/vm_manager/crosvm_manager.cpp b/host/libs/vm_manager/crosvm_manager.cpp
index 1605931..f4243a7 100644
--- a/host/libs/vm_manager/crosvm_manager.cpp
+++ b/host/libs/vm_manager/crosvm_manager.cpp
@@ -57,12 +57,6 @@
     : VmManager(config) {}
 
 cvd::Command CrosvmManager::StartCommand() {
-  if (!config_->ramdisk_image_path().empty()) {
-    // TODO re-enable ramdisk when crosvm supports it
-    LOG(FATAL) << "initramfs not supported";
-    return cvd::Command("/bin/false");
-  }
-
   // TODO Add aarch64 support
   // TODO Add the tap interfaces (--tap-fd)
   // TODO Redirect logcat output
@@ -74,6 +68,9 @@
   cvd::Command command(config_->crosvm_binary());
   command.AddParameter("run");
 
+  if (!config_->ramdisk_image_path().empty()) {
+    command.AddParameter("--initrd=", config_->ramdisk_image_path());
+  }
   command.AddParameter("--null-audio");
   command.AddParameter("--mem=", config_->memory_mb());
   command.AddParameter("--cpus=", config_->cpus());
@@ -134,3 +131,4 @@
 }
 
 }  // namespace vm_manager
+