Creating a Complete Distribution on CD
When your first trial CD is working, it's time to do some cleaning. Basically, there are two locations where some major cleaning up of the boot process can be done. First, you have to take care of /etc/rc.d/rc.sysinit. In this file, which always is executed on system boot, a lot of things are taken care of and probably a lot of things can be skipped for your specific configuration. The most important things to look at all are the instances where files are created. Besides that, you can disable the lines where services are activated that you don't need. Think, for example, of services such as isapnp setup and probably many more.
Next, you have to clean the boot-up of your runlevel. Let's first do a quick refresher of how services are activated when entering a runlevel. On Red Hat, you find all the general scripts used to start services in /etc/rc.d/init.d. A script called smb, for instance, can be used to start Samba services. If you want this script to be executed when entering runlevel 3, you have to create a symbolic link that starts with S followed by a number to determine the exact moment when the script should be executed. By default, many of these links probably start services you don't need. You could encounter, amongst others, the link S60lpd in /etc/rc.d/rc3.d, which dictates that the line printer dæmon is started every time you enter runlevel 3. In order to clean the startup procedure of services you don't need, simply remove all of these links.
Returning to our initial example, say you want to use your Linux distribution for customers who have to complete an evaluation without providing a user name and password. By changing a simple line in /etc/inittab, you can log in your users automatically. You can use any account you like, because it is a read-only filesystem--you even could use root if you wanted. In order to log in to the system automatically, change
1:2345:respawn:/usr/bin/open -c 1 -w -- /bin/login -f username
Don't forget to remove the password for the user you are here. You probably don't want to oblige your users to fill in anything before they can start using your CD.
Before you can give the CD to an innocent user, you need to take one more step, making it possible to start the X Window System. It is rather easy to make this happen; simply give your default user a writable home directory. At an earlier stage you created a read/write accessible /var director, so this is a nice location in which to create the home directory. After that, X is happy to be able to create its temporary files, and everything works the way it should.
For Knoppix and the source code used for Knoppix automatic hardware detection, go to www.knoppix.org.
Sander van Vugt lives in the Netherlands. He works for Azlan Network Training (part of the Techdata Group) as a trainer and consultant, and he has written several books and articles about Linux.
- VMware's Clarity Design System
- Let's Go to Mars with Martian Lander
- My Childhood in a Cigar Box
- Applied Expert Systems, Inc.'s CleverView for TCP/IP on Linux
- Papa's Got a Brand New NAS
- Rogue Wave Software's TotalView for HPC and CodeDynamics
- Panther MPC, Inc.'s Panther Alpha
- Jetico's BestCrypt Container Encryption for Linux
- GENIVI Alliance's GENIVI Vehicle Simulator