package { default_applicable_licenses: ["Android-Apache-2.0"], } microdroid_filesystem_images = [ "microdroid_boot", "microdroid_bootconfig_app_debuggable", "microdroid_bootconfig_full_debuggable", "microdroid_bootconfig_normal", "microdroid_init_boot", "microdroid_super", "microdroid_uboot_env", "microdroid_vbmeta", "microdroid_vbmeta_bootconfig", "microdroid_vendor_boot", ] apex { name: "com.android.virt", // TODO(jiyong): make it updatable updatable: false, future_updatable: true, platform_apis: true, system_ext_specific: true, manifest: "manifest.json", key: "com.android.virt.key", certificate: ":com.android.virt.certificate", custom_sign_tool: "sign_virt_apex", // crosvm and virtualizationservice are only enabled for 64-bit targets on device arch: { arm64: { binaries: [ "crosvm", "virtualizationservice", ], filesystems: microdroid_filesystem_images, }, x86_64: { binaries: [ "crosvm", "virtualizationservice", ], filesystems: microdroid_filesystem_images, }, }, binaries: [ "fd_server", "vm", ], java_libs: [ "android.system.virtualmachine", ], jni_libs: [ "libvirtualmachine_jni", ], apps: [ "android.system.virtualmachine.res", ], prebuilts: [ "com.android.virt.init.rc", "microdroid_initrd_app_debuggable", "microdroid_initrd_full_debuggable", "microdroid_initrd_normal", "microdroid.json", "microdroid_bootloader", "microdroid_bootloader.avbpubkey", "microdroid_kernel", ], file_contexts: ":com.android.virt-file_contexts", canned_fs_config: "canned_fs_config", host_required: [ "vm_shell", ], } 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", } prebuilt_etc { name: "com.android.virt.init.rc", src: "virtualizationservice.rc", filename: "init.rc", installable: false, } // 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, }, }, required: [ "img2simg", "lpmake", "lpunpack", "simg2img", ], } 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", // 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", ":test.com.android.virt.pem", ], test_suites: ["general-tests"], } filegroup { name: "test.com.android.virt.pem", srcs: ["test.com.android.virt.pem"], } filegroup { name: "test2.com.android.virt.pem", srcs: ["test2.com.android.virt.pem"], } // custom tool to replace bytes in a file python_binary_host { name: "replace_bytes", srcs: [ "replace_bytes.py", ], version: { py3: { embedded_launcher: true, }, }, }