From 12c64a758663cfecce7f71fcad960d94b4e04e58 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 17 Apr 2024 14:15:49 +0900 Subject: [PATCH] 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 --- init/Android.bp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/init/Android.bp b/init/Android.bp index ff82f7f18..6d63e41e2 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -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,