1 / 15

Chapter 15 Rebuilding the Linux Kernel

Chapter 15 Rebuilding the Linux Kernel. Preparing the Source Code Locating the Source Code Installing the Source Code Read the Documentation Configuring and Compiling the Linux Kernel Cleaning the Source Tree Configuring the Linux Kernel Compiling the Linux Kernel

beau
Download Presentation

Chapter 15 Rebuilding the Linux Kernel

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 15 Rebuilding the Linux Kernel • Preparing the Source Code • Locating the Source Code • Installing the Source Code • Read the Documentation • Configuring and Compiling the Linux Kernel Cleaning the Source Tree • Configuring the Linux Kernel Compiling the Linux Kernel • Using Loadable Kernel Modules • Installing the Kernel and Associated Files • Changing lilo.conf (RHEL) • grub.conf • Rebooting • Boot Loader • grub: The Linux Loader • Lilo: The Linux Loader (RHEL) • LOADLlN: A DOS-Based Linux Loader • dmesg: Display Kernel Messages

  2. Boot loaders • grub – update grub.conf after binary is installed • lilo – update lilo.conf and then run lilo command to activate and rewrite your mbr • sysctl utility – modifies kernel parameters while the system is running. Can be used instead of rebuilding the kernel • Use sysctl –a to get a list of parameters • Can be used to modify /proc/sys parameters

  3. Installing a Linux Kernel binary • Run rpm with the –i (not the –U) it is a new kernel not an upgrade • Make sure the new kernel works before you remove the old kernel • Remove the old kernel by removing the files that contain the release number from the /boot and from grub.conf and lilo.conf

  4. Source code • Get a copy of the source code: • Check /usr/src/linux* for kernel source code • Download from kernel.org or Red Hat • Install the source code • Use up2date kernel-source • Read the documentation! • Read the documentation/README file OR • Locate the Linux Kernel-HOWTO

  5. Configuring and Compiling the kernel • Clean the source tree • # make mrproper • Configure the linux kernel • # make config • # LANG=C make menuconfig • # make xconfig

  6. The qconf window as displayed by make xconfig on Fedora

  7. The qconf Processor Type submenu

  8. ESTRAVERSION number • Use to prevent overwriting of older/other kernel information • Defaults to release number + custom

  9. Next Compile the new Kernel • Clean the old files away # make clean • Compile the kernel # make bzImage

  10. Using Loadable kernel modules # make modules # make modules_install • depmod - module dependencies • insmod – lists information about loaded modules • lsmod – list loaded modules information • modinfo – list module information • modprobe – loads, unloads modules and dependencies • rmmod – removes modules from kernel

  11. Installing the kernel • Copy the compiled kernel and associated files to the appropriate directory (/ or /boot) • Now execute: # make install • grub – update grub.conf after binary is installed • lilo – update lilo.conf and then run lilo command to activate and rewrite your mbr

  12. Rebooting and boot loaders • grub – update grub.conf after binary is installed, Grand Unified Boot Loader. • lilo – Linux loader, update lilo.conf and run lilo command to activate and rewrite your mbr • loadlin: is a DOS based utility that will load Linux from DOS • See Loadlin+Win95/98/ME mini-HOWTO or • elserv.ffm.fgan.de/~lermen

  13. Use dmesg • Use the dmesg utility to see if there are any problems with the installation • If the install does not work then boot to rescue mode and change your lilo or grub configurations to point back to your old kernel • Try again

  14. grub.conf # grub.conf generated by anaconda # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/hda2 # initrd /initrd-version.img # boot=/dev/hda default=0 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz title Fedora Core (2.4.22-1.2199.nptl) root (hd0,0) kernel /vmlinuz-2.4.22-1.2199.nptl ro root=LABEL=/ rhgb initrd /initrd-2.4.22-1.2199.nptl.img title Fedora Core (2.4.22-1.2115.nptl) root (hd0,0) kernel /vmlinuz-2.4.22-1.2115.nptl ro root=LABEL=/ rhgb initrd /initrd-2.4.22-1.2115.nptl.img

  15. Any Questions?

More Related