Skip to content

Commit 9ab9980

Browse files
woody77Commit Bot
authored andcommitted
[assembly] Include blobs in assembly input bundle pkg and tgz
Include the blobs as well as the pkg manifests and other files in the assembly input bundle's package, and the archive of that package. Change-Id: Ibb1ef84d64a5629900779d92d45b410e53ce0e4f Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/638638 Fuchsia-Auto-Submit: Aaron Wood <[email protected]> Reviewed-by: Christopher Crawford <[email protected]> Reviewed-by: Aidan Wolter <[email protected]> Commit-Queue: Auto-Submit <[email protected]>
1 parent 6abec27 commit 9ab9980

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

build/assembly/scripts/make_legacy_config.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ def copy_to_assembly_input_bundle(
9191
all_blobs[merkle] = source
9292

9393
# Copy all the blobs to their dir in the out-of-tree layout
94-
blob_deps = copy_blobs(all_blobs, outdir)
94+
(all_blobs, blob_deps) = copy_blobs(all_blobs, outdir)
9595
deps.update(blob_deps)
96+
result.blobs = set([os.path.relpath(blob_path, outdir) for blob_path in all_blobs])
9697

9798
# Copy the bootfs entries
9899
(bootfs,
@@ -179,12 +180,13 @@ def copy_packages(
179180
return (packages, blobs, deps)
180181

181182

182-
def copy_blobs(blobs: Dict[Merkle, FilePath], outdir: FilePath) -> DepSet:
183+
def copy_blobs(blobs: Dict[Merkle, FilePath], outdir: FilePath) -> Tuple[List[FilePath], DepSet]:
184+
blob_paths: List[FilePath] = []
183185
deps: DepSet = set()
184186

185187
# Bail early if empty
186188
if len(blobs) == 0:
187-
return deps
189+
return (blob_paths, deps)
188190

189191
# Create the directory for the blobs, now that we know it will exist.
190192
blobs_dir = os.path.join(outdir, "blobs")
@@ -193,10 +195,12 @@ def copy_blobs(blobs: Dict[Merkle, FilePath], outdir: FilePath) -> DepSet:
193195
# Copy all blobs
194196
for (merkle, source) in blobs.items():
195197
blob_destination = os.path.join(blobs_dir, merkle)
198+
blob_paths.append(blob_destination)
196199
fast_copy(source, blob_destination)
197200
deps.add(source)
198201

199-
return deps
202+
return (blob_paths, deps)
203+
200204

201205

202206
def copy_file_entries(entries: FileEntrySet, outdir: FilePath,

build/python/modules/assembly/assembly_input_bundle.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"""
1111
import json
1212
import os
13-
from typing import Dict, List, Set, TextIO
13+
from typing import Dict, List, Set, TextIO, Union
1414

1515
from depfile.depfile import FilePath
1616

@@ -86,6 +86,7 @@ class AssemblyInputBundle(ImageAssemblyConfig):
8686
def __init__(self) -> None:
8787
super().__init__()
8888
self.config_data: ConfigDataEntries = {}
89+
self.blobs: Union[None, Set[FilePath]] = None
8990

9091
@classmethod
9192
def from_dict(cls, dict: Dict) -> 'AssemblyInputBundle':
@@ -124,7 +125,7 @@ def __repr__(self) -> str:
124125

125126
def intersection(
126127
self, other: 'AssemblyInputBundle') -> 'AssemblyInputBundle':
127-
"""Return the intersection of the two ImageAssemblyConfiguration's
128+
"""Return the intersection of the two 'ImageAssemblyConfiguration's
128129
"""
129130
result = super().intersection(other)
130131
config_data: ConfigDataEntries = {}
@@ -139,7 +140,7 @@ def intersection(
139140
return result
140141

141142
def difference(self, other: 'AssemblyInputBundle') -> 'AssemblyInputBundle':
142-
"""Return the difference of the two ImageAssemblyConfiguration's
143+
"""Return the difference of the two 'ImageAssemblyConfiguration's
143144
"""
144145
result = super().difference(other)
145146
for (package, entries) in self.config_data.items():
@@ -163,6 +164,8 @@ def all_file_paths(self) -> List[FilePath]:
163164
file_paths.append(self.kernel.path)
164165
for entries in self.config_data.values():
165166
file_paths.extend([entry.source for entry in entries])
167+
if self.blobs is not None:
168+
file_paths.extend(self.blobs)
166169
return file_paths
167170

168171
def write_fini_manifest(

0 commit comments

Comments
 (0)