question on nash scripti interpreter used by initrd boot process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

Am a RHEL noob, so pls excuse the naive question; Wanted to find out
if anyone has attempted to customize/edit your initrd's init script;
what I'd like to do is to be able to:

1. grab the /proc/cmdline arguments passed on during a pxeboot of a
diskless station
2. parse the commandline into variable so I can use to pass as
argument to a service that's called within the current init script.

Is this possible using /bin/nash? if so, how?

Example (snippet of init script)

- currently does this

echo Attaching to iSCSI storage
/bin/iscsistart -t iqn.2008-04.com.mylab.foo3:storage.foo -i
iqn.1994-05.com.redhat:a950ce57a2bb -g 1 -a 192.168.17.3

- I'd like to:
a. grab commandline parameters pass from the "APPEND" line in the
pxelinux.cfg/<configuration file>
b. place it in variable, so that I can simply edit the above command
and use the appropriate "target" value.

c. In bash, it would look something like this:

#!/bin/bash
#
|
|
var=` cat /proc/cmdline | cut -d " " -f6 | cut -d "=" -f2`
echo Attaching to iSCSI storage
/bin/iscsistart -t $var -i iqn.1994-05.com.redhat:a950ce57a2bb -g 1 -a
192.168.17.3
======

I am a linux newbie, and just realized that /bin/nash is really not
like bash ... any help or advise on how I can grab a commandline when
running the intrd's init script?

thanks in advance,

-- 
A S P A S I A
. . . . . . . . . . ..

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux