# Howto reduce the time of startup?

## mirojira

I have installed Gentoo and Archlinux at the same machine. The startup of Gentoo is about 40 sec. and startup of Archlinux is under 20 sec. I know that Archlinux is i686-optimised. So I think that I  could optimise also Gentoo for my machine if I had known how to do it  before I installed Gentoo.

I have ASUS P4P800-VM, Intel Pentium 4, 2.8 GHz, 1G RAM

What should I do to tweak my Gentoo installation?Last edited by mirojira on Fri Jun 02, 2006 7:34 pm; edited 1 time in total

----------

## PaulBredbury

See what's different in /usr/src/linux/.config between the 2 installations.

----------

## beatryder

you could also watch to see which services gentoo loads vs archlinux, and check their docs to see what CFLAGS, and LDFLAGS they use when compiling. If you do find that out. Post it here, I would be interested to see how they compare to mine.

----------

## GetCool

As a very rough observation, you can check the memory usage immediately after a reboot on both installations with "free -m".

This will at least tell you if more libraries are being copied to RAM when you boot Gentoo (which is usually proportional to the amount of services you have starting automatically, anything being preloaded, etc.).

----------

## brazzmonkey

arch linux is able to start services in parallel, by default gentoo isn't. you may want to give initng a shot (check the wiki, it is known to really speedup boot process - i haven't tried it myself though).

----------

## GetCool

 *brazzmonkey wrote:*   

> arch linux is able to start services in parallel

 

Good to know   :Smile: 

----------

## Shan

Gentoo can do semi-paralell startup; checkout /etc/conf.d/rc and make sure you have RC_PARALLEL_STARTUP="yes"

----------

## beatryder

update to baselayout-0.12. I did and shaved 20seconds off my boot time!

----------

## mirojira

 *Shan wrote:*   

> Gentoo can do semi-paralell startup; checkout /etc/conf.d/rc and make sure you have RC_PARALLEL_STARTUP="yes"

 

I did not save almost nothing.

 *beatryder wrote:*   

> update to baselayout-0.12. I did and shaved 20seconds off my boot time!

 

I can't find baselayout-0.12

----------

## mirojira

 *beatryder wrote:*   

> you could also watch to see which services gentoo loads vs archlinux, and check their docs to see what CFLAGS, and LDFLAGS they use when compiling. If you do find that out. Post it here, I would be interested to see how they compare to mine.

 

There is only few info about compiling because Archlinux is binary package system. But it is possible to build own packages using command makepkg. In /etc/makepkg.conf is only:

```

########################################################################

# ARCHITECTURE, COMPILE FLAGS

#########################################################################

#

export CARCH="i686"

export CHOST="i686-pc-linux-gnu"

#-- Exclusive: will only run on i686 or higher (P6, Athlon)

export CFLAGS="-march=i686 -O2 -pipe"

export CXXFLAGS="-march=i686 -O2 -pipe"

#-- Optimized: will run on any x86, but optimized for i686

#export CFLAGS="-mcpu=i686 -O2 -pipe"

#export CXXFLAGS="-mcpu=i686 -O2 -pipe"

#-- Make Flags: change this for DistCC/SMP systems

#export MAKEFLAGS="-j2"

```

----------

## beatryder

 *mirojira wrote:*   

>  *Shan wrote:*   Gentoo can do semi-paralell startup; checkout /etc/conf.d/rc and make sure you have RC_PARALLEL_STARTUP="yes" 
> 
> I did not save almost nothing.
> 
>  *beatryder wrote:*   update to baselayout-0.12. I did and shaved 20seconds off my boot time! 
> ...

 

In baselayout-0.11.x the RC_PARALLEL_STARTUP is not actually parallel. Also baselayout-0.12 backgrounds the net.* init scripts.

See here: http://gentoo-portage.com/sys-apps/baselayout

you will have to unmask it.

----------

## Sachankara

Use init-ng (if you can make it work), or write your own init scripts on top of the SysV system. I've done the latter myself, and my Gentoo systems boot quite fast. Around 12-15 seconds from post to login on my 1.5 GHz laptop.  :Smile: 

----------

## beatryder

 *Sachankara wrote:*   

> Use init-ng (if you can make it work), or write your own init scripts on top of the SysV system. I've done the latter myself, and my Gentoo systems boot quite fast. Around 12-15 seconds from post to login on my 1.5 GHz laptop. 

 

Could you expand on that please?

----------

## mirojira

 *beatryder wrote:*   

> 
> 
> In baselayout-0.11.x the RC_PARALLEL_STARTUP is not actually parallel. Also baselayout-0.12 backgrounds the net.* init scripts.
> 
> See here: http://gentoo-portage.com/sys-apps/baselayout
> ...

 

It is baselayout-1.12.x isn't it? 

It is very 1th time when I use command ebuild. Following http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds I succefully made digest. But trying unpacking I'v  got

 *Quote:*   

> 
> 
> localhost miro # ebuild /usr/local/portage/sys-apps/baselayout/baselayout-1.12.0-r1.ebuild unpack
> 
> >>> md5 files    baselayout-1.12.0-r1.ebuild
> ...

 

 In directory /usr/local/portage/sys-apps/baselayout/files/ is not patch but baselayout-1.12.0-r1.ebuild

I need a bit of advice.

----------

## mirojira

I solved problem ( wrong path to directory with .patch ) and finished the ebuild. Restarted and find out that network was not started and startx doesn' t work.

I manually set the conection, masked baselayout-1.12 and went back to the baselayout-1.11. Reboot and the same problem. I have fixed network connection 

adding module e100 into /etc/module.autoload/kernel-2.6 which was overwritten.  I am just looking for the reason why I can't run startx.

So I have lost courage to continue until I won't have  the new instruction from you.

----------

## Empire

You probably want to take a look at /var/log/Xorg.0.log

----------

## beatryder

 *mirojira wrote:*   

>  *beatryder wrote:*   
> 
> In baselayout-0.11.x the RC_PARALLEL_STARTUP is not actually parallel. Also baselayout-0.12 backgrounds the net.* init scripts.
> 
> See here: http://gentoo-portage.com/sys-apps/baselayout
> ...

 

Yes I meant 1.12.x. and why the hell are you using the ebuild command to install it ???

do this:

```

# echo "sys-apps/baselayout" >> /etc/portage/package.keywords

# emerge -av baselayout

```

----------

## GenYetiToo

 *beatryder wrote:*   

> update to baselayout-0.12. I did and shaved 20seconds off my boot time!
> 
> you will have to unmask it.

 ... and you have to name it baselayout-1.12

 :Wink: 

Markus

----------

## mirojira

 *beatryder wrote:*   

> 
> 
> Yes I meant 1.12.x. and why the hell are you using the ebuild command to install it ???
> 
> 

 

Well I read in http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds that using emerge -av <package> could be dangerous.

But this time I made  emerge -av baselayout . Unfortunatelly I do not see any difference in the startup. *Sachankara wrote:*   

> 
> 
> Use init-ng (if you can make it work), or write your own init scripts on top of the SysV system. I've done the latter myself, and my Gentoo systems boot quite fast. Around 12-15 seconds from post to login on my 1.5 GHz laptop. 

 

???

----------

## beatryder

 *GenYetiToo wrote:*   

>  *beatryder wrote:*   update to baselayout-0.12. I did and shaved 20seconds off my boot time!
> 
> you will have to unmask it. ... and you have to name it baselayout-1.12
> 
> Markus

 

I already corrected that! :p

@mirojira make sure that in /etc/conf.d/rc  RC_PARALLEL_STARTUP=yes

----------

## mirojira

 *beatryder wrote:*   

> 
> 
> @mirojira make sure that in /etc/conf.d/rc  RC_PARALLEL_STARTUP=yes

 

I set up the variable RC_PARALLEL_STARTUP=yes and saved 5 sec.  :Very Happy: 

----------

## Sachankara

 *mirojira wrote:*   

>  *Sachankara wrote:*   
> 
> Use init-ng (if you can make it work), or write your own init scripts on top of the SysV system. I've done the latter myself, and my Gentoo systems boot quite fast. Around 12-15 seconds from post to login on my 1.5 GHz laptop.  
> 
> ???

  www.initng.org

----------

## mirojira

 *Sachankara wrote:*   

> 
> 
> www.initng.org

 

I have already read it and also  http://gentoo-wiki.com/Initng. There are described two differt method of installing. Which one I should follow? 

I am LILO user. There in wiki is described lilo too. Does it mean that I could start gentoo with or without initng?

 *Quote:*   

> 
> 
> # Working
> 
> image = /boot/kernel-2.6.11-gentoo-r9
> ...

 

----------

## beatryder

I would follow the instruction on initng.org to use their overlay, and use the wiki to show you how to use it with lilo.

Here is a conversion for you:

```

# boot with InitNG

title Gentoo GNU/Linux (2.6.15) (InitNG)

root (hd,0)

kernel /boot/linux-2.6.15 root=/dev/ROOT init=/sbin/initng

initrd /boot/initrd.gz

```

becomes

```

label Gentoo GNU/Linux (2.6.15) (InitNG)

image =  /boot/linux-2.6.15

root =  /dev/ROOT #replace with your root partition

initrd = /boot/initrd.gz

append ="init=/sbin/initng"

read-only

```

----------

