Commit Graph

9 Commits

Author SHA1 Message Date
Jiyong Park f6503cf4e3 Remove the unused 'b' slot
Although we can't opt-out A/B (because bootloader is built with
CONFIG_ANDROID_AB), but we can delete the unused 'b' slot as the update
of microdroid is not done by writing into the disk, but updating the
virt APEX that has the microdroid image.

Bug: N/A
Test: atest MicrodroidHostTestCases
Change-Id: Ie5871bf1b665e2cc564af54338043ae482ca01bb
2021-06-16 18:41:37 +09:00
Jiyong Park 25f1ddce8e misc.img is not needed
misc.img was needed by the uboot bootloader that microdroid is using.
The bootloader uses the partition to read the boot mode (normal,
recovery, and bootloader) that is set during the previous boot.

However, boot mode doesn't make sense for microdroid. So we delete it.

Unfortunately, deleting it is not trivial because uboot demands us to
anyway provide the location of the misc partition with the
`boot_android` command.

This change works around the restriction by letting the bootloader use
the first partition (which currently is the boot_a partition) as the
misc partition. We do that by giving only the disk number (0) and not
the partition name (as in 0#misc). Then uboot by default chooses the
first partition as the misc partition, and find that it is not a correct
misc partition. In that case, it falls back to the 'normal' boot which
we want.

Bug: 191131043
Test: atest MicrodroidHostTestCases
Change-Id: If2e49d1da9f75c805bc0d0f33e3f221b12dd220e
2021-06-16 17:23:47 +09:00
Jiyong Park ff3391e973 Enable verified boot for microdroid
Bug: 181923506
Test: atest MicrodroidHostTestCases
crosvm: U-Boot 2021.01-07985-g67ec634914 (Mar 25 2021 - 16:16:08 +0000)
crosvm:
crosvm: DRAM:  256 MiB
crosvm: Loading Environment from Raw Disk... OK
crosvm: Hit any key to stop autoboot:  0
crosvm: ## Android Verified Boot 2.0 version 1.1.0
crosvm: read_is_device_unlocked not supported yet
crosvm: read_rollback_index not supported yet
crosvm: read_rollback_index not supported yet
crosvm: read_rollback_index not supported yet
crosvm: read_is_device_unlocked not supported yet
crosvm: Verification passed successfully
crosvm: ANDROID: reboot reason: "(none)"

Change-Id: I6b0cca80d00351f6e0062541818971e761f1b67b
2021-04-14 16:48:27 +09:00
Jiyong Park 9ecac555ba Microdroid uses android boot image header V4
It's the latest one supporting the bootconfig. Also this change moves
the kernel commandline paramters from uboot-env.img to boot.img. The
former will eventually be removed.

Bug: 181936566
Test: boot microdroid on VIM3L
Change-Id: I5738f07e8b98fd0d61dbea047ebbd0ceb7258f31
2021-03-05 18:56:34 +09:00
Jiyong Park 3adec1f0ad Disable kmsg ratelimiting
... for better debuggability. Ideally this should be turned off for the
production builds.

Bug: 181936135
Test: start microdroid, watch the output.
Change-Id: Iebacf83b41af46918fdc1fd8de07ad6b3bd4abfa
2021-03-05 17:30:15 +09:00
Jiyong Park 1b13e0f69f Turn selinux off temporarily for microdroid
For some unknown reason, microdroid is experiencing selinux denials
although we provided the correct policy files. Until the cause is found
and fixed, let's disable selinux.

Bug: 181728474
Bug: 181747352
Test: boot microdroid
Change-Id: I466c0eb88d4b3ce6a2cca73252e15f53a401cab7
2021-03-04 00:12:58 +09:00
Jiyong Park d820bea707 Use devnum#partname format instead of the part number
The first and the second parameters of the `boot_android` command are
dev_iface and dev_part_str. The former selects the device interface like
`virtio` and the latter selects a specific partition. The format for the
latter is devnum#partname. ex) 0#misc. When the second parameter is not
given, u-boot falls back to read the environment variable `bootdevice`,
whose format is `devnum:partnum`.

For microdroid (and cuttlefish as well), we have been relying on the
fallback behavior. With this change, we stop doing that. The second
parameter is correctly set to "0#misc" and the variable `bootdevice`
is dropped.

Bug: 181635258
Test: microdroid boots

Change-Id: Ib572d0149765ee93d780837216e6a1c8eafaad03
2021-03-03 22:31:09 +09:00
Jiyong Park 3eb11f74cd Add fstab for microdroid & add more kernel commandline params
The vendor_boot.img now has fstab file in it. It currently mounts the
system.img to /system, but eventually we will use the dynamic partitions
in super.img.

A few more essential kernel commandline params are added. Eventually,
these androidboot.* parameters will be given via /proc/bootconfig.

Bug: 178562528
Test: build microdroid-* modules. push microdroid-boot-5.10.img as
boot.img, microdroid-vendor-boot-5.10.img as vendor_boot.img,
micrdroid.img as super.img.
Run assemble_cvd on the device.
Push microdroid-uboot_env.img as uboot_env.img
Run crosvm with the generated composite image. VM goes through the
bootloader, kernel, first stage init, and then second stage init.

Change-Id: Id1ce4f33f912bb80cd280060ecd9cabe57675660
2021-02-24 15:30:12 +09:00
Jiyong Park f677cfab84 Build uboot_env.img statically
The environment partition can control the behavior of the bootloader.
Therefore it shouldn't be dynamically created on the device.

Bug: 180675126
Test: m microdroid_uboot_env
Change-Id: If49634293f2fe7fbb82fae243632480fc7d72d30
2021-02-22 07:57:14 +00:00