[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltsp-discuss
Subject:    Re: [Ltsp-discuss] Runlevels in dhcp.conf (problem with ltsp 3.0)
From:       Wolfgang Schweer <schweer () cityweb ! de>
Date:       2002-02-15 18:55:16
[Download RAW message or body]

On Wed, 13 Feb 2002, Wolfgang Schweer wrote:

> On Wed, 13 Feb 2002 jam@McQuil.com wrote:
>
> > Wolfgang,
> >
> > Why does /linuxrc need to be modified ?
> >
> > Just have the set_runlevel script look at /proc/cmdline to get the
> > kernel command line.
>
> Well Jim,
>
> I didn't know that one can grab it from there.
> But how to get the right piece, say RUNLEVEL=3 out of the command line?

Now I'll answer that question myself.
This is a second solution for the problem
"overriding the runlevel by kernel commandline"
without having to alter the initial ramdisk. Maybe there are better
solutions for this case, you'll have to find out.

----------------------------------------------------------------------
Step 1
Our old friend awk (as gawk) will do it for us. So locate gawk on your
server and copy that binary to the /bin directory of the ltsp-tree.
If you've got awk in another disguise, rename it to gawk.
----------------------------------------------------------------------
Step 2
In the files /bin/set_runlevel and /etc/rc.local (of the ltsp-tree)
the entry

RUNLEVEL=`get_cfg RUNLEVEL 5`

has to be replaced with

DUMMY=""
DUMMY=`gawk -F" " '/RUNLEVEL/ { print(substr($NF,10))}' /proc/cmdline`

if [ -n "${DUMMY}" ]; then
    RUNLEVEL=${DUMMY}
    else
    RUNLEVEL=`get_cfg RUNLEVEL 5`
fi
----------------------------------------------------------------------
Step 3
Pass the desired runlevel over as _last_ param in the kernel
commandline like this RUNLEVEL=x, x in 3,4,5.


Wolfgang


_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.openprojects.net
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic