bce470
#!/bin/bash
bce470
# This script delivers current documentation/configs and assures it has the intended
bce470
# settings for a particular branch/release.
bce470
# For questions reach to Jindrich Novy <jnovy@redhat.com>
bce470
bce470
ensure() {
bce470
  if grep ^$2[[:blank:]].*= $1 > /dev/null
bce470
  then
bce470
    sed -i "s;^$2[[:blank:]]=.*;$2 = $3;" $1
bce470
  else
bce470
    if grep ^\#.*$2[[:blank:]].*= $1 > /dev/null
bce470
    then
bce470
      sed -i "/^#.*$2[[:blank:]].*=/a \
bce470
$2 = $3" $1
bce470
    else
bce470
      echo "$2 = \"$3\"" >> $1
bce470
    fi
bce470
  fi
bce470
}
bce470
bce470
#./pyxis.sh
bce470
#./update-vendored.sh
bce470
spectool -f -g containers-common.spec
bce470
ensure storage.conf    driver                        \"overlay\"
bce470
ensure storage.conf    mountopt                      \"nodev,metacopy=on\"
bce470
ensure containers.conf events_logger                 \"file\"
bce470
if pwd | grep rhel-8 > /dev/null
bce470
then
bce470
ensure registries.conf unqualified-search-registries [\"registry.fedoraproject.org\",\ \"registry.access.redhat.com\",\ \"registry.centos.org\",\ \"docker.io\"]
bce470
ensure registries.conf short-name-mode               \"permissive\"
bce470
ensure containers.conf infra_image                   \"registry.access.redhat.com/ubi8/pause\"
bce470
ensure containers.conf runtime                       \"runc\"
bce470
else
bce470
ensure registries.conf unqualified-search-registries [\"registry.fedoraproject.org\",\ \"registry.access.redhat.com\",\ \"registry.centos.org\",\ \"quay.io\",\ \"docker.io\"]
bce470
ensure registries.conf short-name-mode               \"enforcing\"
bce470
ensure containers.conf infra_image                   \"registry.access.redhat.com/ubi9/pause\"
bce470
ensure containers.conf runtime                       \"crun\"
bce470
fi
bce470
[ `grep "keyctl" seccomp.json | wc -l` == 0 ] && sed -i '/\"kill\",/i \
bce470
				"keyctl",' seccomp.json
bce470
sed -i '/\"socketcall\",/i \
bce470
				"socket",' seccomp.json
bce470
if ! grep \"NET_RAW\" containers.conf > /dev/null
bce470
then
bce470
  sed -i '/^default_capabilities/a \
bce470
    "NET_RAW",' containers.conf
bce470
fi