2021-02-04 02:36:27 +00:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
}
|
|
|
|
|
2021-02-17 06:51:56 +00:00
|
|
|
microdroid_shell_and_utilities = [
|
|
|
|
"reboot",
|
|
|
|
"sh",
|
|
|
|
"toolbox",
|
|
|
|
"toybox",
|
|
|
|
]
|
|
|
|
|
2021-02-09 12:23:36 +00:00
|
|
|
microdroid_rootdirs = [
|
|
|
|
"dev",
|
|
|
|
"proc",
|
|
|
|
"sys",
|
|
|
|
|
|
|
|
"system",
|
|
|
|
"vendor",
|
|
|
|
"debug_ramdisk",
|
|
|
|
"mnt",
|
|
|
|
|
|
|
|
"apex",
|
|
|
|
"linkerconfig",
|
|
|
|
"second_stage_resources",
|
|
|
|
"postinstall",
|
|
|
|
]
|
|
|
|
|
|
|
|
microdroid_symlinks = [
|
|
|
|
{
|
|
|
|
target: "/sys/kernel/debug",
|
|
|
|
name: "d",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2021-01-25 10:12:47 +00:00
|
|
|
android_filesystem {
|
|
|
|
name: "microdroid",
|
|
|
|
use_avb: true,
|
2021-03-29 06:19:27 +00:00
|
|
|
avb_private_key: ":avb_testkey_rsa4096",
|
2021-01-25 10:12:47 +00:00
|
|
|
avb_algorithm: "SHA256_RSA4096",
|
2021-03-15 14:25:46 +00:00
|
|
|
partition_name: "system",
|
2021-01-25 10:12:47 +00:00
|
|
|
deps: [
|
|
|
|
"init_second_stage",
|
2021-02-17 06:51:56 +00:00
|
|
|
"microdroid_init_rc",
|
2021-03-03 11:27:38 +00:00
|
|
|
"ueventd.rc",
|
2021-02-17 06:51:56 +00:00
|
|
|
"libbinder",
|
|
|
|
"libstdc++",
|
|
|
|
"logcat",
|
|
|
|
"logd",
|
|
|
|
"run-as",
|
|
|
|
"secilc",
|
|
|
|
"adbd",
|
|
|
|
"apexd",
|
|
|
|
"debuggerd",
|
|
|
|
"linker",
|
2021-02-25 08:38:32 +00:00
|
|
|
"linkerconfig",
|
2021-02-17 06:51:56 +00:00
|
|
|
"servicemanager",
|
|
|
|
"tombstoned",
|
|
|
|
"cgroups.json",
|
2021-02-18 10:12:06 +00:00
|
|
|
|
2021-03-25 06:43:07 +00:00
|
|
|
"plat_sepolicy_and_mapping.sha256",
|
2021-02-17 06:51:56 +00:00
|
|
|
] + microdroid_shell_and_utilities,
|
|
|
|
multilib: {
|
|
|
|
common: {
|
|
|
|
deps: [
|
|
|
|
"com.android.runtime",
|
2021-03-22 02:32:38 +00:00
|
|
|
"plat_sepolicy.cil",
|
2021-03-25 06:43:07 +00:00
|
|
|
"plat_mapping_file",
|
2021-02-18 10:12:06 +00:00
|
|
|
"plat_file_contexts",
|
|
|
|
"plat_hwservice_contexts",
|
|
|
|
"plat_property_contexts",
|
|
|
|
"plat_service_contexts",
|
|
|
|
"plat_keystore2_key_contexts",
|
2021-02-17 06:51:56 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2021-02-15 08:04:39 +00:00
|
|
|
base_dir: "system",
|
2021-02-09 12:23:36 +00:00
|
|
|
dirs: microdroid_rootdirs,
|
|
|
|
symlinks: microdroid_symlinks,
|
2021-02-03 05:50:28 +00:00
|
|
|
file_contexts: "microdroid_file_contexts",
|
2021-01-25 10:12:47 +00:00
|
|
|
}
|
2021-02-03 23:54:31 +00:00
|
|
|
|
2021-02-17 06:51:56 +00:00
|
|
|
prebuilt_etc {
|
|
|
|
name: "microdroid_init_rc",
|
|
|
|
filename: "init.rc",
|
|
|
|
src: "init.rc",
|
|
|
|
relative_install_path: "init/hw",
|
|
|
|
installable: false, // avoid collision with system partition's init.rc
|
|
|
|
}
|
|
|
|
|
2021-03-03 14:56:18 +00:00
|
|
|
android_filesystem {
|
|
|
|
name: "microdroid_vendor",
|
|
|
|
use_avb: true,
|
|
|
|
deps: [
|
|
|
|
"microdroid_plat_sepolicy_vers.txt",
|
2021-03-11 08:51:22 +00:00
|
|
|
"microdroid_precompiled_sepolicy",
|
|
|
|
"microdroid_precompiled_sepolicy.plat_sepolicy_and_mapping.sha256",
|
2021-03-03 14:56:18 +00:00
|
|
|
],
|
2021-03-25 06:43:07 +00:00
|
|
|
multilib: {
|
|
|
|
common: {
|
|
|
|
deps: [
|
|
|
|
"microdroid_vendor_sepolicy.cil",
|
|
|
|
"microdroid_plat_pub_versioned.cil",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2021-03-29 06:19:27 +00:00
|
|
|
avb_private_key: ":avb_testkey_rsa4096",
|
2021-03-03 14:56:18 +00:00
|
|
|
avb_algorithm: "SHA256_RSA4096",
|
|
|
|
file_contexts: "microdroid_vendor_file_contexts",
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "microdroid_plat_sepolicy_vers.txt",
|
|
|
|
src: "plat_sepolicy_vers.txt",
|
|
|
|
filename: "plat_sepolicy_vers.txt",
|
|
|
|
sub_dir: "selinux",
|
|
|
|
installable: false,
|
|
|
|
}
|
|
|
|
|
2021-02-23 16:39:51 +00:00
|
|
|
logical_partition {
|
|
|
|
name: "microdroid_super",
|
|
|
|
sparse: true,
|
2021-03-31 07:31:27 +00:00
|
|
|
size: "auto",
|
2021-03-30 07:57:27 +00:00
|
|
|
default_group: [
|
2021-02-23 16:39:51 +00:00
|
|
|
{
|
2021-03-30 07:57:27 +00:00
|
|
|
name: "system",
|
|
|
|
filesystem: ":microdroid",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "vendor",
|
|
|
|
filesystem: ":microdroid_vendor",
|
2021-02-23 16:39:51 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2021-02-03 23:54:31 +00:00
|
|
|
bootimg {
|
2021-02-18 14:15:41 +00:00
|
|
|
name: "microdroid_boot-5.10",
|
2021-02-03 23:54:31 +00:00
|
|
|
ramdisk_module: "microdroid_ramdisk-5.10",
|
2021-03-09 11:32:15 +00:00
|
|
|
// 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",
|
2021-02-18 14:15:41 +00:00
|
|
|
arch: {
|
|
|
|
arm64: {
|
|
|
|
kernel_prebuilt: ":kernel_prebuilts-5.10-arm64",
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
kernel_prebuilt: ":kernel_prebuilts-5.10-x86_64",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// TODO(jiyong): change the name to init, cause it's confusing
|
2021-03-05 09:51:35 +00:00
|
|
|
cmdline: "rdinit=/bin/init_vendor " +
|
|
|
|
"panic=-1 " +
|
|
|
|
// TODO(b/181936135) make the ratelimiting conditional; ratelimiting on prod build
|
|
|
|
"printk.devkmsg=on " +
|
|
|
|
"androidboot.first_stage_console=1 " +
|
|
|
|
"androidboot.hardware=microdroid " +
|
2021-03-11 04:04:41 +00:00
|
|
|
"androidboot.boot_devices=10000.pci ",
|
2021-02-18 14:15:41 +00:00
|
|
|
dtb_prebuilt: "dummy_dtb.img",
|
2021-03-05 09:51:35 +00:00
|
|
|
header_version: "4",
|
2021-02-18 14:15:41 +00:00
|
|
|
partition_name: "boot",
|
2021-03-15 14:25:46 +00:00
|
|
|
use_avb: true,
|
2021-03-29 06:19:27 +00:00
|
|
|
avb_private_key: ":avb_testkey_rsa4096",
|
2021-02-18 14:15:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
android_filesystem {
|
|
|
|
name: "microdroid_ramdisk-5.10",
|
|
|
|
deps: [
|
|
|
|
"init_first_stage_soong",
|
|
|
|
],
|
|
|
|
dirs: [
|
|
|
|
"dev",
|
|
|
|
"proc",
|
|
|
|
"sys",
|
|
|
|
|
|
|
|
// TODO(jiyong): remove these
|
|
|
|
"mnt",
|
|
|
|
"debug_ramdisk",
|
|
|
|
"second_stage_resources",
|
|
|
|
],
|
|
|
|
type: "compressed_cpio",
|
|
|
|
}
|
|
|
|
|
|
|
|
bootimg {
|
|
|
|
name: "microdroid_vendor_boot-5.10",
|
|
|
|
ramdisk_module: "microdroid_vendor_ramdisk-5.10",
|
2021-02-03 23:54:31 +00:00
|
|
|
dtb_prebuilt: "dummy_dtb.img",
|
2021-03-05 09:51:35 +00:00
|
|
|
header_version: "4",
|
2021-02-03 23:54:31 +00:00
|
|
|
vendor_boot: true,
|
|
|
|
partition_name: "vendor_boot",
|
2021-03-15 14:25:46 +00:00
|
|
|
use_avb: true,
|
2021-03-29 06:19:27 +00:00
|
|
|
avb_private_key: ":avb_testkey_rsa4096",
|
2021-02-03 23:54:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
android_filesystem {
|
2021-02-18 14:15:41 +00:00
|
|
|
name: "microdroid_vendor_ramdisk-5.10",
|
2021-02-03 23:54:31 +00:00
|
|
|
arch: {
|
|
|
|
arm64: {
|
|
|
|
deps: ["virt_device_prebuilts_kernel_modules-5.10-arm64"],
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
deps: ["virt_device_prebuilts_kernel_modules-5.10-x86_64"],
|
|
|
|
},
|
|
|
|
},
|
2021-02-23 03:53:30 +00:00
|
|
|
deps: [
|
|
|
|
"microdroid_fstab",
|
|
|
|
],
|
|
|
|
base_dir: "first_stage_ramdisk",
|
2021-02-03 23:54:31 +00:00
|
|
|
type: "compressed_cpio",
|
2021-02-23 03:53:30 +00:00
|
|
|
symlinks: [
|
|
|
|
{
|
|
|
|
target: "etc/fstab",
|
|
|
|
name: "first_stage_ramdisk/fstab.microdroid",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
target: "first_stage_ramdisk/lib",
|
|
|
|
name: "lib",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "microdroid_fstab",
|
|
|
|
src: "fstab",
|
|
|
|
filename: "fstab",
|
|
|
|
installable: false,
|
2021-02-03 23:54:31 +00:00
|
|
|
}
|
2021-02-19 06:44:52 +00:00
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "microdroid_uboot_env",
|
|
|
|
src: ":microdroid_uboot_env_gen",
|
|
|
|
filename: "uboot_env.img",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "microdroid_uboot_env_gen",
|
|
|
|
tools: ["mkenvimage_host"],
|
|
|
|
srcs: ["uboot-env.txt"],
|
|
|
|
out: ["output.img"],
|
|
|
|
cmd: "$(location mkenvimage_host) -s 4096 -o $(out) $(in)",
|
|
|
|
}
|
2021-03-11 08:51:22 +00:00
|
|
|
|
2021-03-25 06:43:07 +00:00
|
|
|
// sepolicy sha256 for vendor
|
2021-03-11 08:51:22 +00:00
|
|
|
prebuilt_etc {
|
|
|
|
name: "microdroid_precompiled_sepolicy.plat_sepolicy_and_mapping.sha256",
|
2021-03-25 06:43:07 +00:00
|
|
|
src: ":plat_sepolicy_and_mapping.sha256_gen",
|
2021-03-11 08:51:22 +00:00
|
|
|
filename: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256",
|
|
|
|
relative_install_path: "selinux",
|
|
|
|
installable: false,
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "microdroid_precompiled_sepolicy_gen",
|
|
|
|
tools: ["secilc"],
|
|
|
|
srcs: [
|
2021-03-22 02:32:38 +00:00
|
|
|
":plat_sepolicy.cil",
|
2021-03-25 06:43:07 +00:00
|
|
|
":plat_mapping_file",
|
2021-03-11 08:51:22 +00:00
|
|
|
":microdroid_plat_pub_versioned.cil",
|
|
|
|
":microdroid_vendor_sepolicy.cil",
|
|
|
|
],
|
|
|
|
out: ["precompiled_sepolicy"],
|
|
|
|
cmd: "$(location secilc) -m -M true -G -c 30 $(in) -o $(out) -f /dev/null",
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "microdroid_precompiled_sepolicy",
|
|
|
|
src: ":microdroid_precompiled_sepolicy_gen",
|
|
|
|
filename: "precompiled_sepolicy",
|
|
|
|
relative_install_path: "selinux",
|
|
|
|
installable: false,
|
|
|
|
}
|
2021-03-15 14:30:11 +00:00
|
|
|
|
|
|
|
vbmeta {
|
|
|
|
name: "microdroid_vbmeta",
|
|
|
|
partition_name: "vbmeta",
|
2021-03-29 06:19:27 +00:00
|
|
|
private_key: ":avb_testkey_rsa4096",
|
2021-03-15 14:30:11 +00:00
|
|
|
partitions: [
|
|
|
|
"microdroid_vendor",
|
|
|
|
"microdroid_vendor_boot-5.10",
|
|
|
|
],
|
|
|
|
chained_partitions: [
|
|
|
|
{
|
|
|
|
name: "vbmeta_system",
|
|
|
|
rollback_index_location: 1,
|
2021-03-29 06:19:27 +00:00
|
|
|
private_key: ":avb_testkey_rsa4096",
|
2021-03-15 14:30:11 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "boot",
|
|
|
|
rollback_index_location: 2,
|
2021-03-29 06:19:27 +00:00
|
|
|
private_key: ":avb_testkey_rsa4096",
|
2021-03-15 14:30:11 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
vbmeta {
|
|
|
|
name: "microdroid_vbmeta_system",
|
|
|
|
partition_name: "vbmeta_system",
|
2021-03-29 06:19:27 +00:00
|
|
|
private_key: ":avb_testkey_rsa4096",
|
2021-03-15 14:30:11 +00:00
|
|
|
partitions: [
|
|
|
|
"microdroid",
|
|
|
|
],
|
|
|
|
}
|
2021-04-05 02:20:10 +00:00
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "microdroid_cdisk.json",
|
|
|
|
src: "microdroid_cdisk.json",
|
|
|
|
}
|