1NASH(8)                     System Manager's Manual                    NASH(8)
2
3
4

NAME

6       nash - script interpretor to interpret linuxrc images
7

SYNOPSIS

9       nash [--quiet] [--force] script
10
11

DESCRIPTION

13       nash  is  a  very  simple script interpretor designed to be as small as
14       possible. It is primarily designed to run simple linuxrc scripts on  an
15       initrd image. Arguments to commands may be enclosed in either single or
16       double quotes to allow spaces to be included in the  arguments.  Spaces
17       outside  of  quotations  always  delineate  arguments, and so backslash
18       escaping is supported.
19
20       Additionally, if nash is invoked as modprobe, it will immediately  exit
21       with  a  return code of zero. This is to allow initrd's to prevent some
22       extraneous kernel error messages during startup.
23
24       There are two types of commands, built in and external.  External  com‐
25       mands  are  run from the filesystem via execve(). If commands names are
26       given without a path, nash will search  it's  builtin  PATH,  which  is
27       /usr/bin, /bin, /sbin, /usr/sbin.
28
29       Currently, nash supports the following built in commands.
30
31
32       access -[r][w][x][f] path
33              Tells  whether  the  current  user has sufficient permissions to
34              read, write, or execture  path,  or  if  the  file  exists  (see
35              access(2) for more information).
36
37
38       echo [item]* [> filename]
39              Echos  the text strings given to a file, with a space in between
40              each item. The output may be optionally redirected to a file.
41
42              exec <command> The command given is execed, overlaying the  nash
43              process.
44
45
46       find dir -name name
47              Display  the path to files named name in or below directory dir.
48              This is a very limited implementation of find(1).
49
50
51       losetup /dev/loopdev file
52              Binds file to the loopback device /dev/loopdev.  See  losetup(8)
53              for information on loopback devices.
54
55
56       mkdevices path
57              Creates  device  files  for  all  of the block devices listed in
58              /proc/partitions in the directory specfied by path.
59
60
61       mkdir [-p] path
62              Creates the directory path. If -p  is  specified,  this  command
63              will not complain if the directory exists. Note this is a subset
64              of the standard mkdir -p behavior.
65
66
67       mknod path [c|b] major minor
68              Creates a device inode for path. This is identical  to  mkdev(1)
69              which  the exceptions that it will not create named pipes and if
70              the directories in path do not exist they will be  automatically
71              created.
72
73
74       mkdmnod
75              Creates  a  device  inode for the device mapper control inode as
76              /dev/mapper/control.  If it  already  exists  with  the  correct
77              major/minor, it will not be recreated.
78
79
80       mkrootdev path
81              Makes  path a block inode for the device which should be mounted
82              as root. To determine this device nash uses the device suggested
83              by the root= kernel command line argument (if root=LABEL is used
84              devices are probed to find one with that  label).  If  no  root=
85              argument  is  available, /proc/sys/kernel/real-root-dev provides
86              the device number.
87
88
89       mount [--ro] -o opts -t type device mntpoint
90              Mounts a filesystem. It does not support NFS,  and  it  must  be
91              used  in  the  form  given  above (arguments must go first).  If
92              device  is  of  the  form  LABEL=foo  the  devices   listed   in
93              /fB/proc/partitions  will be searched, and the first device with
94              a volume label of foo will be mounted. Normal  mount(2)  options
95              are  supported, and --ro will mount the filesystem read only for
96              compatibility with older versions of nash.  The  defaults  mount
97              option is silently ignored.
98
99
100       pivot_root newrootpath oldrootpath
101              Makes  the  filesystem  mounted  at  newrootpath  the  new  root
102              filesystem, and mounts the current root filesystem  as  oldroot‐
103              path.
104
105
106       readlink path
107              Displays the value of the symbolic link path.
108
109
110       raidautorun mddevice
111              Runs  raid  autodetection on all raid-typed partitions. mddevice
112              must be a raid device (any will do).
113
114
115       setquiet
116              Cause any later echos in this script to not be displayed.
117
118
119       showlabels
120              Display a table of devices, their filesystem labels,  and  their
121              uuids.
122
123
124       sleep num
125              Sleep for num seconds
126
127
128       switchroot newrootpath
129              Makes  the  filesystem  mounted  at  newrootpath  the  new  root
130              filesystem by moving the mountpoint.  This will only work in 2.6
131              or later kernels.
132
133
134       umount path
135              Unmounts the filesystem mounted at path.
136
137

RETURN VALUE

139       Returns 0 is the last command succeeded or 1 if it failed.
140
141

OPTIONS

143       --force
144              Allows force really execute the script, even though nash doesn't
145              appear to be running from an initrd image.
146
147

BUGS

149       Probably many. nash is not a shell, and it shouldn't be thought  of  as
150       one.  It  isn't  entirely  different from a shell, but that's mostly by
151       accident.
152
153
154
155                                Mon Aug 02 2004                        NASH(8)
Impressum