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