Debian: build-image support debian_iso_image.inc

We plan to break down the huge file "stx-std.lst" to
debian_iso_image.inc in each respository.

This is the first step that build-image add the packages in
debian_iso_image.inc to yaml_doc['packages'] after adding the packages
in "stx-std.lst".

Test Plan:

Pass: build-image, all packages in existing debian_iso_image.inc files
are already in "stx-std.lst", so no change to ISO image.

Story: 2008846
Task: 46141

Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
Change-Id: I6c3fea78a1c22592f608551fee0a332809352423
This commit is contained in:
Yue Tao 2022-08-27 18:54:48 +08:00 committed by Yue Tao
parent 0b16615328
commit a61301b4a9
2 changed files with 23 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import yaml
STX_DEFAULT_DISTRO = discovery.STX_DEFAULT_DISTRO
ALL_LAYERS = discovery.get_all_layers(distro=STX_DEFAULT_DISTRO)
ALL_BUILD_TYPES = discovery.get_all_build_types(distro=STX_DEFAULT_DISTRO)
LAT_ROOT = '/localdisk'
REPO_ALL = 'deb-merge-all'
@ -289,6 +290,11 @@ def add_lat_packages(img_yaml, packages):
with open(img_yaml) as f:
yaml_doc = yaml.safe_load(f)
yaml_doc['packages'].extend(packages)
for build_type in ALL_BUILD_TYPES:
pkgs = discovery.package_iso_list(distro=STX_DEFAULT_DISTRO, layer="all", build_type=build_type)
yaml_doc['packages'].extend(pkgs)
yaml_doc['packages'] = list(set(yaml_doc['packages']))
yaml_doc['packages'].sort()

View File

@ -185,6 +185,23 @@ def package_dir_list_handler(entry, proj_dir):
return []
return [ path ]
def package_iso_list (distro="debian", layer="all", build_type="std", skip_non_buildable=True):
pkg_iso_list = []
if layer is None:
layer = "all"
for proj_dir in project_dir_list(distro=distro, layer=layer, skip_non_buildable=skip_non_buildable):
iso_file = os.path.join(proj_dir, "%s%s%s%s" % (distro, "_iso_image_", build_type, ".inc"))
if not os.path.isfile(iso_file):
if build_type == "std":
# It's permitted to omit the "_std" suffix from the file name
iso_file = os.path.join(proj_dir, "%s%s" % (distro, "_iso_image.inc"))
if not os.path.isfile(iso_file):
continue
pkg_iso_list.extend(bc_safe_fetch(iso_file))
return pkg_iso_list
def package_dir_list (distro="debian", layer="all", build_type="std", skip_non_buildable=True):
pkg_dir_list = []
if layer is None: