Don't install Android-only dependencies to microdroid

init_second_stage_defaults provides properties that are common to both
Android's init and Microdroid's init. Before this CL, it included
target.product.required and target.recovery.required properties. The
required dependencies were Android-specific; the dependencies included
Android-only init.rc. Microdroid has its own init.rc (microdroid_init_rc
module).

This was problematic but so far it didn't cause an issue because those
Android-only dependencies were not installed to Microdroid due to a bug
in the build system.

As we fix the build system bug, the Android-only dependencies started
get installed to Microdroid, effectively overriding the Microdroid-only
init.rc file. This made Microdroid fail to boot.

Fixing this issue by moving the Android-only dependencies out of the
defaults module and putting them on the Android's init.

In addition to that, this CL removes the recovery variant for the
Microdroid's init because it's not used.

Bug: N/A
Test: run AVF tests
Change-Id: I09748f1123125cac74ce54fd5c360c9a3ba2f996
This commit is contained in:
Jiyong Park 2024-04-17 14:15:49 +09:00
parent 6d6ff398b3
commit 12c64a7586

View file

@ -259,6 +259,7 @@ cc_library_static {
"avf_build_flags_cc",
"libinit_defaults",
],
recovery_available: false,
cflags: ["-DMICRODROID=1"],
}
@ -276,6 +277,13 @@ cc_defaults {
defaults: ["init_defaults"],
srcs: ["main.cpp"],
symlinks: ["ueventd"],
}
cc_binary {
name: "init_second_stage",
defaults: ["init_second_stage_defaults"],
static_libs: ["libinit"],
visibility: ["//visibility:any_system_partition"],
target: {
platform: {
required: [
@ -309,19 +317,13 @@ cc_defaults {
},
}
cc_binary {
name: "init_second_stage",
defaults: ["init_second_stage_defaults"],
static_libs: ["libinit"],
visibility: ["//visibility:any_system_partition"],
}
cc_binary {
name: "init_second_stage.microdroid",
defaults: [
"avf_build_flags_cc",
"init_second_stage_defaults",
],
recovery_available: false,
static_libs: ["libinit.microdroid"],
cflags: ["-DMICRODROID=1"],
installable: false,