From 810f73f2e58d36f60f11bcb80f03d94efa752a31 Mon Sep 17 00:00:00 2001 From: Shikha Panwar Date: Fri, 9 Dec 2022 20:01:01 +0000 Subject: [PATCH] AOSP: mke2fs.microdroid: Allow non-APEX version of libs Microdroid uses mke2fs to format encryptedstore partition. This happens in parallel to apex activation by apexd. Hence, sometime, mke2fs would fail if some linker libraries are not available. Create a target (mke2fs.microdroid) with bootstrap: true Bug: 238179332 Test: Build succeeds & atest MicrodroidTests#encryptedStorageAvailable Change-Id: I1aa493bfc188bb78e21efe98423f4a79215f7d95 From AOSP commit: 54818f635e4249db903dd17fca22ae11b3c0f3a0 --- misc/Android.bp | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/misc/Android.bp b/misc/Android.bp index 97f04d3..3e761ad 100644 --- a/misc/Android.bp +++ b/misc/Android.bp @@ -43,9 +43,8 @@ cc_library { //######################################################################## // Build mke2fs -cc_binary { - name: "mke2fs", - host_supported: true, +cc_defaults { + name: "mke2fs_defaults", recovery_available: true, defaults: ["e2fsprogs-defaults"], @@ -60,6 +59,15 @@ cc_binary { "-Wno-error=type-limits", "-Wno-format-extra-args", ], + + stl: "libc++_static", + include_dirs: ["external/e2fsprogs/e2fsck"], +} + +cc_binary { + name: "mke2fs", + host_supported: true, + defaults: ["mke2fs_defaults"], target: { host: { static_libs: [ @@ -107,8 +115,32 @@ cc_binary { symlinks: ["mkfs.ext2", "mkfs.ext3", "mkfs.ext4"], }, }, - stl: "libc++_static", - include_dirs: ["external/e2fsprogs/e2fsck"], +} + +cc_binary { + name: "mke2fs.microdroid", + defaults: ["mke2fs_defaults"], + bootstrap: true, + target: { + android: { + required: [ + "mke2fs.conf", + ], + shared_libs: [ + "libext2fs", + "libext2_blkid", + "libext2_misc", + "libext2_uuid", + "libext2_quota", + "libext2_com_err", + "libext2_e2p", + ], + symlinks: ["mkfs.ext4.microdroid"], + }, + }, + installable: false, + stem: "mke2fs", + visibility: ["//packages/modules/Virtualization/microdroid"], } //########################################################################## -- 1.8.3.1