blob: fe662c8b4f2fb5965e0ea1860eac4f046666252a [file] [log] [blame]
// Copyright 2022 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.
{
include: [
"//src/lib/fuchsia-hyper/hyper.shard.cml",
"//src/storage/lib/fs_management/client.shard.cml",
"inspect/client.shard.cml",
"syslog/client.shard.cml",
],
program: {
runner: "elf",
binary: "bin/system_recovery_ota",
forward_stderr_to: "log",
forward_stdout_to: "log",
},
children: [
{
name: "pkg-recovery",
url: "#meta/pkg.cm",
},
],
capabilities: [
// Declare that system_recovery_ota has a directory capability for blobfs.
{
directory: "primary-system-blobfs",
rights: [
"execute",
"rw*",
],
// system_recovery_ota mounts blob at /blob in its outgoing directory.
path: "/blob",
},
// Renamed versions of config-data and root-ssl-certificates so that this component
// can consume the real ones from its parent but override them for pkg-recovery if required.
{
directory: "config-data-override",
rights: [ "r*" ],
path: "/config/data",
},
{
directory: "root-ssl-certificates-override",
rights: [ "r*" ],
path: "/config/ssl",
},
{
directory: "build-info-override",
rights: [ "r*" ],
path: "/config/build-info",
},
],
use: [
{
directory: "root-ssl-certificates",
from: "parent",
rights: [ "r*" ],
path: "/config/ssl",
},
{
directory: "dev-class-block",
rights: [ "r*" ],
path: "/dev/class/block",
},
{
directory: "config-data",
rights: [ "r*" ],
path: "/config/data",
},
{
storage: "tmp",
path: "/tmp",
},
{
protocol: [ "fuchsia.update.installer.Installer" ],
from: "#pkg-recovery",
},
{
protocol: [
"fuchsia.boot.Arguments",
"fuchsia.boot.WriteOnlyLog",
"fuchsia.buildinfo.Provider",
"fuchsia.fshost.Admin",
"fuchsia.logger.LogSink",
"fuchsia.net.name.Lookup",
"fuchsia.paver.Paver",
"fuchsia.posix.socket.Provider",
"fuchsia.process.Launcher",
"fuchsia.recovery.FactoryReset",
"fuchsia.recovery.ui.ProgressRenderer",
"fuchsia.tracing.provider.Registry",
],
},
],
offer: [
{
protocol: "fuchsia.device.manager.Administrator",
from: "parent",
to: "#fs-collection",
},
// Offer directories from system_recovery_ota to pkg-recovery child (inherit rights from system_recovery_ota).
{
directory: "primary-system-blobfs",
from: "self",
as: "blob-exec",
to: "#pkg-recovery",
dependency: "weak",
},
{
directory: "config-data-override",
from: "self",
as: "config-data",
to: "#pkg-recovery",
dependency: "weak",
},
{
directory: "root-ssl-certificates-override",
from: "self",
as: "root-ssl-certificates",
to: "#pkg-recovery",
dependency: "weak",
},
{
directory: "build-info-override",
from: "self",
as: "build-info",
to: "#pkg-recovery",
dependency: "weak",
},
// Offer other protocols that pkg-recovery expects.
{
protocol: [
"fuchsia.boot.Arguments",
"fuchsia.cobalt.LoggerFactory",
"fuchsia.logger.LogSink",
"fuchsia.metrics.MetricEventLoggerFactory",
"fuchsia.net.name.Lookup",
"fuchsia.paver.Paver",
"fuchsia.posix.socket.Provider",
"fuchsia.tracing.provider.Registry",
],
from: "parent",
to: "#pkg-recovery",
},
],
expose: [
{
// Expose binder to allow system_recovery to launch OTA.
protocol: "fuchsia.component.Binder",
from: "framework",
},
],
}