create-aufs.sh 1.2 KB

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