Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Author: prog32bit
- # Description: autocompile & install kernel
- function download-and-extract {
- rm -rf temporary > /dev/null
- mkdir temporary
- cd temporary
- 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
- unxz linux-4.10.6.tar.xz
- gpg --keyserver hkp://keys.gnupg.net --recv-keys 38DBBDC86092693E
- if gpg --verify linux-4.10.6.tar.sign
- then
- cd ..
- tar -xf temporary/linux-4.10.6.tar
- rm -rf temporary
- else
- cd ..
- download-and-extract
- fi
- }
- function build {
- zcat /proc/config.gz > .config
- yes "" | make oldconfig
- make -j4
- make -j4 modules
- }
- function kernel-install {
- # follow commands run as root
- make install
- make modules_install
- # in this folder places all variants to '-k': /usr/lib/modules
- mkinitcpio -k 4.10.6-MANJARO -g /boot/initramfs-4.10.6-x86_64.img
- mv /boot/vmlinuz /boot/vmlinuz-4.10.6-x86_64
- grub-mkconfig -o /boot/grub/grub.cfg
- }
- export -f kernel-install
- function main {
- download-and-extract
- cd linux-4.10.6
- build
- su -c 'kernel-install'
- }
- main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement