1 .TH NASH 8 "Mon Aug 02 2004"
3 nash \- script interpretor to interpret linuxrc images
5 \fBnash\fR [--quiet] [--force] \fIscript\fR
8 \fBnash\fR is a very simple script interpretor designed to be as small as
9 possible. It is primarily designed to run simple linuxrc scripts on an initrd
10 image. Arguments to commands may be enclosed in either single or double
11 quotes to allow spaces to be included in the arguments. Spaces outside of
12 quotations always delineate arguments, and so backslash escaping is supported.
14 Additionally, if nash is invoked as \fBmodprobe\fR, it will immediately
15 exit with a return code of zero. This is to allow initrd's to prevent some
16 extraneous kernel error messages during startup.
18 There are two types of commands, built in and external. External commands
19 are run from the filesystem via execve(). If commands names are given without
20 a path, nash will search it's builtin PATH, which is /usr/bin, /bin,
23 Currently, \fBnash\fR supports the following built in commands.
26 \fBaccess -[r][w][x][f] \fIpath\fR
27 Tells whether the current user has sufficient permissions to read, write, or
28 execture \fIpath\fR, or if the file exists (see \fBaccess(2)\fR for more
32 \fBecho [item]* [> \fIfilename\fR]\fR
33 Echos the text strings given to a file, with a space in between each
34 item. The output may be optionally redirected to a file.
36 \fBexec\fR \fI<command>\fR
37 The command given is execed, overlaying the nash process.
40 \fBfind \fIdir\fR -name \fIname\fR
41 Display the path to files named \fIname\fR in or below directory \fIdir\FR.
42 This is a \fBvery\fR limited implementation of find(1).
46 Prints the full path to the first unused loopback block device on the
47 system. If none is available, no output is displayed.
50 \fBlosetup \fI/dev/loopdev\fR \fIfile\fR
51 Binds \fIfile\fR to the loopback device \fI/dev/loopdev\fR. See
52 \fBlosetup(8)\fR for information on loopback devices.
55 \fBmkdevices\fR \fIpath\fR
56 Creates device files for all of the block devices listed in
57 \fB/proc/partitions\fR in the directory specfied by \fIpath\fR.
60 \fBmkdir\fR \fI[-p]\fR \fIpath\fR
61 Creates the directory \fIpath\fR. If \fI-p\fR is specified, this command
62 will not complain if the directory exists. Note this is a subset of the
63 standard \fBmkdir\fR \fI-p\fR behavior.
66 \fBmknod\fR \fIpath\fR \fI[c|b]\fR \fImajor\fR \fIminor\fR
67 Creates a device inode for \fIpath\fR. This is identical to \fBmkdev\fR(1)
68 which the exceptions that it will not create named pipes and if the directories
69 in \fIpath\fR do not exist they will be automatically created.
73 Creates a device inode for the device mapper control inode as
74 \fI/dev/mapper/control\fR. If it already exists with the correct
75 major/minor, it will not be recreated.
78 \fBmkrootdev \fIpath\fR
79 Makes \fIpath\fR a block inode for the device which should be mounted
80 as root. To determine this device nash uses
81 the device suggested by the root= kernel command line argument (if
82 root=LABEL is used devices are probed to find one with that label). If
83 no root= argument is available, /proc/sys/kernel/real-root-dev provides
87 \fBmount \fI[--ro]\fR -o \fIopts\fR -t \fItype\fR \fIdevice\fR \fImntpoint\fR
88 Mounts a filesystem. It does not support NFS, and it must be used in
89 the 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
91 be searched, and the first device with a volume label of \fIfoo\fR will
92 be mounted. Normal \fBmount\fR(2) options are supported, and \fB--ro\fR will
93 mount the filesystem read only for compatibility with older versions of nash.
94 The \fBdefaults\fR mount option is silently ignored.
97 \fBpivot_root \fInewrootpath\fR \fIoldrootpath\fR
98 Makes the filesystem mounted at \fInewrootpath\fR the new root filesystem,
99 and mounts the current root filesystem as \fIoldrootpath\fR.
102 \fBreadlink \fIpath\fR
103 Displays the value of the symbolic link \fIpath\fR.
106 \fBraidautorun \fImddevice\fR
107 Runs raid autodetection on all raid-typed partitions. \fImddevice\fR must
108 be a raid device (any will do).
112 Cause any later echos in this script to not be displayed.
116 Display a table of devices, their filesystem labels, and their uuids.
120 Sleep for \fInum\fR seconds
123 \fBswitchroot \fInewrootpath\fR
124 Makes the filesystem mounted at \fInewrootpath\fR the new root
125 filesystem by moving the mountpoint. This will only work in 2.6 or
130 Unmounts the filesystem mounted at \fIpath\fR.
133 Returns 0 is the last command succeeded or 1 if it failed.
138 Allows \fBforce\fR really execute the script, even though \fBnash\fR doesn't
139 appear to be running from an initrd image.
142 Probably many. \fBnash\fR is \fbnot a shell\fR, and it shouldn't be thought of
143 as one. It isn't entirely different from a shell, but that's mostly by
148 Erik Troan <ewt@redhat.com>