I want to compile kernel source code to remove unnecessary blotware in the kernel and to improve performance.
I have read a number of tutorials and tried or experimented to compile kernel and learnt a number of lessons.
I tried to compile kernel according to what I learnt but still there may be any mistakes. As you are experts can you try to examine the steps I followed and give suggestions.
The main steps I followed are as follows
1) Downloaded and installed kernel source code package.
2) Extracted the source code to my home directory.
3) Changed the ownership of the extracted directory recursively through the following command.
Code: Select all
chown -R $USER:$USER linux
Code: Select all
make mrproper
Code: Select all
export KCPFLAGS=" -march=znver3 -O2 pipe"
export KCLAGS=" -march=znver3 -O2 pipe"
export CFLAGS=" -march=znver3 -O2 pipe"
export CPFLAGS=" -march=znver3 -O2 pipe"
Code: Select all
make localmodconfig
Code: Select all
make xconfig

*I selected amdgpu option to compile as module.
*I have added the string Rupesh to LocalVersion
*I have selected append Local_Version to version to yes
*I have disabled support for other processors like intel etc except AMD.
*I have saved and exited the configuration.
9) After that I issued the following command to make the kernel and modules.
Code: Select all
make bzImage modules
Code: Select all
make modules_install
Code: Select all
make install.
Code: Select all
grub-mkconfig -o /boot/grub/grub.cfg
Code: Select all
grub install /dev/nvmen101
Previously I tried to compile mainline kernel which is downloaded from kernel.org but I thought distribution kernel source code is more efficient so I tried to compile distribution kernel.
Finally I am asking is it safe to compile kernel myself or it is recommended to use default kernel provided by distribution.
Kindly try to clarify my doubts.
Regards,
Rupesh.