My Booting process (Linux)

I use switch distris quite often, this is on Mandrake 10.0 (tha last real Mandrake)

Original booting

Normally, the rc.d works like this:

  1. System init (mounting root, init swaps, keyboard, usb, firewire, 100 other things
  2. starting services for Runlevel (one by one)
  3. starting X (if runlevel is 5)

Where do i have to look?

  • In the kernel code, look for boot (if you are hardcore).
  • The kernel starts the init program (most likely in /sbin/)
  • The init runs /etc/inittab. (see man inittab)
  • inittab runs (in most distris) all services from /etc/rc.d/rc{RUNLEVEL}.d/S* with the parameter start and all services from /etc/rc.d/rc{RUNLEVEL}.d/K* with the parameter stop. These are most likely links to the files in /etc/rc.d/init/, the service start scripts.

I didn’t like this, especially waiting for my network card to detect that there is no connection, my keytable, firewire and so on... I just wanted to have my X ready as soon as possible. Also, i have some services that are nice to have, but I don’t want to wait for them and don’t need them at boot time.

Modified Booting

I rewrote my system init script(s) to do what i need. That is

  1. Mount what’s needed.
  2. Start all necessary services for X (X Font server, X)
  3. (here, tty7 already pops up)
  4. Start other necessary services (like usb, keytable, ...)
  5. Wait 5 seconds (giving X CPU time)
  6. Start other optional services parallel with nice value 10 (network, kheader, cpufreq, ...)

This has the great effect that X is ready very early, and since i have eth0 only sometimes, the other services don’t wait for the network service. I also don’t need other features (like cpufreq) when I boot my laptop, but it’s nice to have after a while.

Using this and IceWM as Window Manager, my (1GHz) Laptop boots in 30 seconds now (to a ready graphical interface). Nice! ;-)

Also i like to not start a tty on tty1, so i can see if something failed. it would be nice if the screen output was logged somewhere with the success or error messages. But i guess it could be a problem if / isn’t mounted yet. Anyhow, there is a manual out there to send all msgs (kernel, init) to /dev/ttyS0 (serial device).