Administration
  Home arrow Administration arrow Page 8 - Kernel, Cron, and User Administration,...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Rational Software Development Conference
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Kernel, Cron, and User Administration, Part 2
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2004-10-06

    Table of Contents:
  • Kernel, Cron, and User Administration, Part 2
  • Updating Your Boot Loader
  • The Kernel Source Tree and Documentation
  • The Kernel RPMs
  • GUI Kernel Source Management
  • The Linux Kernel tar File
  • Understanding Kernel Configuration Options
  • Compiling and Installing a Custom Kernel
  • The cron and at Systems
  • Setting Up cron for Users
  • Certification Summary
  • Self Test
  • Lab Questions
  • Self Test Answers
  • Lab

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    PCmover - $15 Off with Coupon Code CJPH7Q

    Kernel, Cron, and User Administration, Part 2 - Compiling and Installing a Custom Kernel
    (Page 8 of 15 )

    After setting up all the options you want from one of the Kernel configuration programs, make sure to save your changes. The changes are saved in the appropriate .config file. Next, you can compile your kernel. Compiling a new kernel can be a long and tedious process. The following is a list of things you should do to successfully compile your kernel—inorder:

    1. If you haven’t already done so, create a custom boot floppy disk with the following command. Test the floppy that’s created.

      # mkbootdisk `uname -r`

    2. Run the cd /usr/src/linux-2.4 command to reach the proper directory. You’ll need to run your commands to modify and compile the kernel in this directory. This assumes that you’ve installed the appropriate kernel-source RPM. In RHEL 3, this directory is linked to the directory with the source code, /usr/src/linux-2.4.21-4.EL.

    3. Open /usr/src/linux-2.4/Makefile in a text editor. In RHEL 3, the EXTRAVERSION variable is already set to identify a custom kernel. If necessary, change the value of this variable to uniquely identify your kernel. Record the value of this variable.

      EXTRAVERSION= -4.ELcustom

    4. Save your current kernel configuration file. It’s stored in the /boot directory. For RHEL 3, it’s the /boot/config-2.4.21-4.EL file. Have it ready with a rescue floppy in case disaster strikes. Copy it to the /usr/src/linux-2.4/.config file.

      • Alternatively, you can start from a standard configuration file in the /usr /src/linux-2.4/configs/ directory. You can also run the make oldconfig command.

    5. Run the make mrproper command to ensure your source files are in a consistent and clean state.

    6. Now you can customize your kernel with one of the following three utilities: the make config command runs the text-based configuration script; the make menuconfig command runs a low-level graphical configuration script; and the make xconfig command starts the X Window System configuration tool.

    7. Make any changes as required by your hardware and/or the RHCE exam. Before you exit from the kernel configuration utility, make sure to save your changes!

    8. The make dep command will set up all your dependencies correctly. This takes the settings from /usr/src/linux-2.4/.config and pushes them down into the correct source code subdirectory. This will take some time, as there are nearly 1,500 possible kernel settings on a RHEL 3 system!

      ON THE JOB!  The make dep process took about 20 minutes on my computer with a 1.2GHz CPU.

    9. Run the make clean command to prepare the source code directories to build your new kernel.

    10. The make bzImage command compiles the kernel and creates a gzip compressed kernel image file.

      ON THE JOB!  The make bzImage process took about 20 minutes on my computer with a 1.2GHz CPU.

    11. Now you need to build your modules (you did include kernel module support, didn’t you?). Use make modules to build all your modules.

      ON THE JOB!  The make modules process took about 50 minutes on my computer with a 1.2GHz CPU.

    12. Now you need to install your newly made modules, which will install all your loadable modules into a new subdirectory of the /lib/modules/kernelversion directory. The kernelversionshould correspond to the EXTRAVERSION variable in your Makefile. Use make modules_install to install your modules.

    13. With our kernel now built, we need to move it to /boot before we can boot from it. Run the make install command to copy the new kernel and create a new Initial RAM Disk file (initrd) in the /boot directory. It also updates the default GRUB boot loader.

      ON THE JOB!  The make install command copies your new kernel from the /usr/src/linux-2.4 /arch/i386/boot to the /boot directory. It also uses the mkinitrd command to create a new Initial RAM disk in the /boot directory.

    14. Verify the changes to the /boot directory.

    Building a kernel is an involved process, but it follows a standard pattern. It is very important that you become familiar with kernel construction procedures and troubleshooting. Refer to the following Scenario & Solution for some common problems encountered and their recommended solutions.

    Scenario & Solution
    You looked under /usr/src/ but did not see the Linux kernel source code. What did you do wrong?You did not install the kernel source code. Install the kernel source and related RPMs or use the Red Hat Package Management utility to install the Kernel Development package group.
    You configured the kernel as a monolithic kernel but when you run make bzImage, it fails, saying the kernel is too big. What should you do?You must reconfigure your kernel to use modules. There are limits on the size of a compressed kernel, so you should always build a modular kernel.
    You can't find your new kernel.Did you create an appropriate EXTRAVERSION cariable in your Makefile? Did you use this cariable throughout this process? If not, then you may not be able to correctly locate the kernel or its modules.

    This is part one from the fifth chapter of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7). Check it out at your favorite bookstore today. Buy this book now.

    More Administration Articles
    More By McGraw-Hill/Osborne


     

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway