Gentoo Archives: gentoo-user

From: Jerry McBride <mcbrides9@×××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Dash as /bin/sh?
Date: Sat, 02 Sep 2006 03:01:06
Message-Id: 200609012257.08294.mcbrides9@comcast.net
In Reply to: [gentoo-user] Re: Dash as /bin/sh? by Harm Geerts
1 On Friday 01 September 2006 22:06, Harm Geerts wrote:
2 > On Friday 01 September 2006 17:21, Neil Bothwick wrote:
3 > > > Speaking of which, you probably should see the shell used in the
4 > > > scripts from the sys-apps/baselayout package. All shell scripts
5 > > > use /bin/bash and not /bin/sh.
6 > > >
7 > > > So linking (d)ash as the default shell doesn't nearly have the impact
8 > > > you'd like it to have.
9 > >
10 > > A 20% reduction in boot time is a reasonable impact IMO.
11 >
12 > Any chance that was a fluke?
13 >
14 > I've done a few reboots with bootchart to confirm this and I don't get any
15 > speedup. In fact /bin/sh is never called because the gentoo init scripts
16 > explicitly use bash. (sys-apps/baselayout-1.12.4-r7)
17
18 I can't do it right now, I'm doing an "emerge -e world" on my laptop, but
19 tomorrow I'll do a grep and sed and change #!/bin/bash to #!/bin/dash on the
20 relavant parts of the baselayout and see if it has any impact, other than
21 performance.
22
23 "Slapping right hand to forehead...", This something I never thought of!
24 Thanks for the idea.
25
26 The other thing to consider is, you don't have to use "all" the gentoo init
27 scripts...
28
29 Just this week, I evaluated minit, initng, runit and fcache. For me, initNG
30 offered the best overall improvement.
31
32 However, I got even better performance with my own solution. Basicly, I use
33 the very minimum number gentoo startup scripts. All I use are those that
34 initialize the disks and that's it. The rest of the bootup process is done
35 in local.start. My local.start configures all the devices on my laptop,
36 including the lo, eth0 services. It loads the modules in correct order,
37 brings up portmap, nfs, samba, cups, fam, hal, dbus, alsa, etc., etc. Where
38 possible I run the commands as detached processes for even more
39 performance... My local.start is ugly as hell, but very fast as there's very
40 little bash/python scripting involved... and none of the python bloat that
41 gentoo has going on in /etc/init.d. I'm able to get to a fully functioning
42 command prompt in like 10 seconds after the kernel is done loading.
43 Some configuration still goes on in the background, but I never notice it.
44
45 I've got a lot more testing to do, but at first blush I believe the generation
46 of this type of local.start could be automated. What I see happening is, once
47 a gentoo user is satisfied that the box is setup to their liking, they'd run
48 a script that would evaluate /etc/runlevels, scoop the necessary setup
49 information from /etc/conf.d and generate a local.start providing the new
50 boot process. The runlevels could be pruned automatically and on the next
51 reboot, the new boot process is used for a dramatic decrease in boot time.
52
53 I dunno, this could be fun. ;')
54
55 Cheers all, Jerry
56
57
58
59 --
60 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Re: Dash as /bin/sh? Richard Fish <bigfish@××××××××××.org>