You are not logged in.

#1 2009-04-05 02:59:16

pharcyde
Member
From: Connecticut
Registered: 2009-03-13
Posts: 88

mkinitcpio module help?

Today I comipled my first kernel, everything is well.  What I'm trying to do is find the right modules to load on startup so I can get rid of udev. Every thing I have tried has left me with $ramfs prompt. I've been using hwdetect and hwinfo to detect the modules:

pharcydez ~ $ hwdetect --show-modules-order
MODULES ORDER: button processor thermal hid usbhid evdev psmouse rtc-cmos nvidia usbhid usbcore ehci-hcd ohci-hcd
----- /proc/modules -----
  oss_usb 124948 0 - Live 0xffffffffa0bd0000
  oss_sbxfi 33984 0 - Live 0xffffffffa0bc5000
  osscore 546564 2 oss_usb,oss_sbxfi, Live 0xffffffffa0b3d000
  fuse 60800 4 - Live 0xffffffffa0b2c000
  reiserfs 241216 1 - Live 0xffffffffa0aef000
  ext4 235480 1 - Live 0xffffffffa0ab3000
  jbd2 72456 1 ext4, Live 0xffffffffa0a9f000
  crc16 1952 1 ext4, Live 0xffffffffa004a000
  usbhid 40224 0 - Live 0xffffffffa0a93000
  hid 49152 1 usbhid, Live 0xffffffffa0a85000
  ohci_hcd 25692 0 - Live 0xffffffffa0a7c000
  fan 5224 0 - Live 0xffffffffa0004000
  ehci_hcd 39308 0 - Live 0xffffffffa0a70000
  battery 12488 0 - Live 0xffffffffa0a6a000
  evdev 11584 7 - Live 0xffffffffa0a65000
  thermal 18880 0 - Live 0xffffffffa0a5e000
  psmouse 46076 0 - Live 0xffffffffa0a4d000
  usbcore 160912 5 oss_usb,usbhid,ohci_hcd,ehci_hcd, Live 0xffffffffa0a20000
  button 7296 0 - Live 0xffffffffa0a19000
  processor 36940 1 thermal, Live 0xffffffffa0a0a000
  sg 29280 0 - Live 0xffffffffa09fd000
  nvidia 10136120 26 - Live 0xffffffffa004d000 (P)
  rtc_cmos 11992 0 - Live 0xffffffffa0045000
  ext3 144080 1 - Live 0xffffffffa001c000
  jbd 63296 1 ext3, Live 0xffffffffa0007000
  mbcache 8132 2 ext4,ext3, Live 0xffffffffa0000000
----- /proc/modules end -----
]

I assume disk controller is not needed since it was built-in to the kernel. Which of these modules are required for boot? Anything I'm missing? I would like to load only the modules required for boot and pass the rest to rc.conf as the wiki suggests.

Last edited by pharcyde (2009-04-05 03:08:47)

Offline

#2 2009-04-05 03:20:16

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: mkinitcpio module help?

disk related stuff:
controler(s), file system(s)

why do you want to get rid of udev?
boot time?
if so not worth your time
1) properly configured udev uses ~200ms (does not affect boot time even if ~1000ms)
2) no udev = problem with (manual) loading some devices
3) no speed gain
4) you will get more by getting rid of initrd

Offline

#3 2009-04-05 03:24:49

pharcyde
Member
From: Connecticut
Registered: 2009-03-13
Posts: 88

Re: mkinitcpio module help?

udev uses 18ms for me - boot time is what I was after. I was under the impression the gain would be more substantial. Thanks.

Last edited by pharcyde (2009-04-05 03:29:09)

Offline

#4 2009-04-05 09:12:33

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: mkinitcpio module help?

You get the big speedup by building a kernel that has all your modules not as modules, but compiled statically into the kernel (your /lib/modules/<kernel-version>/ should be almost devoid of modules). That way, all udev has to do is create the device nodes (which is the major plus of using udev), and that doesn't take a whole lotta time.
So, to get the speedup you're after:
1 Invest some time in learning how the kernel works (subsystems and all), deciding which you need and which you don't
2 Wrestle your way through 'make menuconfig' and disabling all the stuff you don't need, changing all "<M>"'s into "<*>"'s so they'll not be modules.
3 build and install the kernel
4 remove the initrd line from the grub-section that loads your kernel
5 check what's missing/wrong
6 Rinse and repeat

All in all a fun project and you get to learn some stuff along the way. It does take a bit of crafting to get it right though.

EDIT: you won't get a big speedup from just compiling the kernel with the default arch-config. If you thought the CFLAGS in makepkg.conf were going to help, they don't. The kernel uses it's own CFLAGS/CXXFLAGS and LDFLAGS, which you can only change by using some patchsets (look into zen-kernel for example).

Last edited by klixon (2009-04-05 09:16:37)


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#5 2009-04-06 12:36:43

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: mkinitcpio module help?

udev uses 18ms for me - boot time is what I was after. I was under the impression the gain would be more substantial. Thanks.

let's be serious 1ms = 0.001s
this means that (in your case) computer would spend more time on printing on the computer screen this than scanning udev.

Forget about flags, there is nice comparison of the effect of different flags on kernel at gentoo site. No effect whatsoever.
modules vs static
this one is not so easy.
best example is that not every module would be loaded at boot time, forcing device to load by static linking will slow down instead of speed up boot time.

However there is a lot of debugging logging going on during boot time. Most is hidden, you can un-hide it then disable. Simple commenting out of specific options directly in the kernel config file will not work obviously.

Last edited by broch (2009-04-06 12:37:40)

Offline

#6 2009-04-06 13:06:58

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: mkinitcpio module help?

If your goal is to reduce boot time, look around in the forum. This has been discussed a lot of times. I just finished my tweaking (or did I? It never finishes lol) and got the boot time down to 11 seconds from grub menu to gnome desktop. Largely because of not using initramfs (compiled all modules required in the kernel), and using another init script (see the forums, I think it's called fastinit or something like that).

Offline

Board footer

Powered by FluxBB