2015-10-22 14:39:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
DISTGIT_PATH=$(pwd)
|
|
|
|
|
|
|
|
FEDORA_VERSION=rawhide
|
2016-03-02 16:43:18 +00:00
|
|
|
DOCKER_FEDORA_VERSION=master
|
2015-10-22 14:39:15 +00:00
|
|
|
DISTGIT_BRANCH=master
|
|
|
|
|
|
|
|
git checkout $DISTGIT_BRANCH -q
|
|
|
|
|
|
|
|
POLICYSOURCES=`mktemp -d policysources.XXXXXX`
|
|
|
|
pushd $POLICYSOURCES > /dev/null
|
|
|
|
|
|
|
|
git clone git@github.com:fedora-selinux/selinux-policy.git -q
|
2017-02-15 14:34:56 +00:00
|
|
|
git clone git@github.com:fedora-selinux/selinux-policy-contrib.git -q
|
2016-10-10 13:59:49 +00:00
|
|
|
git clone git@github.com:projectatomic/container-selinux.git -q
|
2015-10-22 14:39:15 +00:00
|
|
|
|
|
|
|
pushd selinux-policy > /dev/null
|
2015-10-23 09:06:11 +00:00
|
|
|
# prepare policy patches against upstream commits matching the last upstream merge
|
2017-02-20 12:55:22 +00:00
|
|
|
git rev-parse --verify origin/${FEDORA_VERSION}; git diff eb4512f6eb13792c76ff8d3e6f2df3a7155db577 origin/${FEDORA_VERSION} > policy-${FEDORA_VERSION}-base.patch
|
2017-02-15 14:34:56 +00:00
|
|
|
popd > /dev/null
|
|
|
|
|
|
|
|
pushd selinux-policy-contrib > /dev/null
|
|
|
|
# prepare policy patches against upstream commits matching the last upstream merge
|
|
|
|
git rev-parse --verify origin/${FEDORA_VERSION}; git diff 64302b790bf2b39d93610e1452c8361d56966ae0 origin/${FEDORA_VERSION} > policy-${FEDORA_VERSION}-contrib.patch
|
2015-10-22 14:39:15 +00:00
|
|
|
popd > /dev/null
|
|
|
|
|
2016-10-10 13:59:49 +00:00
|
|
|
pushd container-selinux > /dev/null
|
|
|
|
# Actual container-selinux files are in master branch
|
2016-03-08 14:37:39 +00:00
|
|
|
#git checkout -b ${DOCKER_FEDORA_VERSION} -t origin/${DOCKER_FEDORA_VERSION} -q
|
2016-10-10 13:59:49 +00:00
|
|
|
tar -czf container-selinux.tgz container.if container.te container.fc
|
2015-10-22 14:39:15 +00:00
|
|
|
popd > /dev/null
|
|
|
|
|
|
|
|
pushd $DISTGIT_PATH > /dev/null
|
2017-02-15 14:34:56 +00:00
|
|
|
cp $POLICYSOURCES/selinux-policy/policy-${FEDORA_VERSION}-base.patch .
|
|
|
|
cp $POLICYSOURCES/selinux-policy-contrib/policy-${FEDORA_VERSION}-contrib.patch .
|
2016-10-10 13:59:49 +00:00
|
|
|
cp $POLICYSOURCES/container-selinux/container-selinux.tgz .
|
2015-10-22 14:39:15 +00:00
|
|
|
popd > /dev/null
|
|
|
|
|
|
|
|
popd > /dev/null
|
|
|
|
rm -rf $POLICYSOURCES
|
|
|
|
|
2016-10-10 13:59:49 +00:00
|
|
|
echo "policy-rawhide-{contrib,base}.patches and container.tgz with container policy files have been created."
|