Drop use of gce ramdisk.
This change disables gce ramdisk for good. Once this lands, we will be
booting up with Android ramdisk only.
BUG=65049764
Change-Id: Ie01ee39e4148ce8237aa09637f5b543cb77149cf
(cherry picked from commit 99725e9952fac925f488cb36863618219fc4ed0d)
diff --git a/config/guest_config.cpp b/config/guest_config.cpp
index 700f459..66ac3fb 100644
--- a/config/guest_config.cpp
+++ b/config/guest_config.cpp
@@ -273,10 +273,9 @@
ConfigureVirtioChannel(devices, 2, DeviceSourceType::kUnixSocketClient,
GetUSBSocketName());
- ConfigureDisk(devices, "vda", ramdisk_partition_path_);
- ConfigureDisk(devices, "vdb", system_partition_path_);
- ConfigureDisk(devices, "vdc", data_partition_path_);
- ConfigureDisk(devices, "vdd", cache_partition_path_);
+ ConfigureDisk(devices, "vda", system_partition_path_);
+ ConfigureDisk(devices, "vdb", data_partition_path_);
+ ConfigureDisk(devices, "vdc", cache_partition_path_);
ConfigureNIC(devices, concat("amobile", id_), mobile_bridge_name_, id_, 1);
ConfigureHWRNG(devices, entropy_source_);
diff --git a/config/guest_config.h b/config/guest_config.h
index 4c2acd4..bfb42d4 100644
--- a/config/guest_config.h
+++ b/config/guest_config.h
@@ -63,12 +63,6 @@
return *this;
}
- // Set Android ramdisk image path.
- GuestConfig& SetRamdiskPartitionPath(const std::string& path) {
- ramdisk_partition_path_ = path;
- return *this;
- }
-
// Set Android system partition image path.
GuestConfig& SetSystemPartitionPath(const std::string& path) {
system_partition_path_ = path;
@@ -136,7 +130,6 @@
std::string kernel_args_;
std::string initrd_name_;
- std::string ramdisk_partition_path_;
std::string system_partition_path_;
std::string cache_partition_path_;
std::string data_partition_path_;
diff --git a/launcher/main.cc b/launcher/main.cc
index e624876..54f413b 100644
--- a/launcher/main.cc
+++ b/launcher/main.cc
@@ -39,15 +39,15 @@
DEFINE_int32(shmsize, 0, "(ignored)");
DEFINE_string(qemusocket, "/tmp/ivshmem_socket_qemu", "QEmu socket path");
DEFINE_string(clientsocket, "/tmp/ivshmem_socket_client", "Client socket path");
-DEFINE_string(cache_image, "", "Location of the cache partition image.");
-DEFINE_string(kernel_command_line, "",
- "Location of a text file with the kernel command line.");
-DEFINE_string(data_image, "", "Location of the data partition image.");
+
DEFINE_string(system_image_dir, StringFromEnv("HOME", "."),
"Location of the system partition images.");
-DEFINE_string(initrd, "/usr/share/cuttlefish-common/gce_ramdisk.img",
- "Location of cuttlefish initrd file.");
DEFINE_string(kernel, "", "Location of cuttlefish kernel file.");
+DEFINE_string(kernel_command_line, "",
+ "Location of a text file with the kernel command line.");
+DEFINE_string(initrd, "", "Location of cuttlefish initrd file.");
+DEFINE_string(data_image, "", "Location of the data partition image.");
+DEFINE_string(cache_image, "", "Location of the cache partition image.");
DEFINE_string(usbipsocket, "android_usbip", "Name of the USB/IP socket.");
@@ -151,14 +151,6 @@
// If user did not specify location of either of these files, expect them to
// be placed in --system_image_dir location.
- if (FLAGS_cache_image.empty()) {
- FLAGS_cache_image = FLAGS_system_image_dir + "/cache.img";
- }
-
- if (FLAGS_data_image.empty()) {
- FLAGS_data_image = FLAGS_system_image_dir + "/userdata.img";
- }
-
if (FLAGS_kernel.empty()) {
FLAGS_kernel = FLAGS_system_image_dir + "/kernel";
}
@@ -167,14 +159,24 @@
FLAGS_kernel_command_line = FLAGS_system_image_dir + "/cmdline";
}
+ if (FLAGS_initrd.empty()) {
+ FLAGS_initrd = FLAGS_system_image_dir + "/ramdisk.img";
+ }
+
+ if (FLAGS_cache_image.empty()) {
+ FLAGS_cache_image = FLAGS_system_image_dir + "/cache.img";
+ }
+
+ if (FLAGS_data_image.empty()) {
+ FLAGS_data_image = FLAGS_system_image_dir + "/userdata.img";
+ }
+
CHECK(virInitialize() == 0) << "Could not initialize libvirt.";
Json::Value json_root = LoadLayoutFile(FLAGS_layout);
// Each of these calls is free to fail and terminate launch if file does not
// exist or could not be created.
- auto ramdisk_partition = config::FilePartition::ReuseExistingFile(
- FLAGS_system_image_dir + "/ramdisk.img");
auto system_partition = config::FilePartition::ReuseExistingFile(
FLAGS_system_image_dir + "/system.img");
auto data_partition = config::FilePartition::ReuseExistingFile(
@@ -221,7 +223,6 @@
.SetKernelArgs(cmdline)
.SetIVShMemSocketPath(FLAGS_qemusocket)
.SetIVShMemVectorCount(json_root["vsoc_device_regions"].size())
- .SetRamdiskPartitionPath(ramdisk_partition->GetName())
.SetSystemPartitionPath(system_partition->GetName())
.SetCachePartitionPath(cache_partition->GetName())
.SetDataPartitionPath(data_partition->GetName())