super partition: mount super partitions using fs_mgr

We are now requiring fstab v2 for android-10+ trees. You can
specify twrp flags using /etc/twrp.flags to label and
annotate partitions.

This patchset uses fs_mgr to load the super partition and build
device mapper blocks off vendor and system depending on the slot
in use. These are mapped to partitions in TWRP and allowed to
be mounted read-only. The super partition is also mapped into a
TWRP partition in order to backup the entire partition. You cannot
backup individual device mapper blocks due to the device can only
be read-only. Therefore you cannot write back to the device mapper.

Change-Id: Icc1d895dcf96ad5ba03989c9bf759419d83673a3
This commit is contained in:
bigbiff
2020-03-23 15:08:27 -04:00
parent 3a299dcc32
commit ee7b7ffba4
15 changed files with 296 additions and 51 deletions
+20 -4
View File
@@ -52,6 +52,9 @@ TWHTCD_PATH := $(TWRES_PATH)htcd/
TARGET_RECOVERY_GUI := true
LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES :=
ifneq ($(TW_DEVICE_VERSION),)
LOCAL_CFLAGS += -DTW_DEVICE_VERSION='"-$(TW_DEVICE_VERSION)"'
else
@@ -77,6 +80,19 @@ LOCAL_SRC_FILES := \
tarWrite.c \
twrpAdbBuFifo.cpp
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 29; echo $$?),0)
LOCAL_STATIC_LIBRARIES += libavb
LOCAL_SHARED_LIBRARIES += libfs_mgr libinit
LOCAL_C_INCLUDES += \
system/core/fs_mgr/libfs_avb/include/ \
system/core/fs_mgr/include_fstab/ \
system/core/fs_mgr/include/ \
system/core/fs_mgr/libdm/include/ \
system/core/fs_mgr/liblp/include/ \
system/gsid/include/ \
system/core/init/
endif
ifneq ($(TARGET_RECOVERY_REBOOT_SRC),)
LOCAL_SRC_FILES += $(TARGET_RECOVERY_REBOOT_SRC)
endif
@@ -117,9 +133,6 @@ else
LOCAL_C_INCLUDES += external/boringssl/include external/libcxx/include
endif
LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES :=
LOCAL_STATIC_LIBRARIES += libguitwrp
LOCAL_SHARED_LIBRARIES += libz libc libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libtwadbbu libbootloader_message_twrp
LOCAL_SHARED_LIBRARIES += libcrecovery libtwadbbu libtwrpdigest libc++ libaosprecovery
@@ -153,7 +166,6 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
else
LOCAL_SHARED_LIBRARIES += libziparchive
LOCAL_C_INCLUDES += system/core/libziparchive/include
LOCAL_C_FLAGS += -DUSE_
endif
else
LOCAL_SHARED_LIBRARIES += libminzip
@@ -190,6 +202,10 @@ ifeq ($(AB_OTA_UPDATER),true)
TWRP_REQUIRED_MODULES += libhardware
endif
ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
LOCAL_CFLAGS += -DPRODUCT_USE_DYNAMIC_PARTITIONS=1
endif
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
ifeq ($(TARGET_RECOVERY_TWRP_LIB),)