document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/bash
  2. #
  3. # @(#)$Id: kernel-compile.sh,v 0.1 2014/11/01 $
  4. #
  5. # Compile and Install Linux Kernel on Centos 6
  6. # - This should be run as \'root\' (not sudo)
  7. # - This should be run immediately after the OS install
  8. # - You should verify wget URLs work before running
  9. # - Read the comments below about \'make menuconfig\'
  10. #
  11. # Script Variables were tested and work with:
  12. # CentOS 6.5 x86_64 (Minimal)
  13. # Linux 2.6.36.4
  14. # unionfs 2.6_for_2.6.36.4
  15. #
  16. # Patch Notes:
  17. # For UnionFS in Linux 2.6.36.4:
  18. # http://www.fsl.cs.sunysb.edu/pipermail/unionfs/attachments/20101027/fdb6761a/attachment.bin
  19.  
  20. KERNEL_SOURCE="www.kernel.org/pub/linux/kernel/v2.6"
  21. LINUX_KERNEL="2.6.36.4"
  22. UNION_FS_URL="download.filesystems.org/unionfs/unionfs-2.x-latest"
  23. UNION_FS="unionfs-2.6_for_2.6.36.4"
  24.  
  25.  
  26. # Install dependency packages and update. ~50MB Download
  27. yum install -y gcc ncurses ncurses-devel wget perl bc patch
  28.  
  29. # Download the Kernel 3.17 Source ~116MB Download
  30. cd /tmp
  31. wget http://$KERNEL_SOURCE/linux-$LINUX_KERNEL.tar.gz
  32.  
  33. # Extract
  34. tar -C /usr/src -xvf linux-$LINUX_KERNEL.tar.gz
  35.  
  36. # Integration unionfs ~1MB
  37. wget http://$UNION_FS_URL/$UNION_FS.diff.gz
  38. gzip -d $UNION_FS.diff.gz
  39. mv $UNION_FS.diff /usr/src/linux-$LINUX_KERNEL/
  40.  
  41. cd /usr/src/linux-$LINUX_KERNEL/
  42. patch -p1 < $UNION_FS.diff
  43.  
  44. wget http://www.fsl.cs.sunysb.edu/pipermail/unionfs/attachments/20101027/fdb6761a/attachment.bin
  45. patch -p1 < attachment.bin
  46.  
  47. # Run the make menuconfig command to configure the Linux kernel.
  48. # Once you execute the below command a pop up window appears with
  49. # all the menus. Here you can select your new kernel configuration.
  50. # Enable UnionFS:
  51. # Filesystems    -> Miscellaneous    -> unionfs [*] (Press Spacebar twice)
  52. #                     -> unionfs (extended attributes) [*]
  53. # Exit -> Exit -> Exit -> Exit -> Save
  54. make menuconfig
  55.  
  56. # "Compire der Kerner!!!"
  57.  
  58. make -j 4
  59. make modules_install install
  60.  
  61. # Update Grub and disable kernel updates
  62. echo exclude=kernel* >> /etc/yum.conf
  63. sed -i \'s/default=1/default=0/g\' /boot/grub/grub.conf
');