Blame make-rhat-patches.sh
|
Lukas Vrabec |
03d22f |
#!/bin/bash
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
DISTGIT_PATH=$(pwd)
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
FEDORA_VERSION=rawhide
|
|
Lukas Vrabec |
03d22f |
DOCKER_FEDORA_VERSION=fedora-1.9
|
|
Lukas Vrabec |
03d22f |
DISTGIT_BRANCH=master
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
git checkout $DISTGIT_BRANCH -q
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
POLICYSOURCES=`mktemp -d policysources.XXXXXX`
|
|
Lukas Vrabec |
03d22f |
pushd $POLICYSOURCES > /dev/null
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
git clone git@github.com:fedora-selinux/selinux-policy.git -q
|
|
Lukas Vrabec |
03d22f |
git clone git@github.com:fedora-cloud/docker-selinux.git -q
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
pushd selinux-policy > /dev/null
|
|
Miroslav Grepl |
856e20 |
# prepare policy patches against upstream commits matching the last upstream merge
|
|
Miroslav Grepl |
856e20 |
git rev-parse --verify origin/${FEDORA_VERSION}-base; git diff eb4512f6eb13792c76ff8d3e6f2df3a7155db577 origin/${FEDORA_VERSION}-base > policy-${FEDORA_VERSION}-base.patch
|
|
Miroslav Grepl |
856e20 |
git rev-parse --verify origin/${FEDORA_VERSION}-contrib; git diff 64302b790bf2b39d93610e1452c8361d56966ae0 origin/${FEDORA_VERSION}-contrib > policy-${FEDORA_VERSION}-contrib.patch
|
|
Lukas Vrabec |
03d22f |
popd > /dev/null
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
pushd docker-selinux > /dev/null
|
|
Lukas Vrabec |
03d22f |
git checkout -b ${DOCKER_FEDORA_VERSION} -t origin/${DOCKER_FEDORA_VERSION} -q
|
|
Lukas Vrabec |
03d22f |
tar -czf docker-selinux.tgz docker.if docker.te docker.fc
|
|
Lukas Vrabec |
03d22f |
popd > /dev/null
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
pushd $DISTGIT_PATH > /dev/null
|
|
Lukas Vrabec |
03d22f |
cp $POLICYSOURCES/selinux-policy/policy-${FEDORA_VERSION}-{base,contrib}.patch .
|
|
Lukas Vrabec |
03d22f |
cp $POLICYSOURCES/docker-selinux/docker-selinux.tgz .
|
|
Lukas Vrabec |
03d22f |
popd > /dev/null
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
popd > /dev/null
|
|
Lukas Vrabec |
03d22f |
rm -rf $POLICYSOURCES
|
|
Lukas Vrabec |
03d22f |
|
|
Lukas Vrabec |
03d22f |
echo "policy-rawhide-{contrib,base}.patches and docker.tgz with docker policy files have been created."
|