2011-03-30 13:49:47 +00:00
|
|
|
.TH BOOT 8
|
|
|
|
.SH NAME
|
2011-06-15 13:27:01 +00:00
|
|
|
boot, bootrc \- connect to the root file server
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.B /boot/boot
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.I Boot
|
2011-06-15 13:27:01 +00:00
|
|
|
is the first program run after a kernel has been loaded. It
|
|
|
|
mounts
|
2014-12-17 10:18:05 +00:00
|
|
|
.BR bootfs.paq ,
|
2011-06-15 13:27:01 +00:00
|
|
|
a compressed filesystem contained in
|
|
|
|
.IR root (3),
|
2011-10-20 15:07:59 +00:00
|
|
|
sets up the
|
|
|
|
.IR rc (1)
|
|
|
|
environment and executes
|
2014-12-17 10:18:05 +00:00
|
|
|
.I bootrc
|
2011-06-15 13:27:01 +00:00
|
|
|
passing on its arguments.
|
2011-10-20 15:07:59 +00:00
|
|
|
.I Bootrc
|
|
|
|
connects to the file server that will serve the root, performs any
|
|
|
|
authentication needed to connect to that server, and executes the
|
2011-03-30 13:49:47 +00:00
|
|
|
.IR init (8)
|
2011-10-20 15:07:59 +00:00
|
|
|
program. Both
|
|
|
|
.I boot
|
|
|
|
and
|
|
|
|
.I bootrc
|
|
|
|
are started by the kernel, never run directly by the user.
|
|
|
|
See
|
2011-03-30 13:49:47 +00:00
|
|
|
.IR booting (8)
|
|
|
|
for information about the process of loading the kernel (and
|
|
|
|
.IR boot )
|
|
|
|
into memory.
|
|
|
|
.PP
|
|
|
|
Once loaded, the kernel initializes its data structures and devices.
|
|
|
|
It sets the two environment variables
|
|
|
|
.B /env/cputype
|
|
|
|
and
|
|
|
|
.B /env/terminal
|
|
|
|
to describe the processor.
|
|
|
|
It then binds a place-holder file server,
|
|
|
|
.IR root (3),
|
|
|
|
onto
|
|
|
|
.B /
|
|
|
|
and crafts an initial process whose sole function is to
|
|
|
|
.IR exec (2)
|
|
|
|
.BR /boot/boot ,
|
|
|
|
a binary which is compiled into
|
|
|
|
.IR root (3).
|
|
|
|
.PP
|
|
|
|
The command line passed depends
|
|
|
|
on the information passed from boot ROM
|
|
|
|
to kernel.
|
|
|
|
Machines that boot directly from ROM (that is, most machines other than PCs)
|
|
|
|
pass the boot line given to the ROM directly to
|
|
|
|
.IR boot .
|
|
|
|
.PP
|
2011-10-20 15:07:59 +00:00
|
|
|
On the PC, each line in the file
|
|
|
|
.IR plan9.ini (8)
|
2011-03-30 13:49:47 +00:00
|
|
|
of the form
|
|
|
|
.IB name = value
|
|
|
|
is passed to the boot program as an environment
|
|
|
|
variable with the same name and value.
|
|
|
|
.PP
|
2011-06-15 13:27:01 +00:00
|
|
|
After
|
|
|
|
.I boot
|
|
|
|
passed its execution to
|
|
|
|
.I bootrc,
|
2014-12-17 10:18:05 +00:00
|
|
|
it must determine the fileserver to use and a
|
2011-03-30 13:49:47 +00:00
|
|
|
.I method
|
|
|
|
with which to connect to it.
|
2014-12-17 10:18:05 +00:00
|
|
|
Typically
|
|
|
|
.I device
|
|
|
|
will name a local disk partition or ethernet interface.
|
2011-03-30 13:49:47 +00:00
|
|
|
The complete list of methods is given below.
|
|
|
|
.PP
|
2011-06-15 13:27:01 +00:00
|
|
|
.I Bootrc
|
2011-03-30 13:49:47 +00:00
|
|
|
must also set a user name to be used
|
|
|
|
as the owner of devices and all console
|
|
|
|
processes and an encryption key to be used
|
|
|
|
when challenged.
|
2011-06-15 13:27:01 +00:00
|
|
|
.I Bootrc
|
2011-03-30 13:49:47 +00:00
|
|
|
will prompt for these.
|
|
|
|
.PP
|
2014-12-17 10:18:05 +00:00
|
|
|
Method and device are prompted for first.
|
2011-03-30 13:49:47 +00:00
|
|
|
The prompt lists all valid methods, with the default in brackets, for example:
|
|
|
|
.IP
|
|
|
|
.EX
|
2014-12-17 10:18:05 +00:00
|
|
|
bootargs is (tcp, il, local!device) [local!/dev/sdC0/fscache]
|
2011-03-30 13:49:47 +00:00
|
|
|
.EE
|
|
|
|
.PP
|
2011-06-15 13:27:01 +00:00
|
|
|
A newline picks the default. Entering
|
|
|
|
.B !rc
|
|
|
|
breaks into the
|
2011-08-22 01:55:31 +00:00
|
|
|
.IR rc (1)
|
2011-06-15 13:27:01 +00:00
|
|
|
shell.
|
2011-03-30 13:49:47 +00:00
|
|
|
Other possible responses are
|
2014-12-17 10:18:05 +00:00
|
|
|
.IR method ,
|
|
|
|
.IB method ! device
|
2011-03-30 13:49:47 +00:00
|
|
|
or
|
2014-12-17 10:18:05 +00:00
|
|
|
.IB method ! device
|
|
|
|
.IR args .
|
2011-03-30 13:49:47 +00:00
|
|
|
.PP
|
|
|
|
The other interactions depend on whether the system
|
|
|
|
is a
|
|
|
|
terminal or a CPU server.
|
|
|
|
.SS Terminal
|
2011-10-20 15:07:59 +00:00
|
|
|
A terminal must have a
|
2011-03-30 13:49:47 +00:00
|
|
|
.I username
|
2011-10-20 15:07:59 +00:00
|
|
|
set.
|
2012-06-22 21:16:08 +00:00
|
|
|
If not specified with the
|
|
|
|
.B user=
|
|
|
|
.IR plan9.ini (8)
|
2017-06-28 16:56:16 +00:00
|
|
|
parameter,
|
2011-03-30 13:49:47 +00:00
|
|
|
.I boot
|
|
|
|
will prompt for one on the console:
|
|
|
|
.IP
|
|
|
|
.EX
|
|
|
|
user:
|
|
|
|
.EE
|
|
|
|
.PP
|
|
|
|
The user will also be prompted for a password to
|
|
|
|
be used as an encryption key on each
|
|
|
|
.IR attach (5):
|
|
|
|
.IP
|
|
|
|
.EX
|
|
|
|
password:
|
|
|
|
.EE
|
|
|
|
.PP
|
|
|
|
Once connected,
|
|
|
|
.I boot
|
2019-05-07 09:41:33 +00:00
|
|
|
mounts the root file system at
|
|
|
|
.B /root
|
|
|
|
(with the optional mount spec argument from
|
|
|
|
.BR $rootspec )
|
2011-03-30 13:49:47 +00:00
|
|
|
and makes the connection available as
|
|
|
|
.B #s/boot
|
|
|
|
for subsequent processes to
|
|
|
|
.B mount
|
|
|
|
(see
|
|
|
|
.IR bind (2)).
|
2019-05-07 09:41:33 +00:00
|
|
|
It then binds
|
|
|
|
.B /root
|
|
|
|
(or the value specified by
|
|
|
|
.BR $rootdir )
|
|
|
|
after the
|
|
|
|
.BR /
|
|
|
|
directory.
|
2011-03-30 13:49:47 +00:00
|
|
|
.I Boot
|
2011-10-20 15:07:59 +00:00
|
|
|
completes by
|
2011-03-30 13:49:47 +00:00
|
|
|
.IR exec (2)'ing
|
2013-02-16 22:38:58 +00:00
|
|
|
.B /$cputype/init
|
2011-03-30 13:49:47 +00:00
|
|
|
.BR -t .
|
|
|
|
If the
|
|
|
|
.B -m
|
|
|
|
option is given it is also passed as an option to
|
|
|
|
.IR init .
|
|
|
|
If the environment variable
|
|
|
|
.B init
|
|
|
|
is set (via
|
|
|
|
.IR plan9.ini (8)),
|
2011-10-20 15:07:59 +00:00
|
|
|
it is used as an argument to
|
|
|
|
.IR exec (2)
|
|
|
|
instead.
|
2011-03-30 13:49:47 +00:00
|
|
|
.PP
|
2011-06-15 13:27:01 +00:00
|
|
|
If the
|
|
|
|
.I bootfs.paq
|
|
|
|
has been built with the cache file system,
|
2011-03-30 13:49:47 +00:00
|
|
|
.IR cfs (4),
|
|
|
|
the local disk partition
|
|
|
|
.BI /dev/sd XX /cache
|
|
|
|
(where
|
|
|
|
.B XX
|
|
|
|
is a unit specifier)
|
|
|
|
exists, and the root file system is from a remote server,
|
2011-06-15 13:27:01 +00:00
|
|
|
then
|
|
|
|
.I bootrc
|
|
|
|
will insert a user level cache
|
2011-03-30 13:49:47 +00:00
|
|
|
process between the remote server and the local namespace
|
|
|
|
that caches all remote accesses on the local partition.
|
|
|
|
.SS CPU Servers
|
|
|
|
The user owning devices and console processes on CPU servers
|
|
|
|
and that user's domain and encryption key are
|
2011-10-20 15:07:59 +00:00
|
|
|
read from NVRAM on all machines except PCs.
|
|
|
|
PCs keep the information in the disk partition
|
|
|
|
.BI /dev/sd XX /nvram.
|
2011-03-30 13:49:47 +00:00
|
|
|
.IP
|
|
|
|
.EX
|
|
|
|
password:
|
|
|
|
authid: bootes
|
|
|
|
authdom: research.bell-labs.com
|
|
|
|
.EE
|
|
|
|
.PP
|
|
|
|
The key is used for mutual authentication of the server and its clients.
|
|
|
|
The domain and id identify the owner of the key.
|
|
|
|
.PP
|
|
|
|
Once connected,
|
|
|
|
.I boot
|
|
|
|
behaves as on the terminal except for
|
|
|
|
.IR exec (2)'ing
|
2013-02-16 22:38:58 +00:00
|
|
|
.B /$cputype/init
|
2011-03-30 13:49:47 +00:00
|
|
|
.BR -c .
|
|
|
|
.SS Booting Methods
|
|
|
|
The methods available to any system depend on what was
|
|
|
|
compiled into the kernel.
|
|
|
|
The complete list of booting methods are listed below.
|
|
|
|
.TP 8
|
|
|
|
.BR tcp
|
|
|
|
connect via Ethernet using the TCP protocol.
|
|
|
|
The
|
2014-12-17 10:18:05 +00:00
|
|
|
.I device
|
|
|
|
and
|
2011-03-30 13:49:47 +00:00
|
|
|
.I args
|
|
|
|
are passed to
|
|
|
|
.IR ipconfig (8)
|
|
|
|
when configuring the IP stack.
|
|
|
|
The
|
|
|
|
.IR plan9.ini (8)
|
|
|
|
variables
|
|
|
|
.B fs
|
|
|
|
and
|
2011-10-20 15:07:59 +00:00
|
|
|
.BR auth
|
2014-12-17 10:18:05 +00:00
|
|
|
override the file server and authentication servers
|
2018-09-17 16:09:33 +00:00
|
|
|
obtained (if any) from DHCP and IPv6 router advertisements
|
|
|
|
during
|
2011-03-30 13:49:47 +00:00
|
|
|
.IR ipconfig (8).
|
|
|
|
.TP 8
|
2014-12-17 10:18:05 +00:00
|
|
|
.BR il
|
|
|
|
the same as
|
|
|
|
.B tcp
|
|
|
|
but uses the IL protocol to connect to the fileserver.
|
|
|
|
.TP 8
|
2018-09-17 16:09:33 +00:00
|
|
|
.BR tls
|
|
|
|
makes an authenticated and encrypted connection to the
|
|
|
|
fileserver via srvtls using t9fs service (see
|
|
|
|
.IR srv (4)).
|
|
|
|
the arguments are the same as
|
|
|
|
.BR tcp .
|
|
|
|
.TP 8
|
2014-12-17 10:18:05 +00:00
|
|
|
.BR local
|
2011-03-30 13:49:47 +00:00
|
|
|
connect to the local file system.
|
2014-12-17 10:18:05 +00:00
|
|
|
The
|
|
|
|
.I device
|
|
|
|
is a disk partition file holding a file system.
|
|
|
|
.I Bootrc
|
|
|
|
inspects the disk partition with
|
|
|
|
.IR fstype (1)
|
|
|
|
to determine the file system type and starts the
|
|
|
|
appropriate server with
|
|
|
|
.IR args .
|
2011-03-30 13:49:47 +00:00
|
|
|
.RE
|
2018-09-17 16:09:33 +00:00
|
|
|
.TP 8
|
|
|
|
.BR reboot
|
|
|
|
starts another kernel. The
|
|
|
|
.I device
|
|
|
|
is of the form
|
|
|
|
.I bootfile
|
|
|
|
[
|
|
|
|
.B !
|
|
|
|
.I method
|
|
|
|
]
|
|
|
|
where
|
|
|
|
.I bootfile
|
|
|
|
is the path to the kernel and
|
|
|
|
.I method
|
|
|
|
is any of the above boot methods that connects to the
|
|
|
|
fileserver on where the
|
|
|
|
.I bootfile
|
|
|
|
is located.
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH EXAMPLES
|
|
|
|
On PCs, the default arguments to boot are constructed using
|
|
|
|
the
|
|
|
|
.B bootargs
|
|
|
|
variable in
|
|
|
|
.IR plan9.ini (8).
|
|
|
|
.PP
|
|
|
|
Start
|
2011-05-12 18:36:46 +00:00
|
|
|
.IR cwfs (4)
|
|
|
|
in config mode:
|
2011-03-30 13:49:47 +00:00
|
|
|
.IP
|
|
|
|
.EX
|
2011-05-12 18:36:46 +00:00
|
|
|
bootargs=local!/dev/sdC0/fscache -c
|
2011-03-30 13:49:47 +00:00
|
|
|
.EE
|
|
|
|
.LP
|
|
|
|
Use an IP stack on an alternate ethernet interface
|
|
|
|
with a static address and fixed file server and authentication
|
|
|
|
server addresses.
|
|
|
|
.IP
|
|
|
|
.EX
|
|
|
|
fs=192.168.0.2
|
|
|
|
auth=192.168.0.3
|
2011-05-12 18:36:46 +00:00
|
|
|
bootargs=tcp!-g 192.168.0.1 ether /net/ether1 \e
|
2011-03-30 13:49:47 +00:00
|
|
|
192.168.0.50 255.255.255.0
|
|
|
|
.EE
|
|
|
|
.LP
|
|
|
|
(The
|
|
|
|
.B bootargs
|
|
|
|
line is split only for presentation; it is one line in the file.)
|
|
|
|
.SH FILES
|
|
|
|
.B #s/boot
|
|
|
|
.br
|
|
|
|
.B #//boot/boot
|
2011-06-15 13:27:01 +00:00
|
|
|
.br
|
|
|
|
.B #//boot/bootfs.paq
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH SOURCE
|
|
|
|
.B /sys/src/9/boot
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.IR root (3),
|
|
|
|
.IR dhcpd (8),
|
|
|
|
.IR init (8)
|
|
|
|
.SH BUGS
|
|
|
|
The use of
|
|
|
|
.B bootargs
|
|
|
|
in general is odd.
|
2019-11-18 00:08:48 +00:00
|
|
|
.PP
|
2019-11-18 00:17:15 +00:00
|
|
|
Filenames passed to
|
|
|
|
.I 9bootfat
|
|
|
|
must be specified in DOS 8.3 format.
|
2019-11-18 00:08:48 +00:00
|
|
|
.I 9bootfat
|
|
|
|
does not support long file names.
|
2013-12-27 21:22:05 +00:00
|
|
|
.SH HISTORY
|
|
|
|
.I Boot
|
|
|
|
first appeared in Plan 9 from Bell Labs. It was rewritten
|
|
|
|
in
|
|
|
|
.I rc
|
|
|
|
for 9front (April, 2011).
|