Skip to content

Commit

Permalink
[assembly] Complete removal of product_include_updates_in_blobfs
Browse files Browse the repository at this point in the history
product_include_updates_in_blobfs deprecation step (4).

We are in the process of removing product_include_updates_in_blobfs.
This flag is used to put the update package in blobfs at assembly time,
which ensures that the device can take an OTA by reserving that space.

Now that we have the max_blob_contents_size flag, we can be confident
that we will not go over budget.

The deprecation is as follows:

(client repos)
1. Explicitly set the flag on all smart products to false &&
   Reduce budget for blobfs to ensure OTAs are possible
   (this removes update package from blobfs safely)

fuchsia.git
2. Change the default state of the flag to `false`
   (allows us to remove usage of the flag in clients)

(client repos)
3. Remove usage of the flag

fuchsia.git
4. Remove the flag and usage in fuchsia.git

Bug: 58645
Change-Id: Ic13582b5746bd4bf5defc72a9a3b99061672e473
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/549964
Commit-Queue: Aidan Wolter <[email protected]>
Reviewed-by: David Turner <[email protected]>
Reviewed-by: Aaron Wood <[email protected]>
  • Loading branch information
aidanwolter3 authored and CQ Bot committed Jul 20, 2021
1 parent c3b80be commit 08b58a4
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 42 deletions.
3 changes: 0 additions & 3 deletions build/images/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,6 @@ collect_blob_manifest("blob.manifest") {
":system_image.meta",
pkgfs_package_label,
]
if (product_include_updates_in_blobfs) {
deps += [ ":update.meta" ]
}
}

blob_image_path = "$target_out_dir/blob.blk"
Expand Down
1 change: 0 additions & 1 deletion build/images/assembly/generated_board_config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ template("generated_board_config") {

blobfs = {
layout = blob_layout_format
include_update_package = product_include_updates_in_blobfs
}

if (uses_base_package) {
Expand Down
5 changes: 0 additions & 5 deletions build/product.gni
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ declare_args() {
# A list of binary labels to include in the system_image package.
product_system_image_deps = []

# Include update package in blob.blk. Some products may not need the update
# package included as part of the blobfs.
# TODO(fxbug.dev/58645) Remove when no longer needed.
product_include_updates_in_blobfs = false

# The following arguments are all used to configure the contents of the core
# component realm. See //src/sys/core/build/core.gni for documentation on what
# each field means.
Expand Down
18 changes: 2 additions & 16 deletions src/developer/ffx/plugins/assembly/src/blobfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use crate::base_package::BasePackage;
use crate::config::{BlobFSConfig, ProductConfig};
use crate::update_package::UpdatePackage;

use anyhow::{Context, Result};
use assembly_blobfs::BlobFSBuilder;
Expand All @@ -16,7 +15,6 @@ pub fn construct_blobfs(
product: &ProductConfig,
blobfs_config: &BlobFSConfig,
base_package: &BasePackage,
update_package: Option<&UpdatePackage>,
) -> Result<PathBuf> {
let mut blobfs_builder = BlobFSBuilder::new(&blobfs_config.layout);
blobfs_builder.set_compressed(blobfs_config.compress);
Expand All @@ -35,14 +33,6 @@ pub fn construct_blobfs(
blobfs_builder.add_file(source)?;
}

// Add the update package and its contents.
if let Some(update_package) = update_package {
blobfs_builder.add_file(&update_package.path)?;
for (_, source) in &update_package.contents {
blobfs_builder.add_file(source)?;
}
}

// Build the blobfs and return its path.
let blobfs_path = outdir.as_ref().join("blob.blk");
blobfs_builder.build(gendir, &blobfs_path).context("Failed to build the blobfs")?;
Expand All @@ -63,11 +53,7 @@ mod tests {
fn construct() {
let dir = tempdir().unwrap();
let product_config = ProductConfig::default();
let blobfs_config = BlobFSConfig {
layout: "padded".to_string(),
include_update_package: true,
compress: true,
};
let blobfs_config = BlobFSConfig { layout: "padded".to_string(), compress: true };

// Create a fake base package.
let base_path = dir.path().join("base.far");
Expand All @@ -81,7 +67,7 @@ mod tests {
path: base_path,
};
let blobfs_path =
construct_blobfs(dir.path(), dir.path(), &product_config, &blobfs_config, &base, None)
construct_blobfs(dir.path(), dir.path(), &product_config, &blobfs_config, &base)
.unwrap();
assert_eq!(blobfs_path, dir.path().join("blob.blk"));
}
Expand Down
5 changes: 0 additions & 5 deletions src/developer/ffx/plugins/assembly/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,6 @@ pub struct BlobFSConfig {
#[serde(default = "default_blob_layout")]
pub layout: String,

/// Whether to include the update package in blobfs in order to reserve
/// space. This is usually to ensure that OTAs are possible.
#[serde(default = "default_true")]
pub include_update_package: bool,

#[serde(default = "default_true")]
pub compress: bool,
}
Expand Down
14 changes: 2 additions & 12 deletions src/developer/ffx/plugins/assembly/src/operations/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub fn assemble(args: ImageArgs) -> Result<()> {
};

info!("Creating the update package");
let update_package: UpdatePackage = construct_update(
let _update_package: UpdatePackage = construct_update(
&outdir,
&gendir,
&product,
Expand All @@ -68,17 +68,7 @@ pub fn assemble(args: ImageArgs) -> Result<()> {

let blobfs_path: Option<PathBuf> = if let Some(base_package) = &base_package {
info!("Creating the blobfs");
// Include the update package in blobfs if necessary.
let update_package =
if board.blobfs.include_update_package { Some(&update_package) } else { None };
Some(construct_blobfs(
&outdir,
&gendir,
&product,
&board.blobfs,
&base_package,
update_package,
)?)
Some(construct_blobfs(&outdir, &gendir, &product, &board.blobfs, &base_package)?)
} else {
info!("Skipping blobfs creation");
None
Expand Down

0 comments on commit 08b58a4

Please sign in to comment.