$Id: README,v 1.8 2001/09/24 13:44:42 malekith Exp $

 * bsp - Braindamaged Script Processor for initrd
 *
 * this falls under GNU GPL v2+.
 *
 * written in y2k,y2k++ by Michal Moskal <malekith@pld.org.pl>
 

Short description of "languge" used for scripts:

in normal circumstances bsp behaves as if set -x
i.e. all commands executed are printed with `+ ' prepended.
if you don't want -x, prepend command with @ as in make
there are 2 builtins, both are not -x:
 # - comment
 > - echo
blank lines are ignored
typical script might look like:

------------------------cut
#
# typical script ;)
#

> Setting up disk modules
# word enclosed in '' gets passed to command as whole: 
# { "insmod", "ide", "x=y c x", 0 }
insmod ide.o 'x=y c x'
# same with ""
insmod scsi.o "foo=bar baz" "xx = uu"
# but if no space - no need
insmod baz.o abc=def
# fixed by Jan Rkojarski <baggins@sith.mimuw.edu.pl>, this now works:
# { "insmod", "xxx.o", "abc=d e f", 0 }
insmod xxx.o abc="d e f"
# use of @
# this will look for hehe executable along {/usr,}/{s,}bin 
@hehe "you won't see me, won't you? this is stupid"
# wait a second
sleep 1
# or even a half
usleep 500000

> done!

# that's all
-------------------------cut

for letest version see ftp://ftp.pld.org.pl/people/malekith/
or PLD's CVS (for instructions how to get there, see http://www.pld.org.pl)

insmod is now builtin. it doesn't support any options, beside module options.
it looks for modules in preset directories, look at setup.h.
modpath builtin can be used to change this,
modpath /lib/modules/2.2.18
or sth. there can be only one custom modpath at a time.
note that insmod has some own quoting rules ...
.o is required.

echo builtin is also implemented.

> x y z == @echo "x y z" most of time.

in 0.2.0/pi raidstart builtin has been added, as it is stock raidstart
from raidtools, it should work as usuall (I'm not sure, what does it 
mean, though... :)

in 0.2.1/delicatessen, mount and umount builtins has been added.
while umount works in quite regular fashion (directory or special
device should be passed), mount requires 3 arguments: device,
directory and filesystem. No switches are supported at the very moment.
For example, this could be used as script for system with root
on lvm:

---cut---
# warning, I havn't tested it ! :)

insmod /lib/lvm.o
mount none /proc proc
/bin/vgscan
/bin/vgchange -a y
umount /proc
insmod ext2.o

> Good luck :)

# eof
---cut---

However note, that you have to compile vg{scan,change} separatly...
Also /proc and /dev is required on initrd.

In the same version pivot_root command has been added. However, to make
sure it is compiled correctly, use kernel-headers >= 2.4.
Also append, rm and mknod has been added.


====
Builtins:


* append FILENAME STRING...

appends STRING... to FILENAME. It is created with 0600 mode.

* mknod NAME b|c MAJOR MINOR

make special device.

* rm FILENAME

remove file. behaves as rm -f -- i.e. doesn't complain if file does not exist.

* pivot_root NEW_ROOT PUT_OLD

see man 2 pivot_root

* mount DEVICE DIRECTORY FILESYSTEM
* umount DEVICE|DIRECTORY

go figure.

* usleep MSECS
* sleep SECS

Wait for MSECS miliseconds or SECS seconds.

* echo STRING...

Output string, same as > STRING.

* insmod MODULE

MODULE is absolute path or file in modpatch.

* modpatch PATH

set path (one directory!, no ':')

* raidstart WHATEVER...

Call raidstart, see man raidstart



TODO:
* set builin, like this
  `set qe' or `set v'
  (q for quiet, v for verbose and e for i-don't-know-what)
* maybe lvm support, however building lvm tools with uClibc seems
  more reasonable...

Have fun.
 --malekith
