public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* Re: [gentoo-user] finding out current softlevel
  2010-08-10 14:42 [gentoo-user] finding out current softlevel linux
@ 2010-08-10 12:58 ` Alex Schuster
  2010-08-10 14:01   ` linux
  2010-08-10 13:24 ` Neil Bothwick
  2010-08-10 13:27 ` Neil Bothwick
  2 siblings, 1 reply; 5+ messages in thread
From: Alex Schuster @ 2010-08-10 12:58 UTC (permalink / raw
  To: gentoo-user

linux@gabriel-striewe.de writes:

> I was wondering whether there is some way to find out the current
> running softlevel (which I gave to the kernel line in grub's
> menu.lst), for example to start another window manager depending on
> the softlevel or whatever other possible solutions? Maybe in a
> variable like $SOFTLEVEL ?

At least you can get the complete kernel line from /proc/cmdline.

If you like, put something like this into your .bashrc:

# get boot parameters:
SOFTLEVEL=$( < /proc/cmdline )
# strip from left all up to and including 'softlevel=':
SOFTLEVEL=${SOFTLEVEL##*softlevel=}
# strip from the right all from the first blank on:
SOFTLEVEL=${SOFTLEVEL%% *}           # strip all

Oh, or forget about all this, as I just see that there is the rc-status -r 
command.

	Wonko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] finding out current softlevel
  2010-08-10 14:42 [gentoo-user] finding out current softlevel linux
  2010-08-10 12:58 ` Alex Schuster
@ 2010-08-10 13:24 ` Neil Bothwick
  2010-08-10 13:27 ` Neil Bothwick
  2 siblings, 0 replies; 5+ messages in thread
From: Neil Bothwick @ 2010-08-10 13:24 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

On Tue, 10 Aug 2010 16:42:02 +0200, linux@gabriel-striewe.de wrote:

> I was wondering whether there is some way to find out the current
> running softlevel (which I gave to the kernel line in grub's
> menu.lst), for example to start another window manager depending on
> the softlevel or whatever other possible solutions? Maybe in a
> variable like $SOFTLEVEL ? 

The arguments you gave to the kernel when booting are in /proc/cmdline,
but that may not be the current softlevel, it may have been changed since
booting. With baselayout-1, the current softlevel is
in /var/lib/init.d/softlevel. There may be a similar file for
baselayout-2 but I haven't had the need to find it yet.


-- 
Neil Bothwick

Q. How many mathematicians does it take to change a light bulb?
A. Only one - who gives it to six Californians, thereby reducing the
problem to an earlier joke.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] finding out current softlevel
  2010-08-10 14:42 [gentoo-user] finding out current softlevel linux
  2010-08-10 12:58 ` Alex Schuster
  2010-08-10 13:24 ` Neil Bothwick
@ 2010-08-10 13:27 ` Neil Bothwick
  2 siblings, 0 replies; 5+ messages in thread
From: Neil Bothwick @ 2010-08-10 13:27 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 126 bytes --]

The baselayout-2 method is rc-status --runlevel


-- 
Neil Bothwick

And on the seventh day God said :wq and then make

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] finding out current softlevel
  2010-08-10 12:58 ` Alex Schuster
@ 2010-08-10 14:01   ` linux
  0 siblings, 0 replies; 5+ messages in thread
From: linux @ 2010-08-10 14:01 UTC (permalink / raw
  To: gentoo-user

> At least you can get the complete kernel line from /proc/cmdline.

Strangely, my /proc/cmdline is empty; could I have forgotten some
kernel module or option?

> If you like, put something like this into your .bashrc:
> 
> # get boot parameters:
> SOFTLEVEL=$( < /proc/cmdline )
> # strip from left all up to and including 'softlevel=':
> SOFTLEVEL=${SOFTLEVEL##*softlevel=}
> # strip from the right all from the first blank on:
> SOFTLEVEL=${SOFTLEVEL%% *}           # strip all
> 
> Oh, or forget about all this, as I just see that there is the rc-status -r 
> command.

Yes, that works fine, thank you!!

> 	Wonko

Gabriel 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-user] finding out current softlevel
@ 2010-08-10 14:42 linux
  2010-08-10 12:58 ` Alex Schuster
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: linux @ 2010-08-10 14:42 UTC (permalink / raw
  To: gentoo-user

Hello,

I was wondering whether there is some way to find out the current
running softlevel (which I gave to the kernel line in grub's
menu.lst), for example to start another window manager depending on
the softlevel or whatever other possible solutions? Maybe in a
variable like $SOFTLEVEL ? 

Thanks for any hints,

Gabriel 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-10 14:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-10 14:42 [gentoo-user] finding out current softlevel linux
2010-08-10 12:58 ` Alex Schuster
2010-08-10 14:01   ` linux
2010-08-10 13:24 ` Neil Bothwick
2010-08-10 13:27 ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox