mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 21:16:57 +02:00
build scripts: separate txt inventory; official naming for sysexts
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This commit is contained in:
parent
e85ca4984c
commit
6f651a298c
@ -33,8 +33,8 @@ DEFINE_string base_pkg "coreos-base/coreos" \
|
||||
"The base portage package to base the build off of (only applies to prod images)"
|
||||
DEFINE_string base_dev_pkg "coreos-base/coreos-dev" \
|
||||
"The base portage package to base the build off of (only applies to dev containers)"
|
||||
DEFINE_string base_sysexts "app-containers/containerd,app-containers/docker" \
|
||||
"Comma-separated list of packages to build into sysexts and include with OS image and update payload. Must be in order of dependencies, base sysexts come first."
|
||||
DEFINE_string base_sysexts "containerd-flatcar:app-containers/containerd,docker-flatcar:app-containers/docker" \
|
||||
"Comma-separated list of name:package - build 'package' into sysext 'name', and include with OS image and update payload. Must be in order of dependencies, base sysexts come first."
|
||||
DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \
|
||||
"Directory in which to place image result directories (named by version)"
|
||||
DEFINE_string disk_layout "" \
|
||||
|
@ -179,30 +179,6 @@ EOF
|
||||
"${image_initrd_contents_wtd}" \
|
||||
"${image_disk_usage}"
|
||||
|
||||
# append sysext inventories to image contents files.
|
||||
if [[ -n "${base_sysexts}" ]] ; then
|
||||
local inventory_file="" image_basename="${image_name%.bin}"
|
||||
|
||||
for inventory_file in "${image_contents}" "${image_contents_wtd}" "${image_disk_usage}" "${image_packages}" ; do
|
||||
local suffix="${inventory_file/${image_basename}/}" sysext=""
|
||||
|
||||
info "Processing '${inventory_file}'"
|
||||
|
||||
for sysext in ${base_sysexts//,/ }; do
|
||||
local name="${sysext//\//_}"
|
||||
local sysext_inventory="${root_fs_sysexts_output_dir}/${name}${suffix}"
|
||||
if [[ ! -f "${sysext_inventory}" ]] ; then
|
||||
die "Sysext inventory file '${sysext//\//_}${suffix}' for '${inventory_file}' not found in '${root_fs_sysexts_output_dir}'"
|
||||
fi
|
||||
info "Adding sysext inventory '${name}${suffix}' to '${inventory_file}'"
|
||||
{
|
||||
echo -e "\n\n### Sysext ${name}.raw\n"
|
||||
cat "${sysext_inventory}"
|
||||
} >> "${BUILD_DIR}/${inventory_file}"
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
# Upload
|
||||
local to_upload=(
|
||||
"${BUILD_DIR}/${image_contents}"
|
||||
@ -220,6 +196,24 @@ EOF
|
||||
"${BUILD_DIR}/${image_sysext_base}"
|
||||
)
|
||||
|
||||
# append sysext inventories to uploads
|
||||
if [[ -n "${base_sysexts}" ]] ; then
|
||||
local inventory_file="" image_basename="${image_name%.bin}"
|
||||
|
||||
for inventory_file in "${image_contents}" "${image_contents_wtd}" "${image_disk_usage}" "${image_packages}" ; do
|
||||
local suffix="${inventory_file/${image_basename}/}" sysext=""
|
||||
|
||||
for sysext in ${base_sysexts//,/ }; do
|
||||
local name="${sysext%:*}"
|
||||
local sysext_inventory="${root_fs_sysexts_output_dir}/${name}${suffix}"
|
||||
if [[ ! -f "${sysext_inventory}" ]] ; then
|
||||
die "Sysext inventory file '${name}${suffix}' for '${inventory_file}' not found in '${root_fs_sysexts_output_dir}'"
|
||||
fi
|
||||
to_upload+=( "${sysext_inventory}" )
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
local files_to_evaluate=( "${BUILD_DIR}/${image_name}" )
|
||||
declare -a compressed_images
|
||||
declare -a extra_files
|
||||
|
@ -29,14 +29,14 @@ create_prod_sysext() {
|
||||
local workdir="$3"
|
||||
local base_sysext="$4"
|
||||
local install_root="$5"
|
||||
local grp_pkg="$6"
|
||||
local pkginfo="${7:-}"
|
||||
local name="$6"
|
||||
local grp_pkg="$7"
|
||||
local pkginfo="${8:-}"
|
||||
|
||||
local name="${grp_pkg//\//_}" # some-group/some-package => some-group_some-package
|
||||
local pkginfo_opt=""
|
||||
local manglefs_opt=""
|
||||
|
||||
local msg="Creating sysext '${grp_pkg}' ==> ${name}.raw"
|
||||
local msg="Installing ${grp_pkg}' in sysext ${name}.raw"
|
||||
|
||||
# Include previous sysexts' pkginfo if supplied
|
||||
if [[ -n "${pkginfo}" ]] ; then
|
||||
@ -107,15 +107,18 @@ sudo mksquashfs "${root_fs_dir}" "${sysext_base}" -noappend
|
||||
# for combined overlay later.
|
||||
prev_pkginfo=""
|
||||
sysext_lowerdirs="${sysext_mountdir}/rootfs-lower"
|
||||
for grp_pkg in ${sysexts_list//,/ }; do
|
||||
for sysext in ${sysexts_list//,/ }; do
|
||||
# format is "<name>:<group>/<package>"
|
||||
name="${sysext%:*}"
|
||||
grp_pkg="${sysext#*:}"
|
||||
create_prod_sysext "${BOARD}" \
|
||||
"${sysext_output_dir}" \
|
||||
"${sysext_workdir}" \
|
||||
"${sysext_base}" \
|
||||
"${root_fs_dir}"\
|
||||
"${name}" \
|
||||
"${grp_pkg}" \
|
||||
"${prev_pkginfo}"
|
||||
name="${grp_pkg//\//_}"
|
||||
|
||||
mkdir -p "${sysext_mountdir}/${name}" \
|
||||
"${sysext_mountdir}/${name}_pkginfo"
|
||||
|
Loading…
Reference in New Issue
Block a user