2009-03-04 04:32:55 +01:00
|
|
|
# Copyright 2005 The Android Open Source Project
|
|
|
|
|
|
|
|
LOCAL_PATH:= $(call my-dir)
|
|
|
|
|
2015-02-04 23:46:36 +01:00
|
|
|
# --
|
|
|
|
|
|
|
|
ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
|
2017-03-10 23:46:38 +01:00
|
|
|
init_options += \
|
|
|
|
-DALLOW_LOCAL_PROP_OVERRIDE=1 \
|
|
|
|
-DALLOW_PERMISSIVE_SELINUX=1 \
|
2017-03-28 22:07:15 +02:00
|
|
|
-DREBOOT_BOOTLOADER_ON_PANIC=1 \
|
2017-03-29 21:54:40 +02:00
|
|
|
-DWORLD_WRITABLE_KMSG=1 \
|
|
|
|
-DDUMP_ON_UMOUNT_FAILURE=1
|
2015-02-04 23:46:36 +01:00
|
|
|
else
|
2017-03-10 23:46:38 +01:00
|
|
|
init_options += \
|
|
|
|
-DALLOW_LOCAL_PROP_OVERRIDE=0 \
|
|
|
|
-DALLOW_PERMISSIVE_SELINUX=0 \
|
2017-03-28 22:07:15 +02:00
|
|
|
-DREBOOT_BOOTLOADER_ON_PANIC=0 \
|
2017-03-29 21:54:40 +02:00
|
|
|
-DWORLD_WRITABLE_KMSG=0 \
|
|
|
|
-DDUMP_ON_UMOUNT_FAILURE=0
|
2015-02-04 23:46:36 +01:00
|
|
|
endif
|
|
|
|
|
2017-03-28 18:41:36 +02:00
|
|
|
ifneq (,$(filter eng,$(TARGET_BUILD_VARIANT)))
|
|
|
|
init_options += \
|
|
|
|
-DSHUTDOWN_ZERO_TIMEOUT=1
|
|
|
|
else
|
|
|
|
init_options += \
|
|
|
|
-DSHUTDOWN_ZERO_TIMEOUT=0
|
|
|
|
endif
|
|
|
|
|
2015-02-06 21:19:48 +01:00
|
|
|
init_options += -DLOG_UEVENTS=0
|
|
|
|
|
|
|
|
init_cflags += \
|
|
|
|
$(init_options) \
|
|
|
|
-Wall -Wextra \
|
|
|
|
-Wno-unused-parameter \
|
|
|
|
-Werror \
|
2017-03-13 19:58:58 +01:00
|
|
|
-std=gnu++1z \
|
2015-02-04 23:46:36 +01:00
|
|
|
|
|
|
|
# --
|
|
|
|
|
2015-02-06 21:19:48 +01:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_CPPFLAGS := $(init_cflags)
|
2018-07-20 23:57:00 +02:00
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
devices.cpp \
|
|
|
|
first_stage_mount.cpp \
|
|
|
|
init_first_stage.cpp \
|
|
|
|
reboot_utils.cpp \
|
|
|
|
selinux.cpp \
|
2018-08-07 19:22:01 +02:00
|
|
|
switch_root.cpp \
|
2018-07-20 23:57:00 +02:00
|
|
|
uevent_listener.cpp \
|
|
|
|
util.cpp \
|
2015-02-04 02:12:07 +01:00
|
|
|
|
2018-10-16 02:47:16 +02:00
|
|
|
LOCAL_MODULE := init_first_stage
|
|
|
|
LOCAL_MODULE_STEM := init
|
2018-07-20 23:57:00 +02:00
|
|
|
|
|
|
|
LOCAL_FORCE_STATIC_EXECUTABLE := true
|
2015-05-08 17:30:33 +02:00
|
|
|
|
2018-08-07 19:22:01 +02:00
|
|
|
LOCAL_MODULE_PATH := $(TARGET_RAMDISK_OUT)
|
|
|
|
LOCAL_UNSTRIPPED_PATH := $(TARGET_RAMDISK_OUT_UNSTRIPPED)
|
|
|
|
|
|
|
|
# Set up the same mount points on the ramdisk that system-as-root contains.
|
|
|
|
LOCAL_POST_INSTALL_CMD := \
|
|
|
|
mkdir -p $(TARGET_RAMDISK_OUT)/dev \
|
2018-09-17 23:20:16 +02:00
|
|
|
$(TARGET_RAMDISK_OUT)/mnt \
|
|
|
|
$(TARGET_RAMDISK_OUT)/proc \
|
|
|
|
$(TARGET_RAMDISK_OUT)/sys \
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2012-10-17 08:07:05 +02:00
|
|
|
LOCAL_STATIC_LIBRARIES := \
|
2015-02-06 21:19:48 +01:00
|
|
|
libfs_mgr \
|
2015-05-22 16:43:50 +02:00
|
|
|
libfec \
|
|
|
|
libfec_rs \
|
2015-04-09 02:59:19 +02:00
|
|
|
libsquashfs_utils \
|
2015-02-06 21:19:48 +01:00
|
|
|
liblogwrap \
|
2017-01-11 23:03:11 +01:00
|
|
|
libext4_utils \
|
2018-10-23 22:10:33 +02:00
|
|
|
libfscrypt \
|
2017-07-18 00:14:02 +02:00
|
|
|
libseccomp_policy \
|
2016-08-06 00:47:57 +02:00
|
|
|
libcrypto_utils \
|
2017-01-11 23:37:50 +01:00
|
|
|
libsparse \
|
2017-05-10 02:09:06 +02:00
|
|
|
libavb \
|
|
|
|
libkeyutils \
|
2018-07-28 01:05:31 +02:00
|
|
|
liblp \
|
2018-06-01 12:26:42 +02:00
|
|
|
libcutils \
|
|
|
|
libbase \
|
|
|
|
liblog \
|
|
|
|
libcrypto \
|
|
|
|
libdl \
|
|
|
|
libz \
|
2018-06-19 09:55:05 +02:00
|
|
|
libselinux \
|
2018-07-20 23:57:00 +02:00
|
|
|
libcap \
|
2018-06-01 12:26:42 +02:00
|
|
|
|
2017-07-26 23:17:09 +02:00
|
|
|
LOCAL_SANITIZE := signed-integer-overflow
|
2018-11-01 21:38:38 +01:00
|
|
|
# First stage init is weird: it may start without stdout/stderr, and no /proc.
|
|
|
|
LOCAL_NOSANITIZE := hwaddress
|
2009-03-04 04:32:55 +01:00
|
|
|
include $(BUILD_EXECUTABLE)
|
2018-10-16 02:47:16 +02:00
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := init_system
|
|
|
|
ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
|
|
|
|
LOCAL_REQUIRED_MODULES := \
|
|
|
|
init_first_stage \
|
|
|
|
init_second_stage \
|
|
|
|
|
|
|
|
else
|
|
|
|
LOCAL_REQUIRED_MODULES := \
|
|
|
|
init_second_stage \
|
|
|
|
|
|
|
|
endif
|
|
|
|
include $(BUILD_PHONY_PACKAGE)
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := init_vendor
|
|
|
|
ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
|
|
|
|
LOCAL_REQUIRED_MODULES := \
|
|
|
|
init_first_stage \
|
|
|
|
|
|
|
|
endif
|
|
|
|
include $(BUILD_PHONY_PACKAGE)
|
|
|
|
|
|
|
|
|