2021-11-09 09:52:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# This script delivers current documentation/configs and assures it has the intended
|
|
|
|
# settings for a particular branch/release.
|
|
|
|
# For questions reach to Jindrich Novy <jnovy@redhat.com>
|
|
|
|
|
|
|
|
ensure() {
|
|
|
|
if grep ^$2[[:blank:]].*= $1 > /dev/null
|
|
|
|
then
|
|
|
|
sed -i "s;^$2[[:blank:]]=.*;$2 = $3;" $1
|
|
|
|
else
|
|
|
|
if grep ^\#.*$2[[:blank:]].*= $1 > /dev/null
|
|
|
|
then
|
|
|
|
sed -i "/^#.*$2[[:blank:]].*=/a \
|
|
|
|
$2 = $3" $1
|
|
|
|
else
|
2023-05-16 06:10:31 +00:00
|
|
|
echo "$2 = $3" >> $1
|
2021-11-09 09:52:08 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
#./pyxis.sh
|
|
|
|
#./update-vendored.sh
|
|
|
|
spectool -f -g containers-common.spec
|
2023-05-16 06:10:31 +00:00
|
|
|
for FILE in *; do
|
|
|
|
[ -s "$FILE" ]
|
|
|
|
if [ $? == 1 ] && [ "$FILE" != "sources" ]; then
|
|
|
|
echo "empty file: $FILE"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
2021-11-09 09:52:08 +00:00
|
|
|
ensure storage.conf driver \"overlay\"
|
|
|
|
ensure storage.conf mountopt \"nodev,metacopy=on\"
|
|
|
|
if pwd | grep rhel-8 > /dev/null
|
|
|
|
then
|
2023-05-16 06:10:31 +00:00
|
|
|
awk -i inplace '/#default_capabilities/,/#\]/{gsub("#","",$0)}1' containers.conf
|
2022-08-02 07:09:30 +00:00
|
|
|
ensure registries.conf unqualified-search-registries [\"registry.access.redhat.com\",\ \"registry.redhat.io\",\ \"docker.io\"]
|
2021-11-09 09:52:08 +00:00
|
|
|
ensure registries.conf short-name-mode \"permissive\"
|
|
|
|
ensure containers.conf runtime \"runc\"
|
2022-02-01 20:12:39 +00:00
|
|
|
ensure containers.conf events_logger \"file\"
|
|
|
|
ensure containers.conf log_driver \"k8s-file\"
|
2022-05-10 06:59:52 +00:00
|
|
|
ensure containers.conf network_backend \"cni\"
|
2023-02-21 08:51:19 +00:00
|
|
|
if ! grep \"NET_RAW\" containers.conf > /dev/null
|
|
|
|
then
|
|
|
|
sed -i '/^default_capabilities/a \
|
2023-05-16 06:10:31 +00:00
|
|
|
"NET_RAW",' containers.conf
|
2023-02-21 08:51:19 +00:00
|
|
|
fi
|
2023-05-16 09:17:11 +00:00
|
|
|
if ! grep \"SYS_CHROOT\" containers.conf > /dev/null
|
|
|
|
then
|
|
|
|
sed -i '/^default_capabilities/a \
|
|
|
|
"SYS_CHROOT",' containers.conf
|
|
|
|
fi
|
2021-11-09 09:52:08 +00:00
|
|
|
else
|
2022-08-02 07:09:30 +00:00
|
|
|
ensure registries.conf unqualified-search-registries [\"registry.access.redhat.com\",\ \"registry.redhat.io\",\ \"docker.io\"]
|
2021-11-09 09:52:08 +00:00
|
|
|
ensure registries.conf short-name-mode \"enforcing\"
|
|
|
|
ensure containers.conf runtime \"crun\"
|
|
|
|
fi
|
2023-05-16 06:10:31 +00:00
|
|
|
[ `grep \"keyctl\", seccomp.json | wc -l` == 0 ] && sed -i '/\"kill\",/i \
|
2021-11-09 09:52:08 +00:00
|
|
|
"keyctl",' seccomp.json
|
2023-05-16 06:10:31 +00:00
|
|
|
[ `grep \"socket\", seccomp.json | wc -l` == 0 ] && sed -i '/\"socketcall\",/i \
|
2021-11-09 09:52:08 +00:00
|
|
|
"socket",' seccomp.json
|
2024-06-07 11:32:30 +00:00
|
|
|
rhpkg clone redhat-release
|
|
|
|
cd redhat-release
|
|
|
|
rhpkg switch-branch rhel-9.4.0
|
|
|
|
rhpkg prep
|
|
|
|
cp -f redhat-release-*/RPM-GPG* ../
|
|
|
|
cd -
|
|
|
|
rm -rf redhat-release
|