Support composite images with QEMU.

QEMU equivalent to the crosvm support for this feature. Note that the
QEMU configuration places the disks on a different PCI id.

Bug: 133432409
Test: run_cvd -vm_manager=qemu_cli -composite_disk=composite.img
Change-Id: I531d6ac1181103f723c43c422d7c40505ca39af7
diff --git a/host_package.mk b/host_package.mk
index fc33c14..4bb2678 100644
--- a/host_package.mk
+++ b/host_package.mk
@@ -86,6 +86,7 @@
 
 cvd_host_configs := \
     system-root.dtb \
+    composite-system-root.dtb \
     initrd-root.dtb \
     gsi.fstab \
     composite-gsi.fstab \
diff --git a/shared/config/Android.mk b/shared/config/Android.mk
index 877f572..0bd4af8 100644
--- a/shared/config/Android.mk
+++ b/shared/config/Android.mk
@@ -62,6 +62,16 @@
 
 include $(CLEAR_VARS)
 
+LOCAL_MODULE := composite_system_root_dtb
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(HOST_OUT)/config
+LOCAL_MODULE_STEM := composite-system-root.dtb
+LOCAL_SRC_FILES := composite-system-root.dtb
+
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+
 LOCAL_MODULE := gsi_fstab
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_PATH := $(HOST_OUT)/config
diff --git a/shared/config/composite-system-root.dtb b/shared/config/composite-system-root.dtb
new file mode 100644
index 0000000..18abd9f
--- /dev/null
+++ b/shared/config/composite-system-root.dtb
Binary files differ
diff --git a/shared/config/composite-system-root.dts b/shared/config/composite-system-root.dts
new file mode 100644
index 0000000..4379277
--- /dev/null
+++ b/shared/config/composite-system-root.dts
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/dts-v1/;
+
+/ {
+	firmware {
+		android {
+			compatible = "android,firmware";
+			fstab {
+				compatible = "android,fstab";
+				vendor {
+					compatible = "android,vendor";
+					dev = "/dev/block/by-name/vendor";
+					type = "ext4";
+					mnt_flags = "noatime,ro,errors=panic";
+					fsmgr_flags = "wait";
+				};
+
+				product {
+					compatible = "android,product";
+					dev = "/dev/block/by-name/product";
+					type = "ext4";
+					mnt_flags = "noatime,ro,errors=panic";
+					fsmgr_flags = "wait";
+				};
+			};
+		};
+	};
+};