View previous topic :: View next topic |
Author |
Message |
Nicolas33 n00b
Joined: 06 Jul 2007 Posts: 6
|
Posted: Fri Jul 06, 2007 9:43 pm Post subject: [SOLVED] Choose a runlevel at boot |
|
|
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 |
|
|
trolley Apprentice
Joined: 12 Jun 2002 Posts: 292 Location: Canada
|
Posted: Fri Jul 06, 2007 11:12 pm Post subject: |
|
|
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 |
|
|
Nicolas33 n00b
Joined: 06 Jul 2007 Posts: 6
|
Posted: Fri Jul 06, 2007 11:42 pm Post subject: |
|
|
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 |
|
|
ShinyThings Tux's lil' helper
Joined: 03 Jul 2007 Posts: 89 Location: Ontario
|
Posted: Sat Jul 07, 2007 3:16 am Post subject: |
|
|
Not sure if this would work, but you could try init='/sbin/init 3', replacing 3 with the proper runlevels |
|
Back to top |
|
|
Nicolas33 n00b
Joined: 06 Jul 2007 Posts: 6
|
Posted: Sat Jul 07, 2007 12:30 pm Post subject: |
|
|
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 |
|
|
tobr Guru
Joined: 29 May 2006 Posts: 330
|
Posted: Sun Jul 08, 2007 4:01 pm Post subject: |
|
|
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 |
|
|
Nicolas33 n00b
Joined: 06 Jul 2007 Posts: 6
|
Posted: Sun Jul 08, 2007 10:49 pm Post subject: |
|
|
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 |
|
|
tobr Guru
Joined: 29 May 2006 Posts: 330
|
Posted: Mon Jul 09, 2007 4:12 pm Post subject: |
|
|
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 |
|
|
Nicolas33 n00b
Joined: 06 Jul 2007 Posts: 6
|
Posted: Mon Jul 09, 2007 7:46 pm Post subject: |
|
|
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 |
|
|
mudrii l33t
Joined: 26 Jun 2003 Posts: 789 Location: Singapore
|
Posted: Tue Jul 10, 2007 12:07 am Post subject: |
|
|
you can try to create you own runlevel and rc-update to it and edit inittab _________________ www.gentoo.ro |
|
Back to top |
|
|
Nicolas33 n00b
Joined: 06 Jul 2007 Posts: 6
|
Posted: Tue Jul 10, 2007 7:56 pm Post subject: [solved] |
|
|
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 |
|
|
|