Merge "Revert "Revert "Move ramdisk to the new init_boot partition"""

This commit is contained in:
Devin Moore 2022-01-10 21:59:53 +00:00 committed by Gerrit Code Review
commit 68aed418f9
4 changed files with 22 additions and 4 deletions

View File

@ -5,6 +5,7 @@ package {
microdroid_filesystem_images = [
"microdroid_super",
"microdroid_boot-5.10",
"microdroid_init_boot",
"microdroid_vendor_boot-5.10",
"microdroid_vbmeta",
"microdroid_vbmeta_bootconfig",

View File

@ -282,6 +282,8 @@ def SignVirtApex(args):
boot_img = os.path.join(input_dir, 'etc', 'fs', 'microdroid_boot-5.10.img')
vendor_boot_img = os.path.join(
input_dir, 'etc', 'fs', 'microdroid_vendor_boot-5.10.img')
init_boot_img = os.path.join(
input_dir, 'etc', 'fs', 'microdroid_init_boot.img')
super_img = os.path.join(input_dir, 'etc', 'fs', 'microdroid_super.img')
vbmeta_img = os.path.join(input_dir, 'etc', 'fs', 'microdroid_vbmeta.img')
vbmeta_bootconfig_img = os.path.join(
@ -297,10 +299,11 @@ def SignVirtApex(args):
# while it's okay to use different keys for other image files.
ReplaceBootloaderPubkey(args, key, bootloader, bootloader_pubkey)
# re-sign bootloader, boot.img, vendor_boot.img
# re-sign bootloader, boot.img, vendor_boot.img, and init_boot.img
AddHashFooter(args, key, bootloader)
AddHashFooter(args, key, boot_img)
AddHashFooter(args, key, vendor_boot_img)
AddHashFooter(args, key, init_boot_img)
# re-sign super.img
with TempDirectory() as work_dir:
@ -320,12 +323,12 @@ def SignVirtApex(args):
# re-pack super.img
MakeSuperImage(args, partitions, super_img)
# re-generate vbmeta from re-signed {boot, vendor_boot, system_a, vendor_a}.img
# re-generate vbmeta from re-signed {boot, vendor_boot, init_boot, system_a, vendor_a}.img
# Ideally, making VBmeta should be done out of TempDirectory block. But doing it here
# to avoid unpacking re-signed super.img for system/vendor images which are available
# in this block.
MakeVbmetaImage(args, key, vbmeta_img, images=[
boot_img, vendor_boot_img, system_a_img, vendor_a_img])
boot_img, vendor_boot_img, init_boot_img, system_a_img, vendor_a_img])
# Re-sign bootconfigs with the same key
bootconfig_sign_key = key

View File

@ -221,7 +221,6 @@ microdroid_boot_cmdline = [
bootimg {
name: "microdroid_boot-5.10",
ramdisk_module: "microdroid_ramdisk-5.10",
// We don't have kernel for arm and x86. But Soong demands one when it builds for
// arm or x86 target. Satisfy that by providing an empty file as the kernel.
kernel_prebuilt: "empty_kernel",
@ -251,6 +250,16 @@ bootimg {
avb_private_key: ":microdroid_sign_key",
}
bootimg {
name: "microdroid_init_boot",
ramdisk_module: "microdroid_ramdisk-5.10",
kernel_prebuilt: "empty_kernel",
header_version: "4",
partition_name: "init_boot",
use_avb: true,
avb_private_key: ":microdroid_sign_key",
}
android_filesystem {
name: "microdroid_ramdisk-5.10",
deps: [
@ -551,6 +560,7 @@ vbmeta {
"microdroid_vendor_boot-5.10",
"microdroid",
"microdroid_boot-5.10",
"microdroid_init_boot",
],
}

View File

@ -7,6 +7,10 @@
"label": "boot_a",
"path": "/apex/com.android.virt/etc/fs/microdroid_boot-5.10.img"
},
{
"label": "init_boot_a",
"path": "/apex/com.android.virt/etc/fs/microdroid_init_boot.img"
},
{
"label": "vendor_boot_a",
"path": "/apex/com.android.virt/etc/fs/microdroid_vendor_boot-5.10.img"