aufs_yama_yapici.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. rm -Rf aufs4-standalone
  3. # clone the aufs repository to the local disk
  4. git clone git://github.com/sfjro/aufs4-standalone.git aufs4-standalone
  5. cd aufs4-standalone
  6. git branch -r
  7. git checkout origin/aufs4.7
  8. # modify what you want
  9. # and after
  10. # create the patch with the directories: fs, include and Documentation
  11. rm -v $(find . -type f -name '*.orig')
  12. grep -qse 'EXPORT_SYMBOL(' aufs4-standalone.patch && \
  13. sed -i-old -e 's|EXPORT_SYMBOL(|EXPORT_SYMBOL_GPL(|' aufs4-standalone.patch
  14. rm -rf ../tmp/linux-4.7
  15. mkdir -p ../tmp/linux-4.7
  16. cp -a fs ../tmp/linux-4.7
  17. cp -a include ../tmp/linux-4.7
  18. cp -a Documentation ../tmp/linux-4.7
  19. rm ../tmp/linux-4.7/include/uapi/linux/Kbuild
  20. cd ../tmp
  21. diff -Naur null linux-4.7 | filterdiff | \
  22. 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}' \
  23. | bzip2 > aufs$(sed -ne 's|#define.*AUFS_VERSION.*"\(.*\)"|\1|p' linux-4.7/include/uapi/linux/aufs_type.h).patch.bz2
  24. mv *.bz2 $OLDPWD
  25. cd $OLDPWD
  26. mv *patch* ..
  27. cd ..
  28. rm -rf tmp aufs4-standalone
  29. # the patch is created in ../tmp
  30. # the other patches needed to compile are in the base directory