sobota 1. januára 2022

bash script: compile kernel

Script for compile kernel







 #!/bin/bash



echo $(nproc)



if [ $(nproc) -ge 1 ]


then echo je to ok


else 


exit 


fi


date > /root/zaciatok.txt


yum install wget -y



#stiahneme najnovsi kernel


wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.9.tar.xz


unxz -v linux-5.6.9.tar.xz


tar xvf linux-5.6.9.tar


cd linux-5.6.9


cp -v /boot/config-$(uname -r) .config



#instalujem developerske balicky na kompilaciu kernelu


yum group install "Development Tools" -y


 yum install ncurses-devel bison flex elfutils-libelf-devel openssl-devel -y



#menu


make menuconfig


#make - kompilovat


make -j $(nproc)



# instalacia modulov:


make modules_install


#instalacia 


make install


#grub:


grub2-mkconfig -o /boot/grub2/grub.cfg


grubby --set-default /boot/vmlinuz-5.6.9


grubby --default-kernel



date > /root/koniec.txt


reboot

Žiadne komentáre:

Zverejnenie komentára