2021-02-04 02:36:27 +00:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
}
|
|
|
|
|
2021-11-11 21:28:09 +00:00
|
|
|
microdroid_filesystem_images = [
|
2022-06-13 07:44:45 +00:00
|
|
|
"microdroid_boot",
|
2022-06-13 13:47:59 +00:00
|
|
|
"microdroid_bootconfig_app_debuggable",
|
|
|
|
"microdroid_bootconfig_full_debuggable",
|
|
|
|
"microdroid_bootconfig_normal",
|
2022-01-10 18:51:12 +00:00
|
|
|
"microdroid_init_boot",
|
2022-06-13 13:47:59 +00:00
|
|
|
"microdroid_super",
|
|
|
|
"microdroid_uboot_env",
|
2021-11-11 21:28:09 +00:00
|
|
|
"microdroid_vbmeta",
|
|
|
|
"microdroid_vbmeta_bootconfig",
|
2022-06-13 13:47:59 +00:00
|
|
|
"microdroid_vendor_boot",
|
2021-11-11 21:28:09 +00:00
|
|
|
]
|
|
|
|
|
2022-10-24 16:16:25 +00:00
|
|
|
soong_config_module_type {
|
|
|
|
name: "virt_apex",
|
|
|
|
module_type: "apex",
|
|
|
|
config_namespace: "ANDROID",
|
|
|
|
bool_variables: ["avf_enabled"],
|
|
|
|
properties: ["defaults"],
|
|
|
|
}
|
|
|
|
|
|
|
|
virt_apex {
|
2020-12-07 06:58:23 +00:00
|
|
|
name: "com.android.virt",
|
2022-10-24 16:16:25 +00:00
|
|
|
soong_config_variables: {
|
|
|
|
avf_enabled: {
|
|
|
|
defaults: ["com.android.virt_avf_enabled"],
|
|
|
|
conditions_default: {
|
|
|
|
defaults: ["com.android.virt_avf_disabled"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2020-12-07 06:58:23 +00:00
|
|
|
|
2022-10-24 16:16:25 +00:00
|
|
|
apex_defaults {
|
|
|
|
name: "com.android.virt_common",
|
2020-12-07 06:58:23 +00:00
|
|
|
// TODO(jiyong): make it updatable
|
2021-02-16 14:43:40 +00:00
|
|
|
updatable: false,
|
2021-11-29 02:29:16 +00:00
|
|
|
future_updatable: true,
|
2021-06-22 11:24:56 +00:00
|
|
|
platform_apis: true,
|
2020-12-07 06:58:23 +00:00
|
|
|
|
|
|
|
manifest: "manifest.json",
|
|
|
|
|
|
|
|
key: "com.android.virt.key",
|
|
|
|
certificate: ":com.android.virt.certificate",
|
2022-10-24 16:16:25 +00:00
|
|
|
|
|
|
|
apps: [
|
|
|
|
"android.system.virtualmachine.res",
|
|
|
|
],
|
|
|
|
|
|
|
|
file_contexts: ":com.android.virt-file_contexts",
|
|
|
|
canned_fs_config: "canned_fs_config",
|
|
|
|
}
|
|
|
|
|
|
|
|
apex_defaults {
|
|
|
|
name: "com.android.virt_avf_enabled",
|
|
|
|
|
|
|
|
defaults: ["com.android.virt_common"],
|
|
|
|
|
2021-10-26 16:50:51 +00:00
|
|
|
custom_sign_tool: "sign_virt_apex",
|
2020-12-07 06:58:23 +00:00
|
|
|
|
2021-06-10 13:59:56 +00:00
|
|
|
// crosvm and virtualizationservice are only enabled for 64-bit targets on device
|
2020-12-07 06:58:47 +00:00
|
|
|
arch: {
|
|
|
|
arm64: {
|
|
|
|
binaries: [
|
2021-01-05 14:14:46 +00:00
|
|
|
"crosvm",
|
2021-06-10 13:59:56 +00:00
|
|
|
"virtualizationservice",
|
2021-01-05 14:14:46 +00:00
|
|
|
],
|
2021-11-11 21:28:09 +00:00
|
|
|
filesystems: microdroid_filesystem_images,
|
2021-01-05 14:14:46 +00:00
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
binaries: [
|
2020-12-07 06:58:47 +00:00
|
|
|
"crosvm",
|
2021-06-10 13:59:56 +00:00
|
|
|
"virtualizationservice",
|
2020-12-07 06:58:47 +00:00
|
|
|
],
|
2021-11-11 21:28:09 +00:00
|
|
|
filesystems: microdroid_filesystem_images,
|
2020-12-07 06:58:47 +00:00
|
|
|
},
|
|
|
|
},
|
2021-02-16 04:23:00 +00:00
|
|
|
binaries: [
|
2021-03-11 22:19:18 +00:00
|
|
|
"fd_server",
|
2021-03-04 16:11:12 +00:00
|
|
|
"vm",
|
2021-02-16 04:23:00 +00:00
|
|
|
],
|
2021-06-28 09:37:26 +00:00
|
|
|
java_libs: [
|
|
|
|
"android.system.virtualmachine",
|
|
|
|
],
|
2021-08-31 01:00:42 +00:00
|
|
|
jni_libs: [
|
|
|
|
"libvirtualmachine_jni",
|
|
|
|
],
|
2021-04-12 05:48:42 +00:00
|
|
|
prebuilts: [
|
|
|
|
"com.android.virt.init.rc",
|
2022-10-13 19:28:54 +00:00
|
|
|
"features_com.android.virt.xml",
|
2022-08-22 14:11:14 +00:00
|
|
|
"microdroid_initrd_app_debuggable",
|
|
|
|
"microdroid_initrd_full_debuggable",
|
|
|
|
"microdroid_initrd_normal",
|
2021-06-21 05:39:12 +00:00
|
|
|
"microdroid.json",
|
2021-04-12 05:48:42 +00:00
|
|
|
"microdroid_bootloader",
|
2021-10-26 18:35:42 +00:00
|
|
|
"microdroid_bootloader.avbpubkey",
|
2022-09-28 12:52:16 +00:00
|
|
|
"microdroid_kernel",
|
2021-04-12 05:48:42 +00:00
|
|
|
],
|
2022-08-29 08:27:00 +00:00
|
|
|
host_required: [
|
|
|
|
"vm_shell",
|
|
|
|
],
|
2020-12-07 06:58:23 +00:00
|
|
|
}
|
|
|
|
|
2022-10-24 16:16:25 +00:00
|
|
|
apex_defaults {
|
|
|
|
name: "com.android.virt_avf_disabled",
|
|
|
|
|
|
|
|
defaults: ["com.android.virt_common"],
|
|
|
|
}
|
|
|
|
|
2020-12-07 06:58:23 +00:00
|
|
|
apex_key {
|
|
|
|
name: "com.android.virt.key",
|
|
|
|
public_key: "com.android.virt.avbpubkey",
|
|
|
|
private_key: "com.android.virt.pem",
|
|
|
|
}
|
|
|
|
|
|
|
|
android_app_certificate {
|
|
|
|
name: "com.android.virt.certificate",
|
|
|
|
certificate: "com.android.virt",
|
|
|
|
}
|
2021-03-25 21:18:53 +00:00
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "com.android.virt.init.rc",
|
2021-05-21 12:41:13 +00:00
|
|
|
src: "virtualizationservice.rc",
|
2021-03-25 21:18:53 +00:00
|
|
|
filename: "init.rc",
|
2021-09-08 10:51:06 +00:00
|
|
|
installable: false,
|
2021-03-25 21:18:53 +00:00
|
|
|
}
|
2021-10-26 06:54:50 +00:00
|
|
|
|
|
|
|
// Virt apex needs a custom signer for its payload
|
|
|
|
python_binary_host {
|
|
|
|
name: "sign_virt_apex",
|
|
|
|
srcs: [
|
|
|
|
"sign_virt_apex.py",
|
|
|
|
],
|
|
|
|
version: {
|
|
|
|
py3: {
|
|
|
|
embedded_launcher: true,
|
|
|
|
},
|
|
|
|
},
|
2021-10-26 16:50:51 +00:00
|
|
|
required: [
|
|
|
|
"img2simg",
|
|
|
|
"lpmake",
|
|
|
|
"lpunpack",
|
|
|
|
"simg2img",
|
|
|
|
],
|
2021-10-26 06:54:50 +00:00
|
|
|
}
|
2021-11-08 08:53:47 +00:00
|
|
|
|
2021-11-08 08:50:22 +00:00
|
|
|
sh_test_host {
|
|
|
|
name: "sign_virt_apex_test",
|
|
|
|
src: "sign_virt_apex_test.sh",
|
|
|
|
test_config: "sign_virt_apex_test.xml",
|
|
|
|
data_bins: [
|
|
|
|
// deapexer
|
|
|
|
"deapexer",
|
|
|
|
"debugfs_static",
|
2022-11-08 14:26:13 +00:00
|
|
|
"blkid",
|
|
|
|
"fsck.erofs",
|
2021-11-08 08:50:22 +00:00
|
|
|
|
|
|
|
// sign_virt_apex
|
|
|
|
"avbtool",
|
|
|
|
"img2simg",
|
|
|
|
"lpmake",
|
|
|
|
"lpunpack",
|
|
|
|
"sign_virt_apex",
|
|
|
|
"simg2img",
|
|
|
|
],
|
|
|
|
data_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libc++",
|
|
|
|
"libcrypto_utils",
|
|
|
|
"libcrypto",
|
|
|
|
"libext4_utils",
|
|
|
|
"liblog",
|
|
|
|
"liblp",
|
|
|
|
"libsparse",
|
|
|
|
"libz",
|
|
|
|
],
|
|
|
|
data: [
|
|
|
|
":com.android.virt",
|
2022-02-21 20:22:23 +00:00
|
|
|
":test.com.android.virt.pem",
|
2021-11-08 08:50:22 +00:00
|
|
|
],
|
|
|
|
test_suites: ["general-tests"],
|
|
|
|
}
|
|
|
|
|
2022-02-21 20:22:23 +00:00
|
|
|
filegroup {
|
|
|
|
name: "test.com.android.virt.pem",
|
|
|
|
srcs: ["test.com.android.virt.pem"],
|
|
|
|
}
|
|
|
|
|
2022-02-23 17:35:59 +00:00
|
|
|
filegroup {
|
|
|
|
name: "test2.com.android.virt.pem",
|
|
|
|
srcs: ["test2.com.android.virt.pem"],
|
|
|
|
}
|
|
|
|
|
2021-11-08 08:53:47 +00:00
|
|
|
// custom tool to replace bytes in a file
|
|
|
|
python_binary_host {
|
|
|
|
name: "replace_bytes",
|
|
|
|
srcs: [
|
|
|
|
"replace_bytes.py",
|
|
|
|
],
|
|
|
|
version: {
|
|
|
|
py3: {
|
|
|
|
embedded_launcher: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|