03d22f2
#!/bin/bash
03d22f2
03d22f2
DISTGIT_PATH=$(pwd)
03d22f2
03d22f2
FEDORA_VERSION=rawhide
b040fbf
DOCKER_FEDORA_VERSION=master
03d22f2
DISTGIT_BRANCH=master
03d22f2
03d22f2
git checkout $DISTGIT_BRANCH -q
03d22f2
03d22f2
POLICYSOURCES=`mktemp -d policysources.XXXXXX`
03d22f2
pushd $POLICYSOURCES > /dev/null
03d22f2
03d22f2
git clone git@github.com:fedora-selinux/selinux-policy.git -q
ab3db24
git clone git@github.com:projectatomic/container-selinux.git -q
03d22f2
03d22f2
pushd selinux-policy > /dev/null
856e200
# prepare policy patches against upstream commits matching the last upstream merge
856e200
git rev-parse --verify origin/${FEDORA_VERSION}-base; git diff eb4512f6eb13792c76ff8d3e6f2df3a7155db577 origin/${FEDORA_VERSION}-base > policy-${FEDORA_VERSION}-base.patch
856e200
git rev-parse --verify origin/${FEDORA_VERSION}-contrib; git diff 64302b790bf2b39d93610e1452c8361d56966ae0 origin/${FEDORA_VERSION}-contrib > policy-${FEDORA_VERSION}-contrib.patch
03d22f2
popd > /dev/null
03d22f2
ab3db24
pushd container-selinux > /dev/null
ab3db24
# Actual container-selinux files are in master branch
d932255
#git checkout -b ${DOCKER_FEDORA_VERSION} -t origin/${DOCKER_FEDORA_VERSION} -q
ab3db24
tar -czf container-selinux.tgz container.if container.te container.fc
03d22f2
popd > /dev/null
03d22f2
03d22f2
pushd $DISTGIT_PATH > /dev/null
03d22f2
cp $POLICYSOURCES/selinux-policy/policy-${FEDORA_VERSION}-{base,contrib}.patch .
ab3db24
cp $POLICYSOURCES/container-selinux/container-selinux.tgz .
03d22f2
popd > /dev/null
03d22f2
03d22f2
popd > /dev/null
03d22f2
rm -rf $POLICYSOURCES
03d22f2
ab3db24
echo "policy-rawhide-{contrib,base}.patches and container.tgz with container policy files have been created."