[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:general_admin:brief_kernel_build [2022/02/15 02:09 (UTC)] – [Sources] zeebrahowtos:general_admin:brief_kernel_build [2023/12/17 11:25 (UTC)] (current) zeebra
Line 4: Line 4:
 Brief guide to configure, compile and install a kernel. I do this all as root in /usr/src, others do all steps except install in /home/user/somewhere as user. If I'm going to use the Kernel to control my computer I might as well trust the build process. So this guide assumes as ROOT and /usr/src. It is mainly intended as my reference to other howto's that requires building a Kernel first. Brief guide to configure, compile and install a kernel. I do this all as root in /usr/src, others do all steps except install in /home/user/somewhere as user. If I'm going to use the Kernel to control my computer I might as well trust the build process. So this guide assumes as ROOT and /usr/src. It is mainly intended as my reference to other howto's that requires building a Kernel first.
  
-This howto assumes kernel-5.16.9. Obviously you should use the newest appropriate version and use those version numbers.+This howto assumes kernel-6.6.3. Obviously you should use the newest appropriate version and use those version numbers.
  
 **summary:** <code> **summary:** <code>
 cd /usr/src cd /usr/src
-tar -xvf linux-5.16.9.tar.xz +tar -xvf linux-6.6.3.tar.xz 
-cd linux-5.16.9 +cd linux-6.6.3 
-make clean & make mrproper+make clean && make mrproper
 cp ../config-custom ./.config cp ../config-custom ./.config
 make menuconfig make menuconfig
 make -j3 make -j3
 make modules && make modules_install make modules && make modules_install
-cp System.map /boot/System.map-5.16.9_custom-v1 +cp System.map /boot/System.map-6.6.3_acer-v5 
-cp .config /boot/config-5.16.9_custom-v1 +cp .config /boot/config-6.6.3_acer-v5 
-cp arch/x86/boot/bzImage /boot/vmlinuz-5.16.9_custom-v1+cp arch/x86/boot/bzImage /boot/vmlinuz-6.6.3_acer-v5
 </code> </code>
  
Line 29: Line 29:
 <code> <code>
 cd /usr/src cd /usr/src
-tar -xvf linux-5.16.9.tar.xz +tar -xvf linux-6.6.3.tar.xz 
-cd linux-5.16.9 +cd linux-6.6.3 
-make clean & make mrproper+make clean && make mrproper
 cp ../config-custom ./.config cp ../config-custom ./.config
 </code> </code>
  
-You only need to do mrproper, not clean, I just do it out of habit. Cp assumes you already have a useful config-custom file in /usr/src, or you could cp /boot/config-generic. +You don'need both mrproper and cleanprobably chose one or the other depending on your need (mrproper also does clean), I just do both out of habit. Cp assumes you already have a useful config-custom file in /usr/src, or you could cp /boot/config-generic. 
  
 ===== Configure ===== ===== Configure =====
- 
-If you don't have a good configuration file for the particular computer you could use make localmodconfig (DON'T) before menuconfig to make one from scratch. Or you could do the opposite and make (cp) one from config-huge, or if you intend to use initrd, config-generic. 
  
 <code> <code>
Line 46: Line 44:
  
 Save the configuration.  Save the configuration. 
 +
 +
 +<note>If you don't have a good configuration file for the particular computer you're on, you could use make localmodconfig (DON'T) before menuconfig to make one from scratch. Or you could do the opposite and make (copy) one from config-huge, or if you intend to use initrd, config-generic. If you use localmodconfig, you have to ADD lots of stuff to the configuration (that you need or might need), alternatively you CAN remove alot of stuff (you don't need) from config-generic or config-huge. If you intend to not use an initrd, you need to build into the Kernel anything you need, and you can build into or as modules(preferably) things you might need.</note>
 +
  
 ===== Compile ===== ===== Compile =====
Line 57: Line 59:
 <code>make modules && make modules_install</code> <code>make modules && make modules_install</code>
  
-You don't need to do make modules, only modules_install, I just do out of old habits and precaution. You might want to make headers here once in awhile. +You don't need to do make modules (make basically does make "all" target), only modules_install, I just do out of old habits and precaution. Some targets however, do require make modules, like make bzImage. You also might want to make headers_install here once in awhile. 
  
 ===== Install ===== ===== Install =====
  
 <code> <code>
-cp System.map /boot/System.map-5.16.9_acer-v5 +cp System.map /boot/System.map-6.6.3_acer-v5 
-cp .config /boot/config-5.16.9_acer-v5 +cp .config /boot/config-6.6.3_acer-v5 
-cp arch/x86/boot/bzImage /boot/vmlinuz-5.16.9_acer-v5+cp arch/x86/boot/bzImage /boot/vmlinuz-6.6.3_acer-v5
 </code> </code>
 +OR
 +<code>make install</code>
 +
 +If you want to make and use **initrd**, this is the time.
 +
 +Then add your custom entry to the bootloader. (If you need some assistance with Grub2 bootloader look here: [[howtos:misc:lilo_to_grub_bios_mbr]])
  
-If you want to make initrd, this is the time.+===== Further details =====
  
-Then add your custom entry to the bootloader.+If you need further information or details regarding Linux kernel builds, there are several more detailed guides available on this page: \\ 
 +[[slackbook:linux_kernel | Slackbook]] \\ 
 +[[howtos:slackware_admin:kernelbuilding | Alienbob - detailed]] \\ 
 +[[howtos:slackware_admin:building_the_linux_kernel_using_git_repository | Git related]] \\ 
 +[[howtos:slackware_admin:using_slackwares_kernel_build_scripts | Slackware Helper scripts ]] \\
  
 ====== Sources ====== ====== Sources ======
Line 76: Line 88:
 <!-- Please do not modify anything below, except adding new tags.--> <!-- Please do not modify anything below, except adding new tags.-->
 <!-- You must remove the tag-word "template" below before saving your new page --> <!-- You must remove the tag-word "template" below before saving your new page -->
-{{tag>howtosgeneral_adminkernel}}+{{tag>howtos general_admin kernel author_zeebra}}
 howtos:general_admin:brief_kernel_build ()