Other Help Topics :: linuxrc



I am trying to change linuxrc to use bash and not ash.  It is not working.
I have added bash to the /static dir and changed the first line in linuxrc from sh
to bash.

ash only supports a few commands and the parsing is broken.

any ideas?

Quote
It is not working.
What goes wrong?

If you have /static/bash then you should also replace the symlink from sh to point to it.  The scripts could be called by sh which would override the shebang.  Of course the easiest way to tell if whatever you're doing will work would be to replace ash completely.

Quote
and the parsing is broken.
parsing of..?

Anyhow, reason for ash: fast(er) boot.

Quote (^thehatsrule^ @ Nov. 21 2006,09:57)
Quote
It is not working.
What goes wrong?

If you have /static/bash then you should also replace the symlink from sh to point to it.  The scripts could be called by sh which would override the shebang.  Of course the easiest way to tell if whatever you're doing will work would be to replace ash completely.

Quote
and the parsing is broken.
parsing of..?

Anyhow, reason for ash: fast(er) boot.

Parsing like:

 junk=${CMDLINE}
 junk="${junk##parm=}"      <== fails here
 junk="${junk%%[     ]*}"

What I am doing is making a linuxrc that supports PXE booting with NFS mounting of KNOPPIX FS.

I am currently stick on getting the NFS mount to work.  I have loaded nfs.o,
lockd.o and sunrpc.o, but something is missing and the NFS mount fails.

Since the console to ttyS0 fails, it is hard to debug my code.  Ash is very limited and the messages falls off of the screen.

The failure is a kernel panic after failure to change to /initrd ( I think ).

I think junk="${junk##parm=}" can be rewritten for ash like this:
junk=`echo ${junk} | sed 's/parm=//'`
...or something similar...i just pulled this out of my butt.

You're also going to have trouble with ${junk%%[     ]*}:
junk=`echo ${junk} | sed 's/ *$//'` (guessing again...not sure what "[   ]*" is)

These issues are not a result of ash being broken, but are because bash has added features that are not available in ash.  The string manipulation above is an example of bash-specific script.

Ah yes.. the 'bash-isms'

If you really don't care about about speed and efficiency I suppose you could try to use bash instead.

Otherwise, I'd suggest for you to replace whatever scripting you're doing with replacement commands or use another implementation.  If you decide to go this way, you could paste out your script (or snippets of) to show what you're trying to do with the code and we can try to help.

Next Page...
original here.