Kernel Configuration Process

Kernel configuration is a detailed process in which the systems administrator is altering the behavior of the computer. The systems administrator must remember that a change of a single parameter may affect other kernel subsystems, thus exposing the administrator to the "law of unintended consequences."

When Do You Rebuild the Kernel

Kernel components are generally broken into four major groups, and if changes are made to any of these groups, a kernel reconfiguration is required.
Subsystems--These are components that are required for special functionality (ISO9660)
Dump Devices--System memory dumps are placed here when a panic condition exist. Core dumps are usually placed at the end of the swap area.
Configurable Parameters--These are tuning parameters and data structures. There are a significant number, and they may have inter-dependencies, so it is important that you are aware of the impact of each change.
Device Drivers--These handle interfaces to peripherals like modems, printers, disks, tape drives, kernel memory, and other physical devices.

HP-UX 10.X

There are two ways to rebuild the kernel:
A. Use the System Activity Monitor (SAM)
Step 1--Run SAM and select "Kernel Configuration."
You will now see the following four identified components:
Subsystem
Configurable Parameters
Dump Devices
Device Drivers
Step 2--Select the desired component and make the appropriate change(s).
Step 3--Now answer the prompts and the kernel will be rebuilt.
Step 4--It will also prompt you for whether you want to reboot the kernel now or later.
Consider the importance of the changes and the availability of the system to answer this prompt. If you answer "YES" to reboot the system now it can not be reversed. The point is to know what you are going to do prior to getting to that prompt.
B. Manual Method
Step 1--Go to the build area of the kernel by typing the command line below.
# cd /stand/build
Step 2--The first step is to create a system file from the current system configuration by typing the command line below.
# /usr/lbin/sysadm/system_prep -s system
This command places the current system configuration in the filesystem. There is no standard that you call it system; it could be any name you desire.
Step 3--Now you must modify the existing parameters and insert unlisted configuration parameters, new subsystems, and device drivers, or alter the dump device. The reason you may not have one of the listed configurable parameters in this file: The previous kernel took the default value.
Step 4--The next step is to create the conf.c file, and we are using the modified system file to create it. Remember, if you did not use system for the existing configuration file, insert your name where I show system. The conf.c file has constants for the tunable parameters. Type the command below to execute the config program.
# /usr/sbin/config -s system
Step 5--Now rebuild the kernel by linking the driver objects to the basic kernel.
# make -f config.mk
Step 6--Save the old system configuration file.
# mv /stand/system /stand/system.prev
Step 7--Save the old kernel.
# mv /stand/vmunix /stand/vmunix.prev
Step 8--Move the new system configuration file into place.
# mv ./system /stand/system
Step 9--Move the new kernel into place.
# mv ./vmunix_test /stand/vmunix
Step 10--You are ready to boot the system to load the new kernel.
# shutdown -r -y 60

Solaris 2.5

Suppose we were going to run Oracle on our Sun system under Solaris 2.5 and you wanted to change max_nprocs to 1000 and set up the following Interprocess Communications configuration for your shared memory and semaphore parameters:
SHMMAX 2097152 (2 x the default 1048576)
SHMMIN 1
SHMNI 100
SHMSEG 32
SEMMNI 64
SEMMNS 1600
SEMMNU 1250
SEMMSL 25
Step 1--As root, enter the commands below:
# cd /etc
# cp system system.old - create a backup
Step 2
# vi system
Add or change the following:
set max_nprocs=1000
set shmsys:shminfo_shmmax=2097152
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=32
set msgsys:seminfo_semmni=64
set msgsys:seminfo_semmns=1600
set msgsys:seminfo_semmnu=1250
set msgsys:seminfo_semmsl=25
Save and close the file.
Step 3--Reboot your system by entering the following command.
# shutdown -r now
The above kernel parameter and kernel module variables are now set for your system.

SVR4

In this example we will set the tunable NPROC to 500 and then rebuild the kernel to reflect this new value.
Step 1--Log into the system as root and make a backup of /stand/unix to another area.
# cp /stand/unix /old/unix
Step 2
#cd /etc/conf/cf.d
Edit the init.base file to include any changes that you made in the /etc/inittab file that you want to make permanent. A new /etc/inittab file is created when a new kernel is built and put into place.
Step 3--In this step you edit the configuration files in the /etc/conf directory. We will only change /etc/conf/cf.d/stune (although you can change /etc/conf/cf.d/mtune). The stune and mtune files contain the tunable parameters the system uses for its kernel configuration. stune is the system file that you should use when you alter the tunable values for the system. It overrides the values listed in mtune. mtune is the master parameter specification file for the system. It contains the tunable parameters' default, minimum, and maximum values.
The following command line is an example of how you make stune reflect a parameter change.
# /etc/conf/bin/idtune NPROC 500
You can look at stune to see the changes. (stune can be altered by using the vi editor)
Step 4--Build the new kernel.
# /etc/conf/bin/idbuild
It will take several minutes to complete.
Step 5--Reboot the computer system to enable the new kernel to take effect.
# shutdown -I6 -g0 -y
To see your changes, log back into your system and execute the sysdef command. The system parameters will then be displayed.

AIX 4.2

Unlike the preceding examples, the AIX operating system requires a special tool to reconfigure the kernel. This tool is the System Management Interface Tool (SMIT), developed by IBM for the AIX operating system. The AIX kernel is modular in the sense that portions of the kernel's subsystems are resident only when required.
The following shows a SMIT session to change the MAX USERS PROCESSES on an AIX 4.2 system. This is demonstrated to the reader by screen prints of an actual kernel configuration session. While using SMIT you can see the commands sequences being generated by SMIT by pressing the F6 key. SMIT also makes two interaction logs that are handy for post configuration review. SMIT.LOG is an ASCII file that shows all menu selections, commands, and output of a session. SMIT.SCRIPT shows just the actual command line codes used during the session.
Step 1--At root, start SMIT with the following command. This will bring up the IBM SMIT GUI interface screen.
# smit
Figure 19.7.
Systems management interface tool.
Step 2--Select "System Environments" from the System Management menu with your mouse.
Figure 19.8.
SMIT--System environments.
Step 3--Select "Change/Show Characteristics of Operating System" from the System Environment menu with your mouse.
Figure 19.9.
SMIT--Change/Show Characteristics of Operating System.
Step 4--Change "Maximum number of PROCESSES allowed per user" to "50" in the "Change/Show Characteristics of Operating System" menu. Do this by selecting the field for "Maximum number of PROCESSES" with your mouse. Then change the current value in the field to "50."
Figure 19.10.
Maximum number of processes changed to 50.
Step 5--After making your change, select the "OK" button to make the new kernel parameters take effect.
Step 6--The System Management Interface Tool will respond with a "Command Status" screen. Verify that there are no errors in it. If there are none, you are done.
Figure 19.11.
SMIT--Command Status screen.
If an error is returned it would look like the following screen print.
Figure 19.12.
SMIT--Possible Error Screen example.

Linux

The point-to-point protocol (PPP) allows you to dial-in over a telephone line and run Transmission Control Protocol/Internet Protocol (TCP/IP).This allows you to run your GUI applications that use IP from a system that is not directly connected to a network. Let's look at how to configure PPP into the Linux kernel.
Step 1--Linux source code is usually found in the /usr/rc/linux directory. Let's start by changing to this directory by typing the following command.
# cd /usr/src/linux
Step 2--Type the following:
# make config
You will be presented with a series of questions asking if you would like to include or enable specific modules, drivers, and other kernel options in your kernel. For our build, we are concerned that we have a modem and the required networking device driver information configured into our kernel. Make sure you have answered [y] to:
Networking Support (CONFIG_NET)
Network device support (CONFIG_NETDEVICES)
TCP/IP networking (CONFIG_INET)
PPP (point-to-point) support (CONFIG_PPP)
For the most part, you can accept the defaults of most of the questions. It's probably a good idea to go through this step once without changing anything to get a feel for the questions you will need to answer. That way you can set your configuration once and move on to the next step.
After you respond to all the questions, you will see a message telling you that the kernel is configured (it still needs to be built and loaded).
Step 3--The next two commands will set all of the source dependencies so that you can compile the kernel and clean up files that the old version leaves behind.
# make dep
# make clean
Step 4--To compile the new kernel issue the make command.
# make
Don't be surprised if this takes several minutes.
Step 5--To see the new kernel, do a long listing of the directory.
# ls -al
You should see vmlinux in the current directory.
Step 6--You now need to make a bootable kernel.
# make boot
To see the compressed bootable kernel image, do a long listing on arch/i386/boot You will see a file named zImage.
Step 7--The last step is to install the new kernel to the boot drive.
# make zlilo
This command will make the previous kernel (/vmlinuz) to become /vmlinuz.old. Your new kernel image zImage is now /vmlinuz. You can now reboot to check your new kernel configuration. During the boot process, you should see messages about the newly configured PPP device driver scroll across as the system loads.
Once everything checks out and you are satisfied with your new Linux kernel, you can continue on with setting up the PPP software.

Summary

We began our discussion by defining the UNIX kernel and the four basic subsystems that comprise the Operating System. We described how Process Management creates and manages the process and how Memory Management handles multiple process in the system. We discussed how the I/O subsystem takes advantage of swapping and paging to balance the system's load and the interaction of the I/O subsystem with the file management subsystem.
Next, we covered the steps involved in altering the kernel configuration. We demonstrated in detail the steps involved in configuring:
HP-UX 10.X
Solaris 2.5
System V Release 4 (SVR4)
AIX
Linux
In the author's opinion, the systems administrator should become familiar with the concepts presented in this chapter. Further in-depth study of the kernel and its four subsystems will make the systems administrator more knowledgeable and effective at systems management.


 
 


Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!

    


  

SPONSORED LINKS
Technical support Computer security Computer technical support
Computer training Free computer technical support


YAHOO! GROUPS LINKS




Reply via email to