milis/bin/aufs_yama_yapici.sh

37 lines
1.2 KiB
Bash
Raw Normal View History

2016-10-23 13:36:24 +02:00
#!/bin/bash
rm -Rf aufs4-standalone
# clone the aufs repository to the local disk
git clone git://github.com/sfjro/aufs4-standalone.git aufs4-standalone
cd aufs4-standalone
git branch -r
2016-10-23 22:50:38 +02:00
git checkout origin/aufs4.7
2016-10-23 13:36:24 +02:00
# modify what you want
# and after
# create the patch with the directories: fs, include and Documentation
rm -v $(find . -type f -name '*.orig')
2016-10-23 22:50:38 +02:00
grep -qse 'EXPORT_SYMBOL(' aufs4-standalone.patch && \
sed -i-old -e 's|EXPORT_SYMBOL(|EXPORT_SYMBOL_GPL(|' aufs4-standalone.patch
rm -rf ../tmp/linux-4.7
mkdir -p ../tmp/linux-4.7
cp -a fs ../tmp/linux-4.7
cp -a include ../tmp/linux-4.7
cp -a Documentation ../tmp/linux-4.7
rm ../tmp/linux-4.7/include/uapi/linux/Kbuild
2016-10-23 13:36:24 +02:00
cd ../tmp
2016-10-23 22:50:38 +02:00
diff -Naur null linux-4.7 | filterdiff | \
sed -e 's|null\(/include/uapi/linux/Kbuild\)|linux-4.7-old\1|;s|^--- null.*|--- /dev/null|;\|linux-4.7/include/uapi/linux/Kbuild|,${\|@@ -0,0 +1 @@|,$d}' \
| bzip2 > aufs$(sed -ne 's|#define.*AUFS_VERSION.*"\(.*\)"|\1|p' linux-4.7/include/uapi/linux/aufs_type.h).patch.bz2
2016-10-23 13:36:24 +02:00
mv *.bz2 $OLDPWD
cd $OLDPWD
mv *patch* ..
cd ..
rm -rf tmp aufs4-standalone
# the patch is created in ../tmp
# the other patches needed to compile are in the base directory