As always, I suggest that you read through the entire lab before you get started!
In this lab we will get additional experience with kernel modules. In the last lab, you downloaded, compiled, and installed a kernel module, but you (probably) didn't really know what it was doing.
LAH describes four methods of modifying the configuration of a kernel. One of them is to load new drivers and modules on the fly into an existing kernel. That is the approach that we explore today.
Change to the directory where kernel modules are stored (refer to LAH 12.8 if you've forgotten where to find them). Recall that uname -r will tell you which kernel you are currently running. On your Red Hat 7.3 machines, there is only one kernel installed, but on other systems kernels will have been upgraded (leaving the old one in place) and so there will be multiple kernel versions. Take a look through the various subdirectories to see what modules (.o files) are there.
Find the vfat module, which is the driver for the Windows FAT filesystem with NT long name support. What type of device do you think the rio500 module supports? Recall that the find command can help you find the rio500.o file, with a find . -name -*rio500.o" -print
The /sbin/lsmod command is used to list the currently loaded modules. Run it to see the modules loaded on your system. If you still have lufs around from last week, it will be listed as one of the modules.
The /sbin/insmod command is used to load a kernel module. Try loading the dummy device. Can you guess what it does? How do you know that it has been loaded? Is it being used?
The /sbin/rmmod command is used to unload a kernel module. Unload the dummy module. How do you know that it is no longer loaded? Can you unload the cdrom module?
Now load the msdos module. You'll get several errors about unresolved symbols. This is because the msmod module has dependencies on another module, and can't be loaded until all dependencies are satisfied. Look at the common prefix for each of the unresolved symbols. Go ahead and load the missing module first, and then load the msdos module next. What does the [msdos] mean in the output of lsmod?
Now unload the two modules you just added, but unload msdos last. Do you understand the error message you got? Now unload them in the correct order.
Many modules are loaded automatically when they are needed, rather than only after being loaded manually as we have been doing so far. However, in order to load certain modules, it is important to know what modules it depends on. That information is stored in a modules dependency file called modules.dep. You can find it in the modules directory. If you grep for msdos, you'll see the dependency that you discovered above.
There is another utility that can automatically resolve module dependencies. It is called modprobe. It can be used to load the msdos module (along with any dependencies).
This time use modprobe to load the dos module. Run lsmod to see which modules are listed. Is there a dos module? What was loaded instead? The command modprobe -c | grep dos will help you understand what is going on.
Aliases are defined in /etc/modules.conf, where you will see that eth0 and eth1 are just aliases for the modules that know how to use the ethernet ports.
We are going to update Apache. First, assume that you've been told that the latest version of Apache for Red Hat 7.3 is packaged in apache-1.3.27-4.i386.rpm. Now go download the package from a Red Hat mirror site. You'll want to select a .EDU site in the US. Not all mirrors will necessarily have updates for all versions of Red Hat Linux. One that worked for me was ftp-linux.cc.gatech.edu.
Now use rpm to upgrade your Apache package. When complete, go to /etc/httpd/conf and note the new files. The package was smart enough to notice that you had changed the httpd.conf file, and so created a new one httpd.conf.rpmnew rather than overwriting the version you had created. Note that this means it is the sysadmin's responsibility to notice config files like this that haven't been updated, and manually make the appropriate changes to the new file and use it instead of the old file.