Android.mk 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Copyright 2005 The Android Open Source Project
  2. LOCAL_PATH:= $(call my-dir)
  3. -include system/sepolicy/policy_version.mk
  4. # --
  5. ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
  6. init_options += \
  7. -DALLOW_LOCAL_PROP_OVERRIDE=1 \
  8. -DALLOW_PERMISSIVE_SELINUX=1 \
  9. -DREBOOT_BOOTLOADER_ON_PANIC=1 \
  10. -DWORLD_WRITABLE_KMSG=1 \
  11. -DDUMP_ON_UMOUNT_FAILURE=1
  12. else
  13. init_options += \
  14. -DALLOW_LOCAL_PROP_OVERRIDE=0 \
  15. -DALLOW_PERMISSIVE_SELINUX=0 \
  16. -DREBOOT_BOOTLOADER_ON_PANIC=0 \
  17. -DWORLD_WRITABLE_KMSG=0 \
  18. -DDUMP_ON_UMOUNT_FAILURE=0
  19. endif
  20. ifneq (,$(filter eng,$(TARGET_BUILD_VARIANT)))
  21. init_options += \
  22. -DSHUTDOWN_ZERO_TIMEOUT=1
  23. else
  24. init_options += \
  25. -DSHUTDOWN_ZERO_TIMEOUT=0
  26. endif
  27. init_options += -DLOG_UEVENTS=0 \
  28. -DSEPOLICY_VERSION=$(POLICYVERS)
  29. init_cflags += \
  30. $(init_options) \
  31. -Wall -Wextra \
  32. -Wno-unused-parameter \
  33. -Werror \
  34. # --
  35. # Do not build this even with mmma if we're system-as-root, otherwise it will overwrite the symlink.
  36. ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
  37. include $(CLEAR_VARS)
  38. LOCAL_CPPFLAGS := $(init_cflags)
  39. LOCAL_SRC_FILES := \
  40. devices.cpp \
  41. first_stage_init.cpp \
  42. first_stage_main.cpp \
  43. first_stage_mount.cpp \
  44. mount_namespace.cpp \
  45. reboot_utils.cpp \
  46. selinux.cpp \
  47. switch_root.cpp \
  48. uevent_listener.cpp \
  49. util.cpp \
  50. LOCAL_MODULE := init_first_stage
  51. LOCAL_MODULE_STEM := init
  52. LOCAL_FORCE_STATIC_EXECUTABLE := true
  53. LOCAL_MODULE_PATH := $(TARGET_RAMDISK_OUT)
  54. LOCAL_UNSTRIPPED_PATH := $(TARGET_RAMDISK_OUT_UNSTRIPPED)
  55. # Install adb_debug.prop into debug ramdisk.
  56. # This allows adb root on a user build, when debug ramdisk is used.
  57. LOCAL_REQUIRED_MODULES := \
  58. adb_debug.prop \
  59. # Set up the same mount points on the ramdisk that system-as-root contains.
  60. LOCAL_POST_INSTALL_CMD := mkdir -p \
  61. $(TARGET_RAMDISK_OUT)/apex \
  62. $(TARGET_RAMDISK_OUT)/debug_ramdisk \
  63. $(TARGET_RAMDISK_OUT)/dev \
  64. $(TARGET_RAMDISK_OUT)/mnt \
  65. $(TARGET_RAMDISK_OUT)/proc \
  66. $(TARGET_RAMDISK_OUT)/sys \
  67. LOCAL_STATIC_LIBRARIES := \
  68. libc++fs \
  69. libfs_avb \
  70. libfs_mgr \
  71. libfec \
  72. libfec_rs \
  73. libsquashfs_utils \
  74. liblogwrap \
  75. libext4_utils \
  76. libfscrypt \
  77. libseccomp_policy \
  78. libcrypto_utils \
  79. libsparse \
  80. libavb \
  81. libkeyutils \
  82. liblp \
  83. libcutils \
  84. libbase \
  85. liblog \
  86. libcrypto \
  87. libdl \
  88. libz \
  89. libselinux \
  90. libcap \
  91. libgsi \
  92. libcom.android.sysprop.apex \
  93. liblzma \
  94. libdexfile_support \
  95. libunwindstack \
  96. libbacktrace \
  97. LOCAL_SANITIZE := signed-integer-overflow
  98. # First stage init is weird: it may start without stdout/stderr, and no /proc.
  99. LOCAL_NOSANITIZE := hwaddress
  100. include $(BUILD_EXECUTABLE)
  101. endif
  102. include $(CLEAR_VARS)
  103. LOCAL_MODULE := init_system
  104. LOCAL_REQUIRED_MODULES := \
  105. init_second_stage \
  106. include $(BUILD_PHONY_PACKAGE)
  107. include $(CLEAR_VARS)
  108. LOCAL_MODULE := init_vendor
  109. ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
  110. LOCAL_REQUIRED_MODULES := \
  111. init_first_stage \
  112. endif
  113. include $(BUILD_PHONY_PACKAGE)