package { default_applicable_licenses: ["Android-Apache-2.0"], } microdroid_shell_and_utilities = [ "reboot", "sh", "toolbox", "toybox", ] microdroid_rootdirs = [ "dev", "proc", "sys", // TODO(b/180267599): clean up unnecessary partition mount points "system", "system_ext", "vendor", "vendor_dlkm", "product", "odm", "odm_dlkm", "debug_ramdisk", "mnt", "apex", "linkerconfig", "second_stage_resources", "postinstall", ] microdroid_symlinks = [ { target: "/sys/kernel/debug", name: "d", }, ] android_filesystem { name: "microdroid", use_avb: true, avb_private_key: "microdroid.pem", avb_algorithm: "SHA256_RSA4096", deps: [ "init_second_stage", "microdroid_init_rc", "ueventd.rc", "libbinder", "libstdc++", "logcat", "logd", "run-as", "secilc", "adbd", "apexd", "debuggerd", "linker", "linkerconfig", "servicemanager", "tombstoned", "cgroups.json", // These two files are temporary and only for test. // TODO(b/178993690): migrate cil files to Soong "microdroid_plat_sepolicy.cil", "microdroid_plat_mapping_file", ] + microdroid_shell_and_utilities, multilib: { common: { deps: [ "com.android.runtime", "plat_file_contexts", "plat_hwservice_contexts", "plat_property_contexts", "plat_service_contexts", "plat_keystore2_key_contexts", ], }, }, base_dir: "system", dirs: microdroid_rootdirs, symlinks: microdroid_symlinks, file_contexts: "microdroid_file_contexts", } 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 } android_filesystem { name: "microdroid_vendor", use_avb: true, deps: [ "microdroid_plat_sepolicy_vers.txt", "microdroid_vendor_sepolicy.cil", "microdroid_plat_pub_versioned.cil", ], avb_private_key: "microdroid.pem", 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, } logical_partition { name: "microdroid_super", sparse: true, // TODO(b/181107248): remove this hard-coded value size: "104857600", groups: [ { name: "mygroup", // TODO(b/181107248): remove this hard-coded value size: "80000000", partitions: [ { name: "system", filesystem: ":microdroid", }, { name: "vendor", filesystem: ":microdroid_vendor", }, ], }, ], } bootimg { name: "microdroid_boot-5.10", ramdisk_module: "microdroid_ramdisk-5.10", enabled: false, arch: { arm64: { kernel_prebuilt: ":kernel_prebuilts-5.10-arm64", enabled: true, }, x86_64: { kernel_prebuilt: ":kernel_prebuilts-5.10-x86_64", enabled: true, }, }, // TODO(jiyong): change the name to init, cause it's confusing cmdline: "rdinit=/bin/init_vendor", dtb_prebuilt: "dummy_dtb.img", header_version: "3", partition_name: "boot", } 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", dtb_prebuilt: "dummy_dtb.img", header_version: "3", vendor_boot: true, partition_name: "vendor_boot", enabled: false, arch: { arm64: { enabled: true, }, x86_64: { enabled: true, }, }, } android_filesystem { name: "microdroid_vendor_ramdisk-5.10", arch: { arm64: { deps: ["virt_device_prebuilts_kernel_modules-5.10-arm64"], }, x86_64: { deps: ["virt_device_prebuilts_kernel_modules-5.10-x86_64"], }, }, deps: [ "microdroid_fstab", ], base_dir: "first_stage_ramdisk", type: "compressed_cpio", 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, } 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)", }