Booting even faster with mkinitcpio

First things first: I’m not going to go into huge detail over mkinitcpio, because the Arch Wiki, the 0.8 installer and the /etc/mkinitcpio.conf file have plenty of information to get you started.

I think the key is to keep things as lean as possible. You have the option of turning off the udev event inside mkinitcpio.conf (by omitting it from the hooks line, that is) and building the initramfs module by module, and for this machine that makes a big, big difference timewise.

For example, here are the pertinent lines from my mkinitcpio.conf file, less the extensive commenting:

MODULES="piix ata_piix ide_disk"
BINARIES=""
FILES=""
HOOKS="base ide filesystems"

As you can see, it’s very slim. I don’t even use autodetect. Of course, I don’t have much in the way of fancy hardware, so I can afford to keep it slim.

I’ve tried variations on what you see there, and inevitably it left me with a broken system. Luckily you can reboot with the fallback boot option and fix what you damaged. I think that’s what I like best about mkinitcpio: It’s easy to recover from … so long as you have time enough to keep your patience. ;)

I let the hwdetect sequence pick modules at first, and then pruned it down further. I use ext2 and ext3 as filesystems, so I didn’t need anything else to get going. There’s a complete list of hooks on the wiki page.

Remember that this isn’t like the MODULES line in /etc/rc.conf. As I understand it, this is all about getting the core hardware going, then passing control to your complete system setup. So you don’t want sound or video or network modules here, you want them in /etc/rc.conf.

Building takes a little time on this laptop; no doubt you’ll have better luck if your computer was made after 1998. :roll:

Personally, I really love this. Combining this with manually inserted modules in the kernel have easily cut as much as 30 seconds off my boot time for this machine. That puts it well within reach of my main laptop, a 1Ghz Pentium III running Openbox on Ubuntu Edgy.

So to have a six-second difference in boot times between this and a machine that runs more than three times as fast … is giddying.

About these ads

3 Responses to “Booting even faster with mkinitcpio”


  1. 1 fd 2009/10/17 at 12:54 AM

    filesystems

    could be e.g. “ext4″ on the MODULES line.

  2. 2 The same guy 2009/11/28 at 6:36 AM

    My mkinitcpio.conf:

    # /bin/bash
    # /etc/mkinitcpio.conf

    MODULES=”ahci sd-mod ext4″
    BINARIES=””
    FILES=””
    HOOKS=”base”

  3. 3 fjew 2010/02/20 at 8:31 PM

    It’s also unnecessary to have ide hook and piix, ata_piix annd ide_disk modules. They will cover each other nevertheless.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,963,198 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: