From 03d22f204fd9f901721eddf9f43d9d3baec6bf47 Mon Sep 17 00:00:00 2001 From: Lukas Vrabec Date: Oct 22 2015 14:39:15 +0000 Subject: Add smart script to create the latest selinux-policy patches from github and also download the latest docker policy from github --- diff --git a/make-rhat-patches.sh b/make-rhat-patches.sh new file mode 100755 index 0000000..f392409 --- /dev/null +++ b/make-rhat-patches.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +DISTGIT_PATH=$(pwd) + +FEDORA_VERSION=rawhide +DOCKER_FEDORA_VERSION=fedora-1.9 +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 +git clone git@github.com:fedora-cloud/docker-selinux.git -q + +pushd selinux-policy > /dev/null +# prepare policy patches against upstream +git checkout ${FEDORA_VERSION}-base -q; git diff eb4512f6eb13792c76ff8d3e6f2df3a7155db577 ${FEDORA_VERSION}-base > policy-${FEDORA_VERSION}-base.patch +git checkout ${FEDORA_VERSION}-contrib -q; git diff 64302b790bf2b39d93610e1452c8361d56966ae0 ${FEDORA_VERSION}-contrib > policy-${FEDORA_VERSION}-contrib.patch +popd > /dev/null + +pushd docker-selinux > /dev/null +git checkout -b ${DOCKER_FEDORA_VERSION} -t origin/${DOCKER_FEDORA_VERSION} -q +tar -czf docker-selinux.tgz docker.if docker.te docker.fc +popd > /dev/null + +pushd $DISTGIT_PATH > /dev/null +cp $POLICYSOURCES/selinux-policy/policy-${FEDORA_VERSION}-{base,contrib}.patch . +cp $POLICYSOURCES/docker-selinux/docker-selinux.tgz . +popd > /dev/null + +popd > /dev/null +rm -rf $POLICYSOURCES + +echo "policy-rawhide-{contrib,base}.patches and docker.tgz with docker policy files have been created."