Introduce microdroid variants of init_first_stage and init_second_stage
These variants will compile with -DMICRODROID flag, which will allow us
to exclude init features that are not needed for Microdroid, and
introduce features that only work in Microdroid.
Bug: 287206497
Test: build com.android.virt APEX
Change-Id: Ib9af0cfcdf06c70fc39e6e6ac8ef07bb69982969
diff --git a/init/Android.bp b/init/Android.bp
index 41c7a95..f62d7b7 100644
--- a/init/Android.bp
+++ b/init/Android.bp
@@ -265,8 +265,8 @@
],
}
-cc_binary {
- name: "init_second_stage",
+cc_defaults {
+ name: "init_second_stage_defaults",
recovery_available: true,
stem: "init",
defaults: ["init_defaults"],
@@ -304,9 +304,22 @@
],
},
},
+}
+
+cc_binary {
+ name: "init_second_stage",
+ defaults: ["init_second_stage_defaults"],
+}
+
+cc_binary {
+ name: "init_second_stage.microdroid",
+ defaults: ["init_second_stage_defaults"],
+ cflags: ["-DMICRODROID"],
+ installable: false,
visibility: ["//packages/modules/Virtualization/microdroid"],
}
+
soong_config_module_type {
name: "init_first_stage_cc_defaults",
module_type: "cc_defaults",
@@ -324,12 +337,8 @@
installable: false,
},
},
-}
-cc_binary {
- name: "init_first_stage",
stem: "init",
- defaults: ["init_first_stage_defaults"],
srcs: [
"block_dev_initializer.cpp",
@@ -443,6 +452,18 @@
install_in_root: true,
}
+cc_binary {
+ name: "init_first_stage",
+ defaults: ["init_first_stage_defaults"],
+}
+
+cc_binary {
+ name: "init_first_stage.microdroid",
+ defaults: ["init_first_stage_defaults"],
+ cflags: ["-DMICRODROID"],
+ installable: false,
+}
+
phony {
name: "init_system",
required: ["init_second_stage"],