[assembly] Add starnix subsystem in assembly config
Bug: 120686
Change-Id: Ie8a13ac976efe7896faf1adb5e44bf86b170c388
Reviewed-on: https://fuchsia-review.googlesource.com/c/sdk-integration/+/793922
Fuchsia-Auto-Submit: Aidan Wolter <awolter@google.com>
Reviewed-by: Jiaming Li <lijiaming@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
diff --git a/bazel_rules_fuchsia/fuchsia/assembly.bzl b/bazel_rules_fuchsia/fuchsia/assembly.bzl
index f90fd50..8b5161e 100644
--- a/bazel_rules_fuchsia/fuchsia/assembly.bzl
+++ b/bazel_rules_fuchsia/fuchsia/assembly.bzl
@@ -38,6 +38,10 @@
_fuchsia_platform_development_support_configuration = "fuchsia_platform_development_support_configuration",
)
load(
+ "//fuchsia/private/assembly:fuchsia_platform_starnix_configuration.bzl",
+ _fuchsia_platform_starnix_configuration = "fuchsia_platform_starnix_configuration",
+)
+load(
"//fuchsia/private/assembly:fuchsia_platform_identity_configuration.bzl",
_FEATURE_CONTROL = "FEATURE_CONTROL",
_fuchsia_platform_identity_configuration = "fuchsia_platform_identity_configuration",
@@ -155,6 +159,7 @@
fuchsia_platform_connectivity_wlan_configuration = _fuchsia_platform_connectivity_wlan_configuration
fuchsia_platform_diagnostics_configuration = _fuchsia_platform_diagnostics_configuration
fuchsia_platform_development_support_configuration = _fuchsia_platform_development_support_configuration
+fuchsia_platform_starnix_configuration = _fuchsia_platform_starnix_configuration
fuchsia_product_configuration = _fuchsia_product_configuration
fuchsia_board_configuration = _fuchsia_board_configuration
fuchsia_product_image = _fuchsia_product_image
@@ -168,6 +173,7 @@
fuchsia_filesystem_empty_account = _fuchsia_filesystem_empty_account
fuchsia_filesystem_minfs = _fuchsia_filesystem_minfs
fuchsia_filesystem_empty_data = _fuchsia_filesystem_empty_data
+
# TODO(fxbug.dev/85134): Remove when in-tree Bazel configuration is updated to
# use `fuchsia_filesystem_empty_data`.
fuchsia_filesystem_empty_minfs = _fuchsia_filesystem_empty_minfs
diff --git a/bazel_rules_fuchsia/fuchsia/private/assembly/fuchsia_platform_starnix_configuration.bzl b/bazel_rules_fuchsia/fuchsia/private/assembly/fuchsia_platform_starnix_configuration.bzl
new file mode 100644
index 0000000..d1d3426
--- /dev/null
+++ b/bazel_rules_fuchsia/fuchsia/private/assembly/fuchsia_platform_starnix_configuration.bzl
@@ -0,0 +1,23 @@
+# Copyright 2023 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+load(":providers.bzl", "FuchsiaStarnixConfigInfo")
+
+def _fuchsia_platform_starnix_configuration_impl(ctx):
+ return [
+ FuchsiaStarnixConfigInfo(
+ enabled = ctx.attr.enabled,
+ ),
+ ]
+
+fuchsia_platform_starnix_configuration = rule(
+ doc = """Generates a starnix configuration.""",
+ implementation = _fuchsia_platform_starnix_configuration_impl,
+ provides = [FuchsiaStarnixConfigInfo],
+ attrs = {
+ "enabled": attr.bool(
+ doc = "Whether starnix support should be included",
+ ),
+ },
+)
diff --git a/bazel_rules_fuchsia/fuchsia/private/assembly/fuchsia_product_configuration.bzl b/bazel_rules_fuchsia/fuchsia/private/assembly/fuchsia_product_configuration.bzl
index 3370acd..f89a22a 100644
--- a/bazel_rules_fuchsia/fuchsia/private/assembly/fuchsia_product_configuration.bzl
+++ b/bazel_rules_fuchsia/fuchsia/private/assembly/fuchsia_product_configuration.bzl
@@ -12,6 +12,7 @@
"FuchsiaIdentityConfigInfo",
"FuchsiaInputConfigInfo",
"FuchsiaProductConfigInfo",
+ "FuchsiaStarnixConfigInfo",
)
load("//fuchsia/private:providers.bzl", "FuchsiaPackageInfo")
@@ -65,6 +66,8 @@
}
if ctx.attr.development_support != None:
platform["development_support"] = ctx.attr.development_support[FuchsiaDevelopmentSupportConfigInfo]
+ if ctx.attr.starnix != None:
+ platform["starnix"] = ctx.attr.starnix[FuchsiaStarnixConfigInfo]
if ctx.attr.diagnostics != None:
diagnostics_config = ctx.attr.diagnostics[FuchsiaDiagnosticsConfigInfo]
platform["diagnostics"] = diagnostics_config
@@ -236,6 +239,11 @@
providers = [FuchsiaDevelopmentSupportConfigInfo],
default = None,
),
+ "starnix": attr.label(
+ doc = "Starnix Configuration.",
+ providers = [FuchsiaStarnixConfigInfo],
+ default = None,
+ ),
"base_packages": attr.label_list(
doc = "Fuchsia packages to be included in base.",
providers = [
diff --git a/bazel_rules_fuchsia/fuchsia/private/assembly/providers.bzl b/bazel_rules_fuchsia/fuchsia/private/assembly/providers.bzl
index 9e7fa69..c247e33 100644
--- a/bazel_rules_fuchsia/fuchsia/private/assembly/providers.bzl
+++ b/bazel_rules_fuchsia/fuchsia/private/assembly/providers.bzl
@@ -44,6 +44,13 @@
},
)
+FuchsiaStarnixConfigInfo = provider(
+ doc = "Platform starnix options for the starnix area.",
+ fields = {
+ "enabled": "Whether starnix support should be included",
+ },
+)
+
FuchsiaConnectivityConfigInfo = provider(
doc = "Platform configuration options for the connectivity area.",
fields = {