Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmdlib.sh: Switch to using OSTree layers for overlay/ #555

Merged
merged 4 commits into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions src/build_rpm_from_dir

This file was deleted.

23 changes: 15 additions & 8 deletions src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ runcompose() {
local overridesdir=${workdir}/overrides
local tmp_overridesdir=${TMPDIR}/override
local override_manifest="${tmp_overridesdir}"/coreos-assembler-override-manifest.yaml

local git_timestamp="January 1 1970"
if [ -d "${configdir_gitrepo}/.git" ]; then
git_timestamp=$(git -C "${configdir_gitrepo}" show -s --format=%ci HEAD)
fi
if [ -d "${overridesdir}" ] || [ -n "${ref_is_temp}" ] || [ -d "${configdir}/overlay" ]; then
mkdir "${tmp_overridesdir}"
cat > "${override_manifest}" <<EOF
Expand All @@ -254,13 +259,14 @@ EOF
echo 'ref: "'"${ref}"'"' >> "${override_manifest}"
fi
if [ -d "${configdir}/overlay" ]; then
echo -n "Committing ${configdir}/overlay... "
ostree commit --repo="${tmprepo}" --tree=dir="${configdir}/overlay" -b "${name}-config-overlay" \
--owner-uid 0 --owner-gid 0 --no-xattrs --no-bindings --parent=none \
--timestamp "${git_timestamp}"
jlebon marked this conversation as resolved.
Show resolved Hide resolved
cat >> "${override_manifest}" <<EOF
packages:
- ${name}-overlay
ostree-layers:
- ${name}-config-overlay
EOF
mkdir -p "${overridesdir}"/rpm
mkdir tmp/overlay-build
(cd tmp/overlay-build && "${DIR}"/build_rpm_from_dir "${configdir}/overlay" "${name}-overlay" "${workdir}/overrides/rpm")
fi
if [[ -n $(ls "${overridesdir}/rpm/"*.rpm 2> /dev/null) ]]; then
(cd "${overridesdir}"/rpm && createrepo_c .)
Expand All @@ -278,9 +284,10 @@ EOF
fi
rootfs_overlay="${overridesdir}/rootfs"
if [ -d "${rootfs_overlay}" ]; then
echo "Committing ${rootfs_overlay}"
sudo ostree commit --repo="${workdir}/tmp/repo" --tree=dir="${rootfs_overlay}" -b cosa-bin-overlay \
--owner-uid 0 --owner-gid 0 --no-xattrs --no-bindings --parent=none
echo -n "Committing ${rootfs_overlay}... "
ostree commit --repo="${tmprepo}" --tree=dir="${rootfs_overlay}" -b cosa-bin-overlay \
jlebon marked this conversation as resolved.
Show resolved Hide resolved
--owner-uid 0 --owner-gid 0 --no-xattrs --no-bindings --parent=none \
--timestamp "${git_timestamp}"
cat >> "${override_manifest}" << EOF
ostree-override-layers:
- cosa-bin-overlay
Expand Down