Slackware: The boot process

Slackware's boot process maintains the logic of the typical Linux boot sequence, but uses BSD style init scripts instead of the SystemV style more common in other mainstream Linux distro. The main boot sequence actors are always:
- Linux Loader (Lilo by default)
- Kernel (2.4 in Slackware 10)
- Init and its initialization scripts.
Let's explore the involved components in a Slackware 10 boot process (most of what is reported here applies also to older Slackware versions).

Linux Loader
Lilo is the default choice in Slackware 10 and /etc/lilo.conf its configuration file. The default settings are essential: you find only the entries defined in the installation procedure (no fallback options to safe boot options or memtest labels) and an handy selection of VGA codes for different console resolutions.
A log of the Lilo related activities during installation is placed in /var/log/setup/setup.liloconfig
The program /sbin/mkrescue is available for the creation of a bootable rescue floppy disc or CD ISO image.
Documentation is available as man pages and docs/samples in /usr/doc/lilo-version/.

Kernel
The kernel image referenced in lilo.conf, /boot/vmlinuz, is a symlink to the actual kernel file (for example   /boot/vmlinuz-ide-2.4.26).
In the same directory you find the configuration file used for the kernel compilation (ie: /boot/config-ide-2.4.26) and System.map. The default kernel package is optimized for 486 architecture.
Kernel modules are provided by a different package and placed in the standard /lib/modules/kernelversion.
The /etc/rc.d/rc.modules initialization script explicitly loads (modprobe) selected kernel modules at boot time. It's mostly not necessary for kernel compiled for module autoloading, as the default Slackware kernel, so most of its lines are commented.
The Kernel headers, necessary to compile system software, as in other distros, are provided by an autonomous package and placed in /usr/include/linux and /usr/include/asm-i386/

Init
The major differences of Slackware, compared to other Linux distros as RedHat, Mandrake, Debian or Suse, stays in the absence of /etc/rc.d/rc#.d directories (where # is the selected runlevel) with symlinks to the startup scripts of different services, typical of the SystemV style logic. However a simple /etc/rc.d/rc.sysvinit script provides basic compatibility with SystemV style startup scripts, looking for S/K files in /etc/rc.d/rcrunlevel.d/. Note that by default Slackware doesn't create these directories.
Whatever the init scripts, a sysadmin always knows where to begin his quest for system awareness: /etc/inittab.
A Unix multi-level logic is always present, different runlevels place the system in different states:
0 - System halted
1 - Single user mode without network, needed for maintenance (root's password is still required)
3 - Multiuser mode with network support and text login (default)
4 - Multiuser mode with network support and X Window support (xdm graphic login). Note that in many other distro this is 5.

From Init's configuration file is possible to reconstruct the whole userland phase of the boot process:
/etc/rc.d/rc.S is the first script to be executed. It handles common general initialization activities: starts the devfs, if supported; activates swap partitions; checks the root filesystem (if hard problems occur /bin/sulogin is invoked asking the root password for system maintenance); remounts root system in read/write mode; initializes the Logical Volume Manager, if present; checks and mounts other (non network) filesystems in /etc/fstab; cleans up some temporary files; overwrites /etc/motd/ with the current kernel version (to comment out to keep previous custom Messages of the Day); configures ISA Plug&Play devices; sets the system time according to the hardware clock time; sources the /etc/rc.d/rc.modules for non automatic kernel modules loading; sources /etc/rc.d/rc.serial (note that this function is commented by default) for serial ports initialization; improves the system's randomness.

/etc/rc.d/rc.K is used only to bring the system to runlevel 1 where every network and system service is disabled.

/etc/rc.d/rc.M is executed for multiuser support at runlevels 2,3,4,5.
It sets screen blanking after 15 minutes of idleness; defines the system's hostname according to what is written in /etc/HOSTNAME; activates PCMCIA support running /etc/rc.d/rc.pcmcia start; initializes the networking hardware and IP parameters running /etc/rc.d/rc.inet1; initializes hotplug support (/etc/rc.d/rc.hotplug start); starts various network services via /etc/rc.d/rc.inet2 (it mounts remote NFS/SMB shares, starts the portmapper, activates firewalling (/etc/rc.d/rc.firewall start) and IP forwarding (/etc/rc.d/rc.ip_forward start), launches Inetd (/etc/rc.d/rc.inetd start), the OpenSSH server (/etc/rc.d/rc.sshd start), the Bind DNS server (/etc/rc.d/rc.bind start), NIS (/etc/rc.d/rc.yp start) and NFS server (/etc/rc.d/rc.nfsd start); starts system logging (/etc/rc.d/rc.syslog start); removes stale lock files, updates shared libraries links and X font indexes; starts the print spooling subsystem; if uncommented, starts smartd (for hard drives problems early discovery) and genpowerd (for communication with UPS via serial or USB line); enables BSD process accounting (not activated by default); starts crond and atd; activates file system quotas, if configured; launches Sendmail (/etc/rc.d/rc.sendmail start), APM, ACPI (/etc/rc.d/rc.acpid start) and ALSA (/etc/rc.d/rc.alsa); selects the screen font (/etc/rc.d/rc.font) and keymap (/etc/rc.d/rc.keymap); starts Mysql (/etc/rc.d/rc.mysql start), Apache (/etc/rc.d/rc.httpd start), Samba (/etc/rc.d/rc.samba start), the GPM mouse server (/etc/rc.d/rc.gpm start); if there are SystemV init scripts for the current runlevel, it ries to executed them via /etc/rc.d/rc.sysvinit and finally it executes user custom commands in /etc/rc.d/rc.local.

/etc/rc.d/rc4.d is executed just at runlevel 4 and starts the GDM, KDM or XDM session manager for graphical login.

The default getty program used is agetty, inittab provides six virtual terminal consoles (tty1-6) and has commented examples with agetty configuration for console via serial port or and dialup.  
Inittab is completed with the init default runleve set at 3, the "control+alt+del"  reboot "three finger salute" and power failure handling settings.

Privacy Policy