FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 08-10-2010, 12:58 PM
Alex Schuster
 
Default finding out current softlevel

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
 
Old 08-10-2010, 01:24 PM
Neil Bothwick
 
Default finding out current softlevel

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.
 
Old 08-10-2010, 01:27 PM
Neil Bothwick
 
Default finding out current softlevel

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


--
Neil Bothwick

And on the seventh day God said :wq and then make
 
Old 08-10-2010, 02:01 PM
 
Default finding out current softlevel

> 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
 
Old 08-10-2010, 02:42 PM
 
Default finding out current softlevel

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
 

Thread Tools




All times are GMT. The time now is 01:13 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org