Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 064ac0bf authored by Nelson Li's avatar Nelson Li
Browse files

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
parent a1188013
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ libinit_cc_defaults {
        },
        release_write_appcompat_override_system_properties: {
            cflags: ["-DWRITE_APPCOMPAT_OVERRIDE_SYSTEM_PROPERTIES"],
        }
        },
    },
    static_libs: [
        "libavb",
@@ -663,3 +663,23 @@ sh_binary {
    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"],
            },
        },
    },
}

init/Android.mk

deleted100644 → 0
+0 −16
Original line number Diff line number Diff line
# 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)