Skip to content

Commit

Permalink
Merge tag 'android-11.0.0_r16' into android-10.0
Browse files Browse the repository at this point in the history
Android 11.0.0 release 16 - twrp bringup patch
  • Loading branch information
bigbiff committed Dec 17, 2020
2 parents a9fc4f9 + d74a03d commit 673c7ae
Show file tree
Hide file tree
Showing 250 changed files with 31,340 additions and 4,168 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ AllowShortIfStatementsOnASingleLine: true
ColumnLimit: 100
CommentPragmas: NOLINT:.*
DerivePointerAlignment: false
IncludeBlocks: Preserve
IndentWidth: 2
PointerAlignment: Left
TabWidth: 2
Expand Down
80 changes: 75 additions & 5 deletions Android.bp
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
subdirs = [
// "applypatch",
"bootloader_message",
// "edify",
// "otafault",
// "otautil",
// "uncrypt",
]

cc_defaults {
Expand All @@ -18,3 +13,78 @@ cc_defaults {
],
cpp_std: "c++17",
}

bootstrap_go_package {
name: "soong-libaosprecovery_defaults",
pkgPath: "bootable/recovery/libaosprecovery",
deps: [
"soong",
"soong-android",
"soong-cc"
],
srcs: [
"libaosprecovery_defaults.go"
],
pluginFor: ["soong_build"]
}

libaosprecovery_defaults {
name: "libaosprecovery_defaults"
}

cc_library_shared {
name: "libaosprecovery",
defaults: ["libaosprecovery_defaults"],
cflags: [
"-std=gnu++2a",
"-DRECOVERY_API_VERSION=3"
],
include_dirs: [
"bootable/recovery/install/include",
"bootable/recovery/recovery_ui/include",
"bootable/recovery/recovery_utils/include",
"bootable/recovery/otautil/include",
"bootable/recovery/minadbd",
"bootable/recovery/minadbd/include",
"bootable/recovery/minzip",
"bootable/recovery/twrpinstall/include",
"system/libvintf/include"
],
srcs: [
"install/adb_install.cpp",
"install/asn1_decoder.cpp",
"install/get_args.cpp",
"install/install.cpp",
"install/package.cpp",
"install/verifier.cpp",
"install/wipe_data.cpp",
"install/set_metadata.cpp",
"install/ZipUtil.cpp"
],
shared_libs: [
"libbase",
"libbootloader_message",
"libcrypto",
"libext4_utils",
"libfs_mgr",
"libfusesideload",
"libhidl-gen-utils",
"libhidlbase",
"liblog",
"libselinux",
"libtinyxml2",
"libutils",
"libz",
"libziparchive",
"libcutils",
"libc++"
],
static_libs: [
"libotautil",
"libvintf",
"libhidl-gen-utils",
"librecovery_utils",
"libc++fs"
]
}

66 changes: 16 additions & 50 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ LOCAL_SRC_FILES := \
twrpApex.cpp \
twrpRepacker.cpp

LOCAL_STATIC_LIBRARIES += libavb libtwrpinstall
LOCAL_SHARED_LIBRARIES += libfs_mgr libinit
LOCAL_STATIC_LIBRARIES += libavb libtwrpinstall libminadbd_services libinit
LOCAL_SHARED_LIBRARIES += libfs_mgr
LOCAL_C_INCLUDES += \
system/core/fs_mgr/libfs_avb/include/ \
system/core/fs_mgr/include_fstab/ \
Expand Down Expand Up @@ -120,11 +120,13 @@ LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/install/include \
$(LOCAL_PATH)/fuse_sideload/include \
$(LOCAL_PATH)/install/include \
$(LOCAL_PATH)/twrpinstall/include
$(LOCAL_PATH)/twrpinstall/include \
$(LOCAL_PATH)/recovery_utils/include

LOCAL_STATIC_LIBRARIES += libguitwrp
LOCAL_SHARED_LIBRARIES += libz libc libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libtwadbbu libbootloader_message
LOCAL_SHARED_LIBRARIES += libcrecovery libtwrpdigest libc++ libaosprecovery libinit libcrypto libbase libziparchive libselinux
LOCAL_SHARED_LIBRARIES += libz libc libcutils libstdc++ libtar libblkid libminuitwrp libmtdutils libtwadbbu
LOCAL_SHARED_LIBRARIES += libbootloader_message libcrecovery libtwrpdigest libc++ libaosprecovery libcrypto libbase
LOCAL_SHARED_LIBRARIES += libziparchive libselinux

ifneq ($(wildcard system/core/libsparse/Android.mk),)
LOCAL_SHARED_LIBRARIES += libsparse
Expand Down Expand Up @@ -288,7 +290,8 @@ ifeq ($(TW_INCLUDE_L_CRYPTO), true)
endif
ifeq ($(TW_INCLUDE_CRYPTO), true)
LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO -DUSE_FSCRYPT -Wno-macro-redefined
LOCAL_SHARED_LIBRARIES += libcryptfsfde libgpt_twrp
# LOCAL_SHARED_LIBRARIES += libcryptfsfde
LOCAL_SHARED_LIBRARIES += libgpt_twrp
LOCAL_C_INCLUDES += external/boringssl/src/include bootable/recovery/crypto/fscrypt \
bootable/recovery/crypto
TW_INCLUDE_CRYPTO_FBE := true
Expand Down Expand Up @@ -510,11 +513,11 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
recovery-persist.cpp
LOCAL_MODULE := recovery-persist
LOCAL_SHARED_LIBRARIES := liblog libbase libmetricslogger
LOCAL_STATIC_LIBRARIES := libotautil
LOCAL_SHARED_LIBRARIES := liblog libbase
LOCAL_STATIC_LIBRARIES := libotautil librecovery_utils
LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include
LOCAL_C_INCLUDES += system/core/libmetricslogger/include \
system/core/libstats/include
LOCAL_C_INCLUDES += system/core/libstats/include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/recovery_utils/include
LOCAL_CFLAGS := -Werror
LOCAL_INIT_RC := recovery-persist.rc
include $(BUILD_EXECUTABLE)
Expand All @@ -526,8 +529,9 @@ LOCAL_SRC_FILES := \
recovery-refresh.cpp
LOCAL_MODULE := recovery-refresh
LOCAL_SHARED_LIBRARIES := liblog libbase
LOCAL_STATIC_LIBRARIES := libotautil
LOCAL_STATIC_LIBRARIES := libotautil librecovery_utils
LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/recovery_utils/include
LOCAL_CFLAGS := -Werror
LOCAL_INIT_RC := recovery-refresh.rc
include $(BUILD_EXECUTABLE)
Expand Down Expand Up @@ -567,53 +571,17 @@ LOCAL_STATIC_LIBRARIES := \

include $(BUILD_STATIC_LIBRARY)

# shared libaosprecovery for Apache code
# ===============================
include $(CLEAR_VARS)


LOCAL_MODULE := libaosprecovery
LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := install/adb_install.cpp install/asn1_decoder.cpp install/fuse_sdcard_install.cpp \
install/get_args.cpp install/install.cpp install/legacy_property_service.cpp \
install/package.cpp install/verifier.cpp install/wipe_data.cpp \
install/set_metadata.cpp install/zipwrap.cpp install/ZipUtil.cpp
LOCAL_SHARED_LIBRARIES += libbase libbootloader_message libcrypto libext4_utils \
libfs_mgr libfusesideload libhidl-gen-utils libhidlbase \
liblog libselinux libtinyxml2 libutils libz libziparchive libcutils
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
LOCAL_SHARED_LIBRARIES += libc++
LOCAL_CFLAGS := -std=gnu++2a
LOCAL_C_INCLUDES += $(commands_TWRP_local_path)/install/include \
$(commands_TWRP_local_path)/recovery_ui/include \
$(commands_TWRP_local_path)/otautil/include \
$(commands_TWRP_local_path)/minadbd \
$(commands_TWRP_local_path)/minzip \
$(commands_TWRP_local_path)/twrpinstall/include \
system/libvintf/include
LOCAL_STATIC_LIBRARIES += libotautil libvintf_recovery libvintf libhidl-gen-utils
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)

ifeq ($(AB_OTA_UPDATER),true)
LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
endif

include $(BUILD_SHARED_LIBRARY)

commands_recovery_local_path := $(LOCAL_PATH)

include \
$(commands_TWRP_local_path)/updater/Android.mk

include $(commands_TWRP_local_path)/mtp/ffs/Android.mk \
$(commands_TWRP_local_path)/minadbd/Android.mk \
$(commands_TWRP_local_path)/minui/Android.mk

#includes for TWRP
include $(commands_TWRP_local_path)/injecttwrp/Android.mk \
$(commands_TWRP_local_path)/htcdumlock/Android.mk \
$(commands_TWRP_local_path)/gui/Android.mk \
$(commands_TWRP_local_path)/mmcutils/Android.mk \
$(commands_TWRP_local_path)/bmlutils/Android.mk \
$(commands_TWRP_local_path)/prebuilt/Android.mk \
Expand All @@ -623,15 +591,13 @@ include $(commands_TWRP_local_path)/injecttwrp/Android.mk \
$(commands_TWRP_local_path)/libtar/Android.mk \
$(commands_TWRP_local_path)/libcrecovery/Android.mk \
$(commands_TWRP_local_path)/libblkid/Android.mk \
$(commands_TWRP_local_path)/minuitwrp/Android.mk \
$(commands_TWRP_local_path)/openaes/Android.mk \
$(commands_TWRP_local_path)/twrpTarMain/Android.mk \
$(commands_TWRP_local_path)/minzip/Android.mk \
$(commands_TWRP_local_path)/dosfstools/Android.mk \
$(commands_TWRP_local_path)/etc/Android.mk \
$(commands_TWRP_local_path)/simg2img/Android.mk \
$(commands_TWRP_local_path)/adbbu/Android.mk \
$(commands_TWRP_local_path)/libpixelflinger/Android.mk \
$(commands_TWRP_local_path)/twrpDigest/Android.mk \
$(commands_TWRP_local_path)/attr/Android.mk

Expand All @@ -641,7 +607,7 @@ ifneq ($(TW_OZIP_DECRYPT_KEY),)
endif

ifeq ($(TW_INCLUDE_CRYPTO), true)
include $(commands_TWRP_local_path)/crypto/fde/Android.mk
# include $(commands_TWRP_local_path)/crypto/fde/Android.mk
include $(commands_TWRP_local_path)/crypto/scrypt/Android.mk
ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
include $(commands_TWRP_local_path)/crypto/fscrypt/Android.mk
Expand Down
18 changes: 18 additions & 0 deletions CleanSpec.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/sbin)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libinstall.recovery_intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/system/lib64/libinstall.so)

$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/nativetest/recovery_component_test)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/nativetest64/recovery_component_test)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/testcases/recovery_component_test)

$(call add-clean-step, find $(OUT_DIR) -type f -name "SystemUpdaterSample*" -print0 | xargs -0 rm -f)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/SystemUpdaterSample)

$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib*/libbrotli.so)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib*/libbz.so)

# Move recovery resources from /system to /vendor.
$(call add-clean-step, rm -f $(PRODUCT_OUT)/system/bin/applypatch)
$(call add-clean-step, rm -r $(PRODUCT_OUT)/symbols/system/bin/applypatch)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/PACKAGING/target_files_intermediates/*-target_files-*/SYSTEM/bin/applypatch)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/PACKAGING/target_files_intermediates/*-target_files-*/SYSTEM/bin/install-recovery.sh)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/PACKAGING/target_files_intermediates/*-target_files-*/SYSTEM/etc/recovery-resource.dat)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/PACKAGING/target_files_intermediates/*-target_files-*/SYSTEM/recovery-from-boot.p)

# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
4 changes: 3 additions & 1 deletion OWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[email protected]
[email protected]
tbao@google.com
nhdo@google.com
[email protected]
[email protected]
14 changes: 14 additions & 0 deletions TEST_MAPPING
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presubmit": [
{
"name": "minadbd_test"
},
{
"name": "recovery_unit_test"
},
{
"name": "recovery_host_test",
"host": true
}
]
}
Loading

0 comments on commit 673c7ae

Please sign in to comment.