Skip to content

Commit

Permalink
Draft PR for shipping docker sysext
Browse files Browse the repository at this point in the history
  • Loading branch information
krishjainx committed Jul 7, 2023
1 parent 19dcded commit 982289a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
28 changes: 8 additions & 20 deletions build_library/build_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -625,26 +625,14 @@ finish_image() {
local install_grub=0
local disk_img="${BUILD_DIR}/${image_name}"

# Copy in packages from the torcx store that are marked as being on disk
if [ -n "${FLAGS_torcx_manifest}" ]; then
for pkg in $(torcx_manifest::get_pkg_names "${FLAGS_torcx_manifest}"); do
local default_version="$(torcx_manifest::default_version "${FLAGS_torcx_manifest}" "${pkg}")"
for version in $(torcx_manifest::get_versions "${FLAGS_torcx_manifest}" "${pkg}"); do
local on_disk_path="$(torcx_manifest::local_store_path "${FLAGS_torcx_manifest}" "${pkg}" "${version}")"
if [[ -n "${on_disk_path}" ]]; then
local casDigest="$(torcx_manifest::get_digest "${FLAGS_torcx_manifest}" "${pkg}" "${version}")"
sudo cp "${FLAGS_torcx_root}/pkgs/${BOARD}/${pkg}/${casDigest}/${pkg}:${version}.torcx.tgz" \
"${root_fs_dir}${on_disk_path}"
sudo tar xf "${root_fs_dir}${on_disk_path}" -C "${root_fs_dir}" --wildcards "./usr/share/SLSA"
if [[ "${version}" == "${default_version}" ]]; then
# Create the default symlink for this package
sudo ln -fns "${on_disk_path##*/}" \
"${root_fs_dir}/${on_disk_path%/*}/${pkg}:com.coreos.cl.torcx.tgz"
fi
fi
done
done
fi
# Ship docker sysext (WIP)
emerge-amd64-usr app-containers/docker
sudo "$(dirname ${BASH_SOURCE[0]})/../build_sysext" --board="${BOARD}" --build_dir=${BUILD_DIR} --squashfs_base="${BUILD_DIR}/${image_sysext_base}" docker-flatcar app-containers/docker
sudo install -m 0644 -D "${BUILD_DIR}/docker-flatcar.raw" "${root_fs_dir}"/usr/share/flatcar/
sudo mkdir -p "${root_fs_dir}"/etc/extensions/
#sudo ln -sf "${root_fs_dir}"/usr/share/flatcar/docker-flatcar.raw "${root_fs_dir}"/etc/extensions/docker-flatcar.raw
sudo cp "${root_fs_dir}"/usr/share/flatcar/docker-flatcar.raw "${root_fs_dir}"/etc/extensions/docker-flatcar.raw


# Only enable rootfs verification on prod builds.
local disable_read_write="${FLAGS_FALSE}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ RDEPEND="${RDEPEND}
app-arch/xz-utils
app-arch/zstd
app-arch/tar
app-arch/torcx
app-arch/unzip
app-arch/zip
app-arch/ncompress
Expand Down

0 comments on commit 982289a

Please sign in to comment.