Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Author: prog32bit
  4. # Description: autocompile & install kernel
  5.  
  6. function download-and-extract {
  7. rm -rf temporary > /dev/null
  8. mkdir temporary
  9. cd temporary
  10. wget -q --show-progress https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.10.6.tar.xz https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.10.6.tar.sign
  11. unxz linux-4.10.6.tar.xz
  12. gpg --keyserver hkp://keys.gnupg.net --recv-keys 38DBBDC86092693E
  13. if gpg --verify linux-4.10.6.tar.sign
  14. then
  15. cd ..
  16. tar -xf temporary/linux-4.10.6.tar
  17. rm -rf temporary
  18. else
  19. cd ..
  20. download-and-extract
  21. fi
  22. }
  23.  
  24. function build {
  25. zcat /proc/config.gz > .config
  26. yes "" | make oldconfig
  27. make -j4
  28. make -j4 modules
  29. }
  30.  
  31. function kernel-install {
  32. # follow commands run as root
  33. make install
  34. make modules_install
  35. # in this folder places all variants to '-k': /usr/lib/modules
  36. mkinitcpio -k 4.10.6-MANJARO -g /boot/initramfs-4.10.6-x86_64.img
  37. mv /boot/vmlinuz /boot/vmlinuz-4.10.6-x86_64
  38. grub-mkconfig -o /boot/grub/grub.cfg
  39. }
  40. export -f kernel-install
  41.  
  42. function main {
  43. download-and-extract
  44. cd linux-4.10.6
  45. build
  46. su -c 'kernel-install'
  47. }
  48.  
  49. main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement