Convert `init_vendor` to Android.bp
`init_first_stage` is a dependency of `init_vendor` only when
`BOARD_USES_RECOVERY_AS_BOOT` is false.
Since `BOARD_USES_RECOVERY_AS_BOOT` is already defined in
`build/make/core/android_soong_config_vars.mk` within a
soong_namespace, we can use the `soong_config_module_type` to easily
convert this to Android.bp.
Bug: 347600829
Test: m init_vendor
Change-Id: I1ddcd5fb62983b01e51452c9b7367750e03e7f48
diff --git a/init/Android.bp b/init/Android.bp
index 57e5a68..6526a93 100644
--- a/init/Android.bp
+++ b/init/Android.bp
@@ -162,7 +162,7 @@
},
release_write_appcompat_override_system_properties: {
cflags: ["-DWRITE_APPCOMPAT_OVERRIDE_SYSTEM_PROPERTIES"],
- }
+ },
},
static_libs: [
"libavb",
@@ -663,3 +663,23 @@
src: "extra_free_kbytes.sh",
filename_from_src: true,
}
+
+soong_config_module_type {
+ name: "board_use_recovery_as_boot_phony",
+ module_type: "phony",
+ config_namespace: "ANDROID",
+ bool_variables: ["BOARD_USES_RECOVERY_AS_BOOT"],
+ properties: ["required"],
+}
+
+board_use_recovery_as_boot_phony {
+ name: "init_vendor",
+ soong_config_variables: {
+ BOARD_USES_RECOVERY_AS_BOOT: {
+ required: [],
+ conditions_default: {
+ required: ["init_first_stage"],
+ },
+ },
+ },
+}
diff --git a/init/Android.mk b/init/Android.mk
deleted file mode 100644
index 4b85c15..0000000
--- a/init/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2005 The Android Open Source Project
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := init_vendor
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
-ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
-LOCAL_REQUIRED_MODULES := \
- init_first_stage \
-
-endif # BOARD_USES_RECOVERY_AS_BOOT
-include $(BUILD_PHONY_PACKAGE)