core/linux/create-aufs-kernel-patch
2014-08-26 23:16:09 +02:00

47 lines
1009 B
Bash
Executable File

#!/bin/sh
KERNEL_VERSION="$1"
if [ -z "$KERNEL_VERSION" ]; then
echo "Usage: $0 <kernel version>"
echo "Example: $0 3.6"
exit 1
fi
CWD=$(pwd)
dest=$CWD/999_aufs${KERNEL_VERSION}.diff
mkdir /tmp/aufs$$
cd /tmp/aufs$$
# clone aufs git
git clone git://git.code.sf.net/p/aufs/aufs3-standalone aufs3-standalone.git
cd aufs3-standalone.git
# uncomment line below to get aufs for stable kernel
git checkout origin/aufs${KERNEL_VERSION}
cd ..
mkdir a b
# create complete AuFS as patch
cp -r aufs3-standalone.git/fs b
cp -r aufs3-standalone.git/Documentation b
cp -r aufs3-standalone.git/include b
rm b/include/uapi/linux/Kbuild
diff -rupN a/ b/ > $CWD/aufs3.patch
# add patches
cp aufs3-standalone.git/aufs3-base.patch $CWD
cp aufs3-standalone.git/aufs3-standalone.patch $CWD
cp aufs3-standalone.git/aufs3-kbuild.patch $CWD
cp aufs3-standalone.git/aufs3-mmap.patch $CWD
cp aufs3-standalone.git/aufs3-loopback.patch $CWD
# clean up
rm -rf /tmp/aufs
echo && echo "latest patch created as $dest"