aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2023-10-19 15:50:49 -0700
committerCole Faust <colefaust@google.com>2023-10-19 15:54:04 -0700
commit73fd67a5df3978bdb3ca80ab28e49df18dd22d1c (patch)
tree746f7e176692c9f14a21e3086c8710137b188ed0
parent15289a27b21598c2ed30472cd2a056179ec33692 (diff)
downloadbazel-73fd67a5df3978bdb3ca80ab28e49df18dd22d1c.tar.gz
Add mkfs.erofs to path during partition builds
Some products need this tool to build a different type of filesystem. Bug: 297269187 Test: m bazel_sandwich on aosp_cf_x86_64_phone (which now gets a different error, but gets farther) Change-Id: I02a5ff66b84f81c482d04299b41baf0315f99f4a
-rw-r--r--rules/partitions/BUILD1
-rw-r--r--rules/partitions/partition.bzl1
-rw-r--r--rules/partitions/toolchain.bzl7
3 files changed, 9 insertions, 0 deletions
diff --git a/rules/partitions/BUILD b/rules/partitions/BUILD
index feff7e58..bfa3ff85 100644
--- a/rules/partitions/BUILD
+++ b/rules/partitions/BUILD
@@ -9,6 +9,7 @@ partition_toolchain(
e2fsdroid = "//external/e2fsprogs/contrib/android:e2fsdroid",
fec = "//system/extras/verity/fec",
mke2fs = "//external/e2fsprogs/misc:mke2fs",
+ mkfs_erofs = "//external/erofs-utils:mkfs.erofs",
mkuserimg_mke2fs = "//system/extras/ext4_utils:mkuserimg_mke2fs",
openssl = "//prebuilts/build-tools:linux-x86/bin/openssl",
simg2img = "//system/core/libsparse:simg2img",
diff --git a/rules/partitions/partition.bzl b/rules/partitions/partition.bzl
index 1584333d..c0ea2c4c 100644
--- a/rules/partitions/partition.bzl
+++ b/rules/partitions/partition.bzl
@@ -161,6 +161,7 @@ def _partition_impl(ctx):
toolchain.e2fsdroid[DefaultInfo].files_to_run,
toolchain.fec[DefaultInfo].files_to_run,
toolchain.mke2fs[DefaultInfo].files_to_run,
+ toolchain.mkfs_erofs[DefaultInfo].files_to_run,
toolchain.mkuserimg_mke2fs[DefaultInfo].files_to_run,
toolchain.simg2img[DefaultInfo].files_to_run,
toolchain.tune2fs[DefaultInfo].files_to_run,
diff --git a/rules/partitions/toolchain.bzl b/rules/partitions/toolchain.bzl
index 9bdc8290..644bffbc 100644
--- a/rules/partitions/toolchain.bzl
+++ b/rules/partitions/toolchain.bzl
@@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+"""
+The toolchain used by the partition rule.
+"""
+
PartitionToolchainInfo = provider(
doc = "Partitions toolchain",
fields = [
@@ -20,6 +24,7 @@ PartitionToolchainInfo = provider(
"e2fsdroid",
"fec",
"mke2fs",
+ "mkfs_erofs",
"mkuserimg_mke2fs",
"openssl",
"simg2img",
@@ -36,6 +41,7 @@ def _partition_toolchain_impl(ctx):
e2fsdroid = ctx.attr.e2fsdroid,
fec = ctx.attr.fec,
mke2fs = ctx.attr.mke2fs,
+ mkfs_erofs = ctx.attr.mkfs_erofs,
mkuserimg_mke2fs = ctx.attr.mkuserimg_mke2fs,
openssl = ctx.file.openssl,
simg2img = ctx.attr.simg2img,
@@ -53,6 +59,7 @@ partition_toolchain = rule(
"e2fsdroid": attr.label(cfg = "exec", executable = True, mandatory = True),
"fec": attr.label(cfg = "exec", executable = True, mandatory = True),
"mke2fs": attr.label(cfg = "exec", executable = True, mandatory = True),
+ "mkfs_erofs": attr.label(cfg = "exec", executable = True, mandatory = True),
"mkuserimg_mke2fs": attr.label(cfg = "exec", executable = True, mandatory = True),
"openssl": attr.label(allow_single_file = True, cfg = "exec", mandatory = True),
"simg2img": attr.label(cfg = "exec", executable = True, mandatory = True),