Skip to content

Commit

Permalink
RPM: Update config file patching
Browse files Browse the repository at this point in the history
`rpm/update-config-files.sh` has now been simplified and will now fail
if a pattern is not found instead of inserting a rule by default.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
  • Loading branch information
lsm5 committed Sep 4, 2024
1 parent 08f9c11 commit 5176a65
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions rpm/update-config-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,19 @@ ensure() {
then
sed -i "/^#.*$2[[:blank:]].*=/a \
$2 = $3" $1
else
echo "$2 = $3" >> $1
fi
fi
}

# Common options enabled across all fedora, centos, rhel
# TBD: Can these be enabled by default upstream?
ensure registries.conf short-name-mode \"enforcing\"
echo 'short-name-mode="enforcing"' >> registries.conf

ensure storage.conf driver \"overlay\"
ensure storage.conf mountopt \"nodev,metacopy=on\"

ensure pkg/config/containers.conf runtime \"crun\"
ensure pkg/config/containers.conf log_driver \"journald\"

# Enable seccomp support keyctl and socketcall
grep -q \"keyctl\", pkg/seccomp/seccomp.json || sed -i '/\"kill\",/i \
"keyctl",' pkg/seccomp/seccomp.json
# Enable seccomp support socketcall
grep -q \"socket\", pkg/seccomp/seccomp.json || sed -i '/\"socketcall\",/i \
"socket",' pkg/seccomp/seccomp.json

Expand All @@ -54,11 +48,8 @@ if [[ -n "$FEDORA" ]] || [[ "$RHEL" -ge 10 ]]; then
sed -i -e '/^additionalimagestores\ =\ \[/a "\/usr\/lib\/containers\/storage",' storage.conf
fi

# Set these on Fedora Rawhide (41+) and RHEL 10+
# Set these on Fedora 41+ and RHEL 10+
# regardless of distro
if [[ "$FEDORA" -gt 40 ]] || [[ "$RHEL" -ge 10 ]]; then
ensure pkg/config/containers.conf compression_format \"zstd:chunked\"
ensure storage.conf pull_options \{enable_partial_images\ =\ \"true\",\ use_hard_links\ =\ \"false\",\ ostree_repos=\"\",\ convert_images\ =\ \"false\"\}
# Leave composefs disabled
ensure storage.conf use_composefs \"false\"
fi

0 comments on commit 5176a65

Please sign in to comment.