Gentoo Archives: gentoo-dev

From: mbutcher <mbutcher@××××××××××.tv>
To: Gentoo Dev <gentoo-dev@g.o>
Subject: Re: [gentoo-dev] new net runlevel
Date: Sun, 30 Jun 2002 23:43:22
Message-Id: 200206302305.04573.mbutcher@aleph-null.tv
In Reply to: [gentoo-dev] new net runlevel by Jacob Perkins
1 There is probably a way to do what you are asking with the init runlevels. It
2 might take more effort than it is worth.
3
4 I might offer an alternative. You should be able to set your own bootparam and
5 add entries to your /boot/grub/menu.lst to pass different bootparams. E.g you
6 might have an entry where the kernel line looks like this:
7
8 kernel bzImage root=/dev/hda3 myoption=nonetwork
9
10 Then at boot time, you would select either the network or the non-network
11 boot.
12
13 To implement this, you would just customize the desired init scripts to check
14 for that flag and initialize accordingly. Init flags get stored in
15 /proc/cmdline, so you could grep it to see if the nonetwork flag was set. To
16 give you some idea....
17
18 #!/bin/bash
19
20 if [[ `grep "myoption=nonetwork" /proc/cmdline` ]]; then
21 # do whatever you need to do with no network
22 else
23 # do what you need to do with network
24 fi
25
26 Hope that gives you some ideas,
27
28 Matt
29
30 On Sunday 30 June 2002 01:29 pm, Jacob Perkins wrote:
31 > I would like to have a virtual runlevel, let's call it net. It's going
32 > to be a symlink to either a dsl or dialup virtual runlevel. The dsl
33 > runlevel will have net.eth0, and the dialup runlevel will have
34 > net.ppp0. There will be other things in them too, like netmount in
35 > dsl. I'd like the net runlevel to be started with default so that
36 > something like postfix, which needs net, will start correctly. How can
37 > I do this? I tried editing inittab and adding a line to start net, but
38 > if I put it before default, default wouldn't start, and if I put it
39 > after, net wouldn't start and postfix would fail. I also tried making a
40 > net rc-script, with just a start() that has '/sbin/rc net', but that did
41 > absolutely nothing. I need help on this asap, thanks.
42 >
43 > Jacob
44 >
45 >
46 >
47 > _______________________________________________
48 > gentoo-dev mailing list
49 > gentoo-dev@g.o
50 > http://lists.gentoo.org/mailman/listinfo/gentoo-dev