Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Choose a runlevel at boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Nicolas33
n00b
n00b


Joined: 06 Jul 2007
Posts: 6

PostPosted: Fri Jul 06, 2007 9:43 pm    Post subject: [SOLVED] Choose a runlevel at boot Reply with quote

Hello,

I would like to choose the runlevel at boot with grub on my laptop. The problem is that the selected init runlevel is always the default one from inittab. I did not found the answer in the web or Usenet :-(
Did I missed something?
My configuration is this one (commands in bold):

# cat /etc/inittab
[...]
# Default runlevel.
id:4:initdefault:

# System initialization, mount local filesystems, etc.
si::sysinit:/sbin/rc sysinit

# Further system initialization, brings up the boot runlevel.
rc::bootwait:/sbin/rc boot

l0:0:wait:/sbin/rc shutdown
l1:S1:wait:/sbin/rc single
l2:2:wait:/sbin/rc nonetwork
l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc ethernet
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
#z6:6:respawn:/sbin/sulogin
[...]


# diff /etc/runlevels/default/ /etc/runlevels/ethernet/
Only in /etc/runlevels/ethernet/: net.eth0

# cat /boot/grub/menu.lst

# Boot automatically after 30 secs.
timeout 7

# By default, boot the first entry.
default saved

# Fallback to the second entry.
fallback 1

# For booting GNU/Linux
title=Gentoo Linux (2.6.19-gentoo-r5) StandAlone
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=default
initrd /initramfs-genkernel-x86-2.6.19-gentoo-r5

# For booting GNU/Linux
title=Gentoo Linux (2.6.19-gentoo-r5) LAN
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=ethernet
initrd /initramfs-genkernel-x86-2.6.19-gentoo-r5
[...]


Last edited by Nicolas33 on Tue Jul 10, 2007 7:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
trolley
Apprentice
Apprentice


Joined: 12 Jun 2002
Posts: 292
Location: Canada

PostPosted: Fri Jul 06, 2007 11:12 pm    Post subject: Reply with quote

Have you tried adding the runlevel to your kernel command line in grub.conf?

You could have 2 like so:

Code:

title=Gentoo Linux (2.6.19-gentoo-r5) LAN (Command Line)
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=ethernet 3
initrd /initramfs-genkernel-x86-2.6.19-gentoo-r5

title=Gentoo Linux (2.6.19-gentoo-r5) LAN (Graphical Interface)
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=ethernet 5
initrd /initramfs-genkernel-x86-2.6.19-gentoo-r5
Back to top
View user's profile Send private message
Nicolas33
n00b
n00b


Joined: 06 Jul 2007
Posts: 6

PostPosted: Fri Jul 06, 2007 11:42 pm    Post subject: Reply with quote

Quote:

You could have 2 like so:

Code:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=ethernet 3
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=ethernet 5


Well, this is not exactly what I want, but I've tried. The first choice at grub menu still boot on runlevel 4... The kernel parameter seems to not have effects.

I've already tried:

Code:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll 3
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll 4


Code:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll init 3
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll init 4


Code:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll init=3
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll init=4


Code:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 3 root=/dev/hda5 vga=791 splash=verbose irqpoll
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 4 root=/dev/hda5 vga=791 splash=verbose irqpoll
Back to top
View user's profile Send private message
ShinyThings
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2007
Posts: 89
Location: Ontario

PostPosted: Sat Jul 07, 2007 3:16 am    Post subject: Reply with quote

Not sure if this would work, but you could try init='/sbin/init 3', replacing 3 with the proper runlevels
Back to top
View user's profile Send private message
Nicolas33
n00b
n00b


Joined: 06 Jul 2007
Posts: 6

PostPosted: Sat Jul 07, 2007 12:30 pm    Post subject: Reply with quote

ShinyThings wrote:
Not sure if this would work, but you could try init='/sbin/init 3', replacing 3 with the proper runlevels


This doesn't work. :?
Back to top
View user's profile Send private message
tobr
Guru
Guru


Joined: 29 May 2006
Posts: 330

PostPosted: Sun Jul 08, 2007 4:01 pm    Post subject: Reply with quote

Did you try to start the services which are only in your new runlevel manually (in your case "/etc/init.d/net.eth0 start")? Did they work? What does "rc-update show" output? It's very strange that the runlevels don't work for you.
_________________
Please add [SOLVED] to your message title if your problem is solved.

Death to all blobs!
Back to top
View user's profile Send private message
Nicolas33
n00b
n00b


Joined: 06 Jul 2007
Posts: 6

PostPosted: Sun Jul 08, 2007 10:49 pm    Post subject: Reply with quote

tobr wrote:
Did you try to start the services which are only in your new runlevel manually (in your case "/etc/init.d/net.eth0 start")? Did they work?


Code:

gentux ~ # /etc/init.d/net.eth0 stop
 * Unmounting network filesystems ...                                     [ ok ]
 * Stopping eth0
 *   Bringing down eth0
 *     Stopping dhcpcd on eth0 ...                                        [ ok ]
 *     Shutting down eth0 ...                                             [ ok ]
gentux ~ # /etc/init.d/net.eth0 start
 * Starting eth0
 *   Bringing up eth0
 *     dhcpcd
 *       Running dhcpcd ...                                               [ ok ]
 *       eth0 received address 192.168.1.75/24


tobr wrote:
What does "rc-update show" output?


Code:

gentux ~ # rc-update show
               acpid | boot                                   
           alsasound | boot                                   
            bootmisc | boot                                   
             checkfs | boot                                   
           checkroot | boot                                   
               clock | boot                                   
         consolefont | boot                                   
                dbus | boot                                   
                hald |      default ethernet nonetwork       
              hdparm |      default ethernet nonetwork       
            hostname | boot                                   
             hotplug |      default ethernet nonetwork       
             keymaps | boot                                   
               local |      default ethernet nonetwork       
          localmount | boot                                   
             modules | boot                                   
            net.eth0 |              ethernet nonetwork       
              net.lo | boot                                   
            netmount |      default ethernet                 
           rmnologin | boot                                   
           syslog-ng |      default ethernet nonetwork       
             urandom | boot                                   
          vixie-cron |      default ethernet nonetwork       
                 xdm |      default ethernet                 


tobr wrote:
It's very strange that the runlevels don't work for you.


Yes, that's what I think too. I guess the problem is earlier in the boot sequence. The printed init is always "INIT 4" (even if I start to another) regardless to the kernel parameter. If I change the initdefault in /etc/inittab, then the runlevel switch to it.
I will find, and then, I'll write the best "Detailed boot up sequence for Gentoo" documentation. ,-)
Back to top
View user's profile Send private message
tobr
Guru
Guru


Joined: 29 May 2006
Posts: 330

PostPosted: Mon Jul 09, 2007 4:12 pm    Post subject: Reply with quote

Nicolas33 wrote:
Code:

gentux ~ # /etc/init.d/net.eth0 stop
 * Unmounting network filesystems ...                                     [ ok ]
 * Stopping eth0
 *   Bringing down eth0
 *     Stopping dhcpcd on eth0 ...                                        [ ok ]
 *     Shutting down eth0 ...                                             [ ok ]
gentux ~ # /etc/init.d/net.eth0 start
 * Starting eth0
 *   Bringing up eth0
 *     dhcpcd
 *       Running dhcpcd ...                                               [ ok ]
 *       eth0 received address 192.168.1.75/24

Looks good
Quote:
Code:

gentux ~ # rc-update show
               acpid | boot                                   
           alsasound | boot                                   
            bootmisc | boot                                   
             checkfs | boot                                   
           checkroot | boot                                   
               clock | boot                                   
         consolefont | boot                                   
                dbus | boot                                   
                hald |      default ethernet nonetwork       
              hdparm |      default ethernet nonetwork       
            hostname | boot                                   
             hotplug |      default ethernet nonetwork       
             keymaps | boot                                   
               local |      default ethernet nonetwork       
          localmount | boot                                   
             modules | boot                                   
            net.eth0 |              ethernet nonetwork       
              net.lo | boot                                   
            netmount |      default ethernet                 
           rmnologin | boot                                   
           syslog-ng |      default ethernet nonetwork       
             urandom | boot                                   
          vixie-cron |      default ethernet nonetwork       
                 xdm |      default ethernet                 

Hmm, the only thing that's strange is that net.eth0 is in the ethernet and nonetwork runlevels, but not in the default. Is this correct or a mistake? Apart from that I'm puzzled.
_________________
Please add [SOLVED] to your message title if your problem is solved.

Death to all blobs!
Back to top
View user's profile Send private message
Nicolas33
n00b
n00b


Joined: 06 Jul 2007
Posts: 6

PostPosted: Mon Jul 09, 2007 7:46 pm    Post subject: Reply with quote

tobr wrote:
Nicolas33 wrote:
Code:

gentux ~ # /etc/init.d/net.eth0 stop
 * Unmounting network filesystems ...                                     [ ok ]
 * Stopping eth0
 *   Bringing down eth0
 *     Stopping dhcpcd on eth0 ...                                        [ ok ]
 *     Shutting down eth0 ...                                             [ ok ]
gentux ~ # /etc/init.d/net.eth0 start
 * Starting eth0
 *   Bringing up eth0
 *     dhcpcd
 *       Running dhcpcd ...                                               [ ok ]
 *       eth0 received address 192.168.1.75/24

Looks good


Yes it is, or I couldn't write here :-)

tobr wrote:

Hmm, the only thing that's strange is that net.eth0 is in the ethernet and nonetwork runlevels, but not in the default. Is this correct or a mistake? Apart from that I'm puzzled.


It is correct. I do want net.eth0 in ethernet and nonetwork runlevels, but not in the default.
Thank you for your help.
Back to top
View user's profile Send private message
mudrii
l33t
l33t


Joined: 26 Jun 2003
Posts: 789
Location: Singapore

PostPosted: Tue Jul 10, 2007 12:07 am    Post subject: Reply with quote

you can try to create you own runlevel and rc-update to it and edit inittab
_________________
www.gentoo.ro
Back to top
View user's profile Send private message
Nicolas33
n00b
n00b


Joined: 06 Jul 2007
Posts: 6

PostPosted: Tue Jul 10, 2007 7:56 pm    Post subject: [solved] Reply with quote

Finally, I reported a bug.
The softlevel kernel parameter wasn't read. This is currently fixed. Now, the softlevel can goes over the rc runlevel.

I had to change the inittab:
this line:
l4:4:wait:/sbin/rc ethernet
to:
l4:4:wait:/sbin/rc default

You can get more information here:
https://bugs.gentoo.org/show_bug.cgi?id=184773
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum