From: Jiyong Park Date: Wed, 20 Jun 2018 05:21:54 +0000 (+0900) Subject: AOSP: e2fsdroid and mke2fs are dynamic executable in recovery partition X-Git-Tag: v1.44.3-rc2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=722b9ca4cac7edc4304e2ecd7d3992e051125b33;p=thirdparty%2Fe2fsprogs.git AOSP: e2fsdroid and mke2fs are dynamic executable in recovery partition The two utilities are now converted to dynamic executables as shared libraries are supported in recovery mode. As part of the conversion, shared libraries that are depended from them are also marked as recovery_available: true. Bug: 79146551 Test: adb reboot recovery, and select 'Wipe data/factory reset'. The data partition is formatted and there is no selinux denial. Signed-off-by: Theodore Ts'o Change-Id: I22fbc83a4ff0496096efca90721b0db1237c32cd From AOSP commit: df1f088849ed3336bb4f6f200c29b30682f15948 --- diff --git a/CleanSpec.mk b/CleanSpec.mk index ded4cebf9..8331daeb7 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -49,3 +49,4 @@ # ************************************************ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libext2_uuid_intermediates) +$(call add-clean-step, rm -rf $(TARGET_RECOVERY_OUT)/root/sbin) diff --git a/contrib/android/Android.bp b/contrib/android/Android.bp index 67844f986..b1fd0daa2 100644 --- a/contrib/android/Android.bp +++ b/contrib/android/Android.bp @@ -6,6 +6,7 @@ cc_binary { name: "e2fsdroid", host_supported: true, + recovery_available: true, defaults: ["e2fsprogs-defaults"], srcs: [ diff --git a/contrib/android/Android.mk b/contrib/android/Android.mk deleted file mode 100644 index 68d925dea..000000000 --- a/contrib/android/Android.mk +++ /dev/null @@ -1,41 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -######################################################################### -# Build statically linked e2fsdroid for recovery -e2fsdroid_src_files := \ - e2fsdroid.c \ - block_range.c \ - fsmap.c \ - block_list.c \ - base_fs.c \ - perms.c \ - basefs_allocator.c \ - -e2fsdroid_cflags := -W -Wall -Werror -Wno-error=macro-redefined - -e2fsdroid_static_libraries := \ - libext2_com_err \ - libext2_misc \ - libcutils \ - libselinux \ - libcrypto \ - libsparse \ - liblog \ - libz \ - -e2fsdroid_whole_static_libraries := \ - libbase \ - libext2fs \ - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(e2fsdroid_src_files) -LOCAL_CFLAGS := $(e2fsdroid_cflags) -LOCAL_WHOLE_STATIC_LIBRARIES := $(e2fsdroid_whole_static_libraries) -LOCAL_STATIC_LIBRARIES := $(e2fsdroid_static_libraries) -LOCAL_MODULE := e2fsdroid_static -LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin -LOCAL_FORCE_STATIC_EXECUTABLE := true - -include $(BUILD_EXECUTABLE) - diff --git a/lib/blkid/Android.bp b/lib/blkid/Android.bp index 225716cdc..5a02736aa 100644 --- a/lib/blkid/Android.bp +++ b/lib/blkid/Android.bp @@ -3,6 +3,7 @@ cc_library { name: "libext2_blkid", host_supported: true, + recovery_available: true, unique_host_soname: true, defaults: ["e2fsprogs-defaults"], srcs: [ diff --git a/lib/e2p/Android.bp b/lib/e2p/Android.bp index 21089d7bf..148a576c4 100644 --- a/lib/e2p/Android.bp +++ b/lib/e2p/Android.bp @@ -3,6 +3,7 @@ cc_library { name: "libext2_e2p", host_supported: true, + recovery_available: true, unique_host_soname: true, defaults: ["e2fsprogs-defaults"], srcs: [ diff --git a/lib/et/Android.bp b/lib/et/Android.bp index 670d8ee44..3414639a7 100644 --- a/lib/et/Android.bp +++ b/lib/et/Android.bp @@ -3,6 +3,7 @@ cc_library { name: "libext2_com_err", host_supported: true, + recovery_available: true, unique_host_soname: true, defaults: ["e2fsprogs-defaults"], srcs: [ diff --git a/lib/ext2fs/Android.bp b/lib/ext2fs/Android.bp index 06a750eb1..5d10d3f73 100644 --- a/lib/ext2fs/Android.bp +++ b/lib/ext2fs/Android.bp @@ -3,6 +3,7 @@ cc_library { name: "libext2fs", host_supported: true, + recovery_available: true, unique_host_soname: true, defaults: ["e2fsprogs-defaults"], srcs: [ diff --git a/lib/support/Android.bp b/lib/support/Android.bp index 0ddd07935..e986e0eca 100644 --- a/lib/support/Android.bp +++ b/lib/support/Android.bp @@ -3,6 +3,7 @@ cc_library { name: "libext2_quota", host_supported: true, + recovery_available: true, unique_host_soname: true, defaults: ["e2fsprogs-defaults"], srcs: [ diff --git a/misc/Android.bp b/misc/Android.bp index e73150f80..310c9dc70 100644 --- a/misc/Android.bp +++ b/misc/Android.bp @@ -5,6 +5,7 @@ cc_library { name: "libext2_misc", host_supported: true, + recovery_available: true, defaults: ["e2fsprogs-defaults"], target: { @@ -33,6 +34,7 @@ cc_library { cc_binary { name: "mke2fs", host_supported: true, + recovery_available: true, defaults: ["e2fsprogs-defaults"], srcs: [ diff --git a/misc/Android.mk b/misc/Android.mk deleted file mode 100644 index c9d07353e..000000000 --- a/misc/Android.mk +++ /dev/null @@ -1,42 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -######################################################################### -# Build statically linked mke2fs for recovery -mke2fs_src_files := \ - mke2fs.c \ - util.c \ - mk_hugefiles.c \ - default_profile.c \ - create_inode.c \ - -mke2fs_c_includes := \ - external/e2fsprogs/e2fsck - -mke2fs_cflags := -W -Wall -Werror -Wno-macro-redefined - -mke2fs_static_libraries := \ - libext2_blkid \ - libext2_uuid \ - libext2_quota \ - libext2_com_err \ - libext2_e2p \ - libsparse \ - libz \ - -mke2fs_whole_static_libraries := \ - libbase \ - libext2fs \ - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(mke2fs_src_files) -LOCAL_C_INCLUDES := $(mke2fs_c_includes) -LOCAL_CFLAGS := $(mke2fs_cflags) -LOCAL_WHOLE_STATIC_LIBRARIES := $(mke2fs_whole_static_libraries) -LOCAL_STATIC_LIBRARIES := $(mke2fs_static_libraries) -LOCAL_MODULE := mke2fs_static -LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin -LOCAL_FORCE_STATIC_EXECUTABLE := true - -include $(BUILD_EXECUTABLE) -