Move uboot_env.img to a new composite disk
u-boot is updated to look for the environment partition in the second
disk.
Bug: 183006588
Test: atest MicrodroidHostTestCases
Change-Id: I2e716bb85d4762f700ea7479c68ffbcfd150857c
diff --git a/microdroid/Android.bp b/microdroid/Android.bp
index 8456591..150f119 100644
--- a/microdroid/Android.bp
+++ b/microdroid/Android.bp
@@ -338,3 +338,8 @@
name: "microdroid_cdisk.json",
src: "microdroid_cdisk.json",
}
+
+prebuilt_etc {
+ name: "microdroid_cdisk_env.json",
+ src: "microdroid_cdisk_env.json",
+}
diff --git a/microdroid/README.md b/microdroid/README.md
index db9ed1a..a4bfb6e 100644
--- a/microdroid/README.md
+++ b/microdroid/README.md
@@ -35,7 +35,8 @@
$ adb shell 'cp /apex/com.android.virt/etc/uboot_env.img /data/local/tmp'
$ adb shell 'dd if=/dev/zero of=/data/local/tmp/misc.img bs=4k count=256'
$ adb shell 'cd /data/local/tmp; /apex/com.android.virt/bin/mk_cdisk /apex/com.android.virt/etc/microdroid_cdisk.json os_composite.img'
-$ adb shell 'cd /data/local/tmp; /apex/com.android.virt/bin/crosvm run --cid=5 --disable-sandbox --bios=bootloader --serial=type=stdout --disk=os_composite.img'
+$ adb shell 'cd /data/local/tmp; /apex/com.android.virt/bin/mk_cdisk /apex/com.android.virt/etc/microdroid_cdisk_env.json env_composite.img'
+$ adb shell 'cd /data/local/tmp; /apex/com.android.virt/bin/crosvm run --cid=5 --disable-sandbox --bios=bootloader --serial=type=stdout --disk=os_composite.img --disk=env_composite.img'
```
The CID in `--cid` parameter can be anything greater than 2 (`VMADDR_CID_HOST`).
diff --git a/microdroid/microdroid_cdisk.json b/microdroid/microdroid_cdisk.json
index 88b7183..591e83b 100644
--- a/microdroid/microdroid_cdisk.json
+++ b/microdroid/microdroid_cdisk.json
@@ -1,11 +1,6 @@
{
"partitions": [
{
- "label": "uboot_env",
- "path": "uboot_env.img",
- "read_only": true
- },
- {
"label": "misc",
"path": "misc.img",
"read_only": true
diff --git a/microdroid/microdroid_cdisk_env.json b/microdroid/microdroid_cdisk_env.json
new file mode 100644
index 0000000..f43c4b1
--- /dev/null
+++ b/microdroid/microdroid_cdisk_env.json
@@ -0,0 +1,9 @@
+{
+ "partitions": [
+ {
+ "label": "uboot_env",
+ "path": "uboot_env.img",
+ "read_only": true
+ }
+ ]
+}