Theory of operation
The steps that the workstation will go through
-
Load the linux kernel into the memory of the workstation. This can be done several different ways, including:
-
Bootrom (Etherboot,PXE,MBA,Netboot)
-
Floppy
-
Hard disk
-
CD-ROM
-
USB Memory device
Each of the above booting methods will be explained later in this chapter.
-
-
Once the kernel has been loaded into memory, it will begin executing.
-
The kernel will initialize the entire system and all of the peripherals that it recognizes.
-
This is where the fun really begins. During the kernel loading process, a ramdisk image will also be loaded into memory. A kernel command line argument of root=/dev/ram0 tells the kernel to mount the image as the root directory.
-
Normally, when the kernel is finished booting, it will launch the init program. But, in this case, we've instructed the kernel to load a small shell script instead. We do this by passing init=/linuxrc on the kernel command line.
-
The /linuxrc script begins by scanning the PCI bus, looking for a network card. For each PCI device it finds, it does a lookup in the /etc/niclist file, to see if it finds a match. Once a match is found, the name of the NIC driver module is returned, and that kernel module is loaded. For ISA cards, the driver module MUST be specified on the kernel command line, along with any IRQ or address parameters that may be required.
-
A small DHCP client called dhclient will then be run, to make another query from the DHCP server. We need to do this separate user-space query, because we need more information than the bootrom retrieved with the first dhcp query.
-
When dhclient gets a reply from the server, it will run the /etc/dhclient-script file, which will take the information retrieved, and configure the eth0 interface.
-
Up to this point, the root filesystem has been a ram disk. Now, the /linuxrc script will mount a new root filesystem via NFS. The directory that is exported from the server is typically /opt/IndClient/i386. It can't just mount the new filesystem as /. It must first mount it as /mnt. Then, it will do a pivot_root. pivot_root will swap the current root filesystem for a new filesystem. When it completes, the NFS filesystem will be mounted on /, and the old root filesystem will be mounted on /oldroot.
-
Once the mounting and pivoting of the new root filesystem is complete, we are done with the /linuxrc shell script and we need to invoke the real /sbin/init program.
-
Init will read the /etc/inittab file and begin setting up the workstation environment.
-
One of the first items in the inittab file is the rc.sysinit command that will be run while the workstation is in the 'sysinit' state.
-
The rc.sysinit script will create a 1MB ramdisk to contain all of the things that need to be written to or modified in any way.
-
The ramdisk will be mounted as the /tmp directory. Any files that need to be written will actually exist in the /tmp directory, and there are symbolic links pointing to these files.
-
The /proc filesystem is mounted.
-
The lts.conf file will be parsed, and all of the parameters in that file that pertain to this workstation will be set as environment variables for the rc.sysinit script to use.
-
If the workstation is configured to swap over NFS, the /var/opt/IndClient/swapfiles directory will be mounted as /tmp/swapfiles. Then, if there isn't a swapfile for this workstation yet, it will be created automatically. The size of the swapfile is configured in the lts.conf file.
The swapfile will then be enabled, using the swapon command.
-
The loopback network interface is configured. This is the networking interface that has 127.0.0.1 as its IP address.
-
If Local apps is enabled, then the /home directory will be mounted, so that the apps can access the users home directories.
-
Several directories are created in the /tmp filesystem for holding some of the transient files that are needed while the system is running. Directories such as:
-
/tmp/compiled
-
/tmp/var
-
/tmp/var/run
-
/tmp/var/log
-
/tmp/var/lock
-
/tmp/var/lock/subsys
will all be created.
-
-
The /tmp/syslog.conf file will be created. This file will contain information telling the syslogd daemon which host on the network to send the logging information to. The syslog host is specified in the lts.conf file. There is a symbolic link called /etc/syslog.conf that points to the /tmp/syslog.conf file.
-
The syslogd daemon is started, using the config file created in the previous step.
-
Once the rc.sysinit script is finished, control returns back to the /sbin/init program, which will change the runlevel from sysinit to 5.
This will cause any of the entries in the /etc/inittab file to be executed.
-
By default, there are entries in inittab to run the /etc/screen_session script on tty1, tty2 and tty3. That means that you can run 3 sessions at a time, and the type of session is controlled by the SCREEN_01, SCREEN_02 and SCREEN_03 entries in lts.conf.
More entries can be setup in inittab for more sessions, if desired.
-
If SCREEN_01 is set to a value of startx , then the /etc/screen.d/startx script will be executed, which will launch the X Windows System, giving you a graphical user interface.
In the lts.conf file, there is a parameter called XSERVER. If this parameter is missing, or set to "auto", then an automatic detection of the video card will be attempted. If the card is PCI or AGP, then it will get the PCI Vendor and Device id, and do a lookup in the /etc/vidlist file.
If the card is supported by Xorg 6.7, the pci_scan routine will return the name of the driver module. If it is only supported by XFree86 3.3.6, pci_scan will return the name of the X server to use. The startx script can tell the difference because the older 3.3.6 server names start with 'XF86_', whereas the newer Xorg X server modules are typically lowercase names, like ati or trident .
-
If Xorg is used, then the /etc/build_x4_cfg script will be called to build an XF86Config file. If XFree86 3.3.6 is used, then /etc/build_x3_cfg will be called to build the XF86Config file. These files are placed in the /tmp directory. Which, if you'll remember, is a ramdisk, seen only by the workstation.
The XF86Config file will be built, based on entries in the /etc/lts.conf file.
-
Once the XF86Config file has been built, then the startx script will launch the X server with that new config file.
-
The X server will send an XDMCP query to the IndClient server, which will offer a login dialog.
-
At this point, the user can log in. They'll get a session on the server.
This confuses many people at first. They are sitting at a workstation, but they are running a session on the server. All commands they run, will be run on the server, but the output will be displayed on the workstation.