Adam wrote:
On 04/18/10 15:21, Dale wrote:
Adam wrote:
I want to choose console or X from grub, so i'm thinking i'll do
something like 'rc-update delete xdm 4' and then pass softlevel=4 to my
grub boot line, to make runlevel 4 a console runlevel. Is that the right
way to do it?


Gentoo doesn't use those runlevels.  You need to read this:

man rc-update

Gentoo comes with the following runlevels:

r...@smoker ~ # ls /etc/runlevels/
total 5
drwxr-xr-x  6 root root  152 Jun 11  2008 .
drwxr-xr-x 81 root root 4832 Apr 18 00:16 ..
drwxr-xr-x  2 root root  368 Jun 11  2008 boot
drwxr-xr-x  2 root root  512 Apr  9 20:05 default
drwxr-xr-x  2 root root   72 Jun 11  2008 nonetwork
r...@smoker ~ #

It generally boots to default.  You can change that on the kernel boot
line but with one of the above instead of a 4 as you posted.
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4

So gentoo does use the numerical runlevels (because that's what init
uses) as well as the gentoo runlevels you've shown. It looks like it
just maps the numbers to the names in inittab;

l0:0:wait:/sbin/rc shutdown
l0s:0:wait:/sbin/halt -dhp
l1:1:wait:/sbin/rc single
l2:2:wait:/sbin/rc nonetwork
l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc default
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
l6r:6:wait:/sbin/reboot -dk

so, i guess this means i should point l4 to a custom runlevel in
/etc/runlevels that is the same as default with the exception that xdm
is removed... I'm assuming the linux kernel wont understand the gentoo
named runlevels, and therefore using those names in grub wouldnt work.


If you want to boot to the single runlevel, just add softlevel=single to the end of the boot line in grub. You can do this in the config or edit the boot line when grub comes up and it should work fine. I have never used the number runlevels. It may work but I have never done it that way so I can't really say one way or the other.

You can also create custom runlevels if you need them. I created one a while back to play with and I just added the directory and added the services I wanted in there. That should work fine. There may be other ways to create them as well.

Also, you can use eselect to manage this as well. The module is called rc. I don't use it but that is the up and coming way to do it.

Dale

:-)  :-)

Reply via email to