# genkernel boot delays

## ivi3

Hi @all,

I have set up an encrypted gentoo installation with lvm on my laptop.

Now I have the problem that my kernels compiled with genkernel-3.4.8 (--lvm2 --luks all) have to long timeouts when I boot my system. Once when "Loading modules..." and after "Activating mdev".

An older kernel compiled with genkernel-3.4.6 hasn't this problem but I cannot compile any kernels with this version till I updated my busybox and kernel-headers.

Has someone the same delays or an advice for me how to fix this?

Greetings

ivi3Last edited by ivi3 on Tue Jul 31, 2007 7:37 pm; edited 1 time in total

----------

## TuxeyM

I am having the same exact problem with this update genkernel except I am using good old ext3.

It pauses at "loading tg3....................... [OK]

and then again at

"Activating Mdev" 

both for a solid 10 seconds...

It never used to do this before...

----------

## ivi3

Good to know I am not alone   :Sad: 

Perhaps we sould fill a bug report...

----------

## dafi

I had the same problem. Don't know why. I recompiled the kernel sources without genkernel. Now everything works fine.

----------

## ivi3

Does this mean you compiled the kernel by hand and know you are using the initramfs from genkernel together with your manual compiled kernel image?! 

I need the initrd/initramfs from genkernel because I have an encrypted device with an lvm in it. I have to encrypt the device and activate the lvm afterwards because my root is in this lvm... so this is why I am need genkernel...

----------

## dafi

 *Quote:*   

> Does this mean you compiled the kernel by hand and know you are using the initramfs from genkernel together with your manual compiled kernel image?!

 

No. I just don't use initramfs.

----------

## nubla

Same problem here. A bigger delay after finishing Loading modules...  and then on Activating mdev. There are no errors or warnings in /var/log/messages... I have only genkernel, no encryption is set up. What's going on here?

(2.6.21-suspend2-r7, ext3, system ~x86)

----------

## saturday

Me, too. 

x86, linux-2.6.21-gentoo-r4.

----------

## ivi3

If there is no bug report, I will make one this afternoon.

----------

## programfan

I have got exactly the same problem.

suspend2-2.6.21-r7, genkernel 3.4.8, x86

----------

## gunnl

same here,

loading modules hangs for some secs and activating mdev also.

Genkernel; Version 3.4.8

gentoo-sources version 2.6.22-gentoo-r2

amd64

thinkpad X61s 7669-27G

----------

## Sephiroth_666

Hi, i got the same problems.

After messing around with initramfs scripts and google i found some interesting things and i reduced my boot time by 20 seconds.

You can either try those kernel options:

nodetect

it will skip the modules searching & loading parts except those you have specified in kernel option (like dolvm2 etc....). Be careful if you need additionnal modules to be loaded by the initramfs that are not specified in the kernel options (i don't so that's the one i'm using, haven't tried the one below)

or

noload=x,y,z

where x y and z are modules groups found in /usr/share/genkernel/****your_arch****/modules_load (don't forget remplacing ****your_arch****) 

It skips the specified modules groups 

you can also read http://gentoo-wiki.com/HOWTO_Initramfs for further kernel/initramfs options =)

My grub entry:

kernel /boot/kernel-2.6.22-gentoo-r2 root=/dev/ram0 init=/linuxrc real_initd=initng ramdisk=8192 real_root=/dev/lvm00/gentoo dolvm2 splash=silent,theme:Lain CONSOLE=/dev/tty1 vga=0x318 video=vesafb:mtrr:3,ywrap nmi_watchdog=0 nodetect

Please tell me if it works for you

----------

## gentryx

big thanks, this works like a charm for me   :Laughing: 

----------

## Seek

This delay exists because newer genkernel versions are waiting for slow usb devices for some reason.

I found this lines in /usr/share/genkernel/generic/initrd.scripts

```
                for dir in /sys/bus/usb/drivers/usb-storage/*

                do

                        if [ -d "${dir}" ]

                        then

                                FORCE_slowusb="1"

                        fi

                done

                if [ "${DO_slowusb}" ] || [ "${FORCE_slowusb}" ]

                then

                        sleep 10

                fi

                kill_devfsd

                good_msg 'Activating mdev'

                runmdev

                if [ "${DO_slowusb}" ] || [ "${FORCE_slowusb}" ]

                then

                        sleep 10

                fi

```

As you can see genkernel looks for some directories in /sys/bus/usb/drivers/usb-storage.

This directories are created by the kernel when the option SYSFS_DEPRECATED (Genral Options: Create deprecated sysfs files) is enabled.

Disable the option, recompile and you should save up to 20-30 seconds at boot.   :Very Happy: 

If this does not work for you, you can simply comment the two sleeps in  /usr/share/genkernel/generic/initrd.scripts out.

Whatever you do, you can still use genkernels hardware detection.   :Wink: 

----------

## joeyjoey

I have Gentoo installed on a USB drive (Westerndigital 250G). I upgraded from genkernel-x86-2.6.21-gentoo-r4 to genkernel-x86-2.6.22-gentoo-r5 and all went well except for a problem similar to the above issues.

When the process gets to 

loading modules...

(it says scanning for .... and finds all the modules correctly but when it finishes the last one which is..

scanning for lpfc....lpfc loaded

it stops for several seconds

then it goes to 

>>activating MDEV and waits several seconds before continuing correctly and booting.

The thing is that when I run my old kernel it does not make these two pauses. I have tried several of the fixes in this thread but they do not work. I have not however tried the recompiling option above as I am not sure it is relevant to my situation.

What to do?

----------

## Seek

If you don't want to recompile your kernel without the deprecated sysfs files, you can open /usr/share/genkernel/generic/initrd.scripts and comment out the relevant sleeps.

But don't forget to rebuild your initrd to use the changes you made in your initrd.

```
genkernel initrd [--gensplash=livecd-2007.0 --YOUR-OPTIONS]
```

This will only take a few seconds and not change your kernel.

I really see no other solution than this if genkernel's hardware detection is needed, although editing genkernel-scripts is not a good solution at all.

----------

## joeyjoey

@ Seek,

I tried to recompile the kernel but no change.

So I tried changing the sleeps to zero. It works perfectly thanks!

It had not worked before because I did not do 

```
 genkernel initrd
```

By the way where do you comment out the sleeps completely. Being a noob I just put a "#" in front of the sleeps line and got a kernel panic. Thats why I set them to zero.

----------

## Seek

I'm very sorry,  my mistake.

I just noticed that I set them to zero too, otherwise there would be a syntax error in the script.

It's good to know that syntax errors in genkernel scripts are producing kernel panics.. lol

Well, I think I'm the n00b and I hope you didn't have too much difficulties because of my stupid advice.   :Confused: 

As soon as I found a better solution I'll post it here.

----------

## nubla

 *Seek wrote:*   

> As soon as I found a better solution I'll post it here.

 

It seems that you don't have to.

I did your trick to set the sleep to 0 and it work perfectly.

Today i updated to genkernel 3.4.9_pre1 and recreated the initrd. And there were no more lags...

----------

## Seek

 *nubla wrote:*   

>  *Seek wrote:*   As soon as I found a better solution I'll post it here. 
> 
> It seems that you don't have to.
> 
> I did your trick to set the sleep to 0 and it work perfectly.
> ...

 

Yay, that sounds good!

I though the changed file will be replaced, but it's nice to hear that we won't expericence this delay in the future.  :Smile: 

----------

## nubla

 *Seek wrote:*   

> 
> 
> I though the changed file will be replaced, ...
> 
> 

 

You misunderstand me   :Smile:  , it was replaced. I wanted to say that they fixed the problem in version 3.4.9_pre1. The corresponding part in /usr/share/genkernel/generic/initrd.scripts is completely rewritten.

----------

## Seek

LOL! I completely misunderstood that.   :Embarassed: 

Thanks for posting, I'll upgrade my genkernel too ^^

( There would be something to worry about if /usr/share/genkernel/generic/initrd.scripts won't get replaced.. )

----------

## contextswitch

... is to edit /usr/share/genkernel/generic/initrd.defaults and find this line:

```
HWOPTS='usb firewire keymap cache pata sata evms lvm dmraid mdadm slowusb fs'
```

simply delete the slowusb option from this list and then run

```
genkernel initrd
```

----------

