2011-08-08 17:00:07 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2011-09-27 19:35:37 +08:00
|
|
|
rm -Rf aufs3-standalone
|
2011-08-08 17:00:07 +08:00
|
|
|
# clone the aufs repository to the local disk
|
2011-08-17 07:04:18 +08:00
|
|
|
git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git
|
|
|
|
cd aufs3-standalone
|
2011-08-08 17:00:07 +08:00
|
|
|
git branch -r
|
2012-01-29 00:08:10 +08:00
|
|
|
git checkout origin/aufs3.2
|
2011-08-08 17:00:07 +08:00
|
|
|
|
|
|
|
# modify what you want
|
|
|
|
|
|
|
|
# and after
|
|
|
|
# create the patch with the directories: fs, include and Documentation
|
|
|
|
|
|
|
|
rm -v $(find . -type f -name '*.orig')
|
2011-08-17 07:04:18 +08:00
|
|
|
grep -qse 'EXPORT_SYMBOL(' aufs3-standalone.patch && \
|
|
|
|
sed -i-old -e 's|EXPORT_SYMBOL(|EXPORT_SYMBOL_GPL(|' aufs3-standalone.patch
|
2012-01-29 00:08:10 +08:00
|
|
|
rm -rf /tmp/linux-3.2
|
|
|
|
mkdir /tmp/linux-3.2
|
|
|
|
cp -a fs /tmp/linux-3.2
|
|
|
|
cp -a include /tmp/linux-3.2
|
|
|
|
cp -a Documentation /tmp/linux-3.2
|
2011-08-08 17:00:07 +08:00
|
|
|
echo "test"
|
2012-01-29 00:08:10 +08:00
|
|
|
rm /tmp/linux-3.2/include/linux/Kbuild
|
2011-08-08 17:00:07 +08:00
|
|
|
cd /tmp
|
2012-01-29 00:08:10 +08:00
|
|
|
diff -Naur null linux-3.2 | filterdiff | \
|
|
|
|
sed -e 's|null\(/include/linux/Kbuild\)|linux-3.2-old\1|;s|^--- null.*|--- /dev/null|;\|linux-3.2/include/linux/Kbuild|,${\|@@ -0,0 +1 @@|,$d}' \
|
|
|
|
| bzip2 > aufs$(sed -ne 's|#define.*AUFS_VERSION.*"\(.*\)"|\1|p' linux-3.2/include/linux/aufs_type.h).patch.bz2
|
2011-08-08 17:00:07 +08:00
|
|
|
cd $OLDPWD
|
|
|
|
|
|
|
|
# the patch is created in /tmp
|
|
|
|
# the other patches needed to compile are in the base directory
|