]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
AOSP: mke2fs.microdroid: Allow non-APEX version of libs
authorShikha Panwar <shikhapanwar@google.com>
Fri, 9 Dec 2022 20:01:01 +0000 (20:01 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Feb 2023 04:43:04 +0000 (23:43 -0500)
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

index 97f04d372ec934e17ef6f7b65e45e8161f0c7cf6..3e761ad8a8955194dadd0dc7ca02d27f49191148 100644 (file)
@@ -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"],
 }
 
 //##########################################################################