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

[rhcos-4.8] cmdlib: support statoverride file in root of an overlay.d directory #2297

Merged
merged 1 commit into from
Jul 16, 2021
Merged
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
16 changes: 14 additions & 2 deletions src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,26 @@ prepare_build() {
}

commit_overlay() {
local name path respath
local name path respath ovrsrc ovrrelsrc
name=$1
path=$2
respath=$(realpath "${path}")
# Apply statoverrides from a file in the root of the overlay, which may
# or may not exist. ostree doesn't support comments in statoverride
# files, but we do.
if [ -e "${respath}/statoverride" ]; then
ovrsrc="${respath}/statoverride"
ovrrelsrc=/statoverride
else
ovrsrc=/dev/null
ovrrelsrc=
fi
echo -n "Committing ${name}: ${path} ... "
ostree commit --repo="${tmprepo}" --tree=dir="${respath}" -b "${name}" \
--owner-uid 0 --owner-gid 0 --no-xattrs --no-bindings --parent=none \
--mode-ro-executables --timestamp "${git_timestamp}"
--mode-ro-executables --timestamp "${git_timestamp}" \
--statoverride <(sed -e '/^#/d' "$ovrsrc") \
--skip-list <(echo "$ovrrelsrc")
}

# Implement support for automatic local overrides:
Expand Down