]> git.ipfire.org Git - ipfire-2.x.git/blame - src/nash/nash.8
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[ipfire-2.x.git] / src / nash / nash.8
CommitLineData
cd1a2927
MT
1.TH NASH 8 "Sat Mar 27 1999"
2.UC 4
3.SH NAME
4nash \- script interpretor to interpret linuxrc images
5.SH SYNOPSIS
6\fBnash\fR [--quiet] [--force] \fIscript\fR
7
8.SH DESCRIPTION
9\fBnash\fR is a very simple script interpretor designed to be as small as
10possible. It is primarily designed to run simple linuxrc scripts on an initrd
11image. Arguments to commands may be enclosed in either single or double
12quotes to allow spaces to be included in the arguments. Spaces outside of
13quotations always delineate arguments, and so backslash escaping is supported.
14
15Additionally, if nash is invoked as \fBmodprobe\fR, it will immediately
16exit with a return code of zero. This is to allow initrd's to prevent some
17extraneous kernel error messages during startup.
18
19There are two types of commands, built in and external. External commands
20are run from the filesystem via execve(). If commands names are given without
21a path, nash will search it's builtin PATH, which is /usr/bin, /bin,
22/sbin, /usr/sbin.
23
24Currently, \fBnash\fR supports the following built in commands.
25
26.TP
27\fBaccess -[r][w][x][f] \fIpath\fR
28Tells whether the current user has sufficient permissions to read, write, or
29execture \fIpath\fR, or if the file exists (see \fBaccess(2)\fR for more
30information).
31
32.TP
33\fBecho [item]* [> \fIfilename\fR]\fR
34Echos the text strings given to a file, with a space in between each
35item. The output may be optionally redirected to a file.
36
37\fBexec\fR \fI<command>\fR
38The command given is execed, overlaying the nash process.
39
40.TP
41\fBfind \fIdir\fR -name \fIname\fR
42Display the path to files named \fIname\fR in or below directory \fIdir\FR.
43This is a \fBvery\fR limited implementation of find(1).
44
45.TP
46\fBfindlodev\fR
47Prints the full path to the first unused loopback block device on the
48system. If none is available, no output is displayed.
49
50.TP
51\fBlosetup \fI/dev/loopdev\fR \fIfile\fR
52Binds \fIfile\fR to the loopback device \fI/dev/loopdev\fR. See
53\fBlosetup(8)\fR for information on loopback devices.
54
55.TP
56\fBmkdevices\fR \fIpath\fR
57Creates device files for all of the block devices listed in
58\fB/proc/partitions\fR in the directory specfied by \fIpath\fR.
59
60.TP
61\fBmkdir\fR \fI[-p]\fR \fIpath\fR
62Creates the directory \fIpath\fR. If \fI-p\fR is specified, this command
63will not complain if the directory exists. Note this is a subset of the
64standard \fBmkdir\fR \fI-p\fR behavior.
65
66.TP
67\fBmknod\fR \fIpath\fR \fI[c|b]\fR \fImajor\fR \fIminor\fR
68Creates a device inode for \fIpath\fR. This is identical to \fBmkdev\fR(1)
69which the exceptions that it will not create named pipes and if the directories
70in \fIpath\fR do not exist they will be automatically created.
71
72.TP
73\fBmkrootdev \fIpath\fR
74Makes \fIpath\fR a block inode for the device which should be mounted
75as root. To determine this device nash uses
76the device suggested by the root= kernel command line argument (if
77root=LABEL is used devices are probed to find one with that label). If
78no root= argument is available, /proc/sys/kernel/real-root-dev provides
79the device number.
80
81.TP
82\fBmount \fI[--ro]\fR -o \fIopts\fR -t \fItype\fR \fIdevice\fR \fImntpoint\fR
83Mounts a filesystem. It does not support NFS, and it must be used in
84the form given above (arguments must go first). If \fIdevice\fR is of the form
85\fBLABEL=\fIfoo\fR the devices listed in /fB/proc/partitions\fR will
86be searched, and the first device with a volume label of \fIfoo\fR will
87be mounted. Normal \fBmount\fR(2) options are supported, and \fB--ro\fR will
88mount the filesystem read only for compatibility with older versions of nash.
89The \fBdefaults\fR mount option is silently ignored.
90
91.TP
92\fBpivot_root \fInewrootpath\fR \fIoldrootpath\fR
93Makes the filesystem mounted at \fInewrootpath\fR the new root filesystem,
94and mounts the current root filesystem as \fIoldrootpath\fR.
95
96.TP
97\fBraidautorun \fImddevice\fR
98Runs raid autodetection on all raid-typed partitions. \fImddevice\fR must
99be a raid device (any will do).
100
101.TP
102\fBshowlabels\fR
103Display a table of devices, their filesystem labels, and their uuids.
104
105.TP
106\fBumount \fIpath\fR
107Unmounts the filesystem mounted at \fIpath\fR.
108
109.SH RETURN VALUE
110Returns 0 is the last command succeeded or 1 if it failed.
111
112.SH OPTIONS
113.TP
114\fB-\-force\fR
115Allows \fBforce\fR really execute the script, even though \fBnash\fR doesn't
116appear to be running from an initrd image.
117
118.SH BUGS
119Probably many. \fBnash\fR is \fbnot a shell\fR, and it shouldn't be thought of
120as one. It isn't entirely different from a shell, but that's mostly by
121accident.
122
123.SH AUTHOR
124.nf
125Erik Troan <ewt@redhat.com>
126.fi