简体   繁体   中英

How to modify AOSP to run a bash script on device boot?

How can AOSP be modified to run a bash script on device boot? Which directory should the script be placed in and what defines the order that the scripts are run? Would any permissions need to be added?

Step-1: Create a.sh file and put it under vendor/

Step-2: Create Android.mk with block

include $(CLEAR_VARS)
LOCAL_MODULE       := script.sh
LOCAL_MODULE_TAGS  := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES    := $(LOCAL_MODULE)
LOCAL_MODULE_PATH  := $(TARGET_OUT_VENDOR_EXECUTABLES)
include $(BUILD_PREBUILT)

Step-3: Put entry in root mk

PRODUCT_PACKAGES += script.sh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM