Mac Address | 08:00:20:09:56:17 |
IP Address | 192.168.0.161 |
IP Address(hex compattato) | C0A800A1 |
Architettura | Sun4C |
diskless(8)
manual page for a more detailed guide on
how to proceed with this. If the server runs another operating system, you
should consult the NetBSD Diskless HOW-TO, which will walk you through the steps
necessary to configure a netboot server on a variety of platforms. http://www.netbsd.org/Documentation/network/netboot/
This section will briefly describe what happens during a Sparc netboot, and
the next section will give a brief set of directions on how to set up your
server. Your Sparc initially broadcasts a RARP request, and expects a server to
reply with your client's IP address. Next, it downloads a second stage bootstrap
program via TFTP from the server that responded to the RARP request. It will
look for a filename composed of the machine's IP address followed by the
machine's architecture, separated by a period. For example, a sun4c machine
which has been assigned IP address 130.115.144.11, will make an TFTP request for
8273900B.SUN4C
. This file is a symbolic link to the second-stage
boot program, which should be located in a place where the TFTP daemon can find
it (remember, many TFTP daemons run in a chroot'ed environment).
The boot program to use is installation/netboot/boot.net
Alternatively, you can find the bootstrap program in /usr/mdec/boot.net
in the NetBSD/sparc distribution.
/usr/mdec/boot.net
and /usr/mdec/boot
is in the a.out header, which has been magically transformed in a way that
makes it usable on all versions of Sparc PROMs.After the boot program has been loaded into memory and given control by the PROM, it starts locating the machine's remote root directory through the BOOTPARAM protocol. First a BOOTPARAM WHOAMI request is broadcast on the local net. The answer to this request should contain the client's name. This name is used in next step, a BOOTPARAM GETFILE request - sent to the server that responded to the WHOAMI request - requesting the name and address of the machine that will serve the client's root directory, as well as the path of the client's root on that server.
Finally, this information is used to issue a REMOTE MOUNT request to the client's root filesystem server, asking for an NFS file handle corresponding to the root filesystem. Once the NFS mount is complete, the boot program starts reading from the remote root filesystem in search of the kernel which is then read into memory.
CC:CC:CC:CC:CC:CC
' as the MAC address (ethernet hardware
address) of your netboot client machine that you wish to install NetBSD on. We
use `192.168.1.10
' as the IP address of your client, and `client.test.net
'
as the name. The server name is `server.test.net
', and the path on
the server to the NFS exported directory is /export/client/root
although you may choose to use a different path. Create an /etc/ethers
file with the following line:
CC:CC:CC:CC:CC:CC client
Add your client to the server's /etc/hosts
file:
192.168.1.10 client
If rarpd is currently running, restart it (kill -HUP), otherwise start rarpd:
#
/usr/sbin/rarpd -a
Next, create /etc/bootparams
with the following line:
client root=server:/export/client/root
If rpc.bootparamd is currently running, restart it (kill -HUP), otherwise start rpc.bootparamd:
#
/usr/sbin/rpc.bootparamd
Now, make sure the bootloader in /tftpboot
is linked to, or a
copy of, boot.net
and is named appropriately for your client (in
this case, it would be C0A8010A.SUN4C
).
#
cp boot.net /tftpboot
#
ln -s /tftpboot/boot.net
/tftpboot/C0A8010A.SUN4C
Now, you should edit /etc/inetd.conf
and make sure that the line
starting with tftp
is uncommented. You will need to kill -HUP
the inetd process to enable tftp if this line was previously commented
out. The next step is to set up NFS exports. Create the directory you are
exporting for the netboot client:
#
mkdir -p /export/client/root
Put the following line in /etc/exports
to enable NFS sharing:
/export/client/root -maproot=root
client.test.net
If your server is currently running NFS services, you only need to kill -HUP the mountd process. Otherwise, you need to run:
#
/usr/sbin/mountd
#
/usr/sbin/nfsd -tun 4
Now, you need to place the files your netboot client will need. As noted above in the section Preparing your System for NetBSD Installation you have several options when choosing a location to store the distribution filesets. However, the easiest way is to put the distribution files into the exported directory for your client on the server.
#
mv *.tgz /export/client/root
Your client will need a kernel to boot (use binary/kernel/netbsd.GENERIC.gz
).
#
gunzip netbsd.GENERIC.gz
#
mv netbsd.GENERIC
/export/client/root/netbsd
Your client will need installation tools (use installation/netboot/rootfs.tgz
).
#
gunzip < rootfs.tgz |
(cd /export/client/root && tar -xpf -)
Now, netboot your Sparc from the server by entering the appropriate boot command at the monitor prompt. Depending on the PROM version in your machine, this command takes one of the following forms:
>
b le()netbsd
ok
b le()netbsd
ok
b net netbsdAfter the initial probe messages you'll be asked to start the install or upgrade procedure. Proceed to the section Running the installation scripts. below.
If you're using a terminal device connected to a serial port, choose a terminal type appropriate for that device, e.g. vt100 or vt200.
Next, you will be presented with a choice of two installation methods: a new full-screen sysinst program, or the traditional script-based miniroot program. The sysinst program is easier to use, but the miniroot program is more flexible. Both of these installation methods will follow the same set of procedures and will fully install NetBSD on your Sparc.
You will frequently be asked for confirmation before the system proceeds with each phase of the installation process.
Occasionally, you will have to provide a piece of information such as the
name of the disk you want to install on, partitioning information, or IP
addresses and domain names you want to assign. If your system has more than one
disk, you may want to look at the output of the dmesg(8)
command to
see how your disks have been identified by the kernel.
The installation script goes through the following phases:
Now try a reboot. Initially we'd suggest you boot sd()netbsd -bs, then try multiuser after that. If you boot single-user the NetBSD incantation to make the root filesystem writable is
#
mount -u /dev/sd0a /
Your PROM might have been setup to instruct the boot program to load a file
called vmunix
. On OpenBoot PROM systems you can change it to load netbsd
instead using the following commands:
ok
setenv boot-from sd(0,0,0)netbsd
ok
setenv boot-file netbsdok
setenv boot-device disk:aCongratulations, you have successfully installed NetBSD1.5.2.
Once you've got the operating system running, there are a few things you need to do in order to bring the system into a properly configured state, with the most important ones described below.
/etc/rc.conf
If you or the installation software haven't done any configuration of /etc/rc.conf
(sysinst usually will), the system will drop you into single user
mode on first reboot with the message
/etc/rc.conf is not configured.
Multiuser boot aborted.
and with the root file system (/
) mounted read-write. When
the system asks you to choose a shell, simply press RETURN
to
get to a /bin/sh
prompt. If you are asked for a terminal type,
respond with sun for a local console, or whatever is appropriate for
your serial console (some systems display garbage with a sun terminal
type, you may need to use sun-ss5) and press RETURN
. You
may need to type one of the following commands to get your delete key to
work properly, depending on your keyboard:
#
stty erase '^h'
#
stty erase '^?'
At this point, you need to configure at least one file in the /etc
directory. You will need to mount your root filesystem read/write with:
#
/sbin/mount -u -w /
Change to the /etc
directory and take a look at the /etc/rc.conf
file. Modify it to your tastes, making sure that you set rc_configured=YES
so that your changes will be enabled and a multi-user boot can proceed.
Default values for the various programs can be found in /etc/defaults/rc.conf
,
where some in-line documentation may be found. More complete documentation
can be found in rc.conf(5)
.
If your /usr
directory is on a separate partition and you do
not know how to use ed, you will have to mount your /usr
partition to gain access to ex or vi. Do the following:
#
mount /usr
#
export TERM=sun
If you have /var
on a separate partition, you need to repeat
that step for it. After that, you can edit /etc/rc.conf
with vi(1)
.
When you have finished, type exit at the prompt to leave the
single-user shell and continue with the multi-user boot.
Other values that need to be set in /etc/rc.conf
for a
networked environment are hostname and possibly defaultroute,
furthermore add an ifconfig_int for your <int> network
interface, along the lines of
ifconfig_le0="inet
123.45.67.89 netmask 255.255.255.0"
or, if you have myname.my.dom in /etc/hosts
:
ifconfig_le0="inet
myname.my.dom netmask 255.255.255.0"
To enable proper hostname resolution, you will also want to add an /etc/resolv.conf
file or (if you are feeling a little more adventurous) run named(8)
.
See resolv.conf(5)
or named(8)
for more
information.
Other files in /etc
that may require modification or setting
up include /etc/mailer.conf
, /etc/nsswitch.conf
,
and /etc/wscons.conf
.
After reboot, you can log in as root
at the login prompt.
Unless you've set a password in sysinst, there is no initial
password. If you're using the machine in a networked environment, you should
create an account for yourself (see below) and protect it and the ``root''
account with good passwords. Unless you have connected an unusual terminal
device as the console you can just press RETURN
when it prompts
for Terminal type? [...]
.
Use the useradd(8)
command to add accounts to your system, do
not edit /etc/passwd
directly. See useradd(8)
for more information on how to add a new user to the system.
If you have installed the X Window System, look at the files in /usr/X11R6/lib/X11/doc
for information.
Don't forget to add /usr/X11R6/bin
to your path in your
shell's dot file so that you have access to the X binaries.
If you wish to install any of the software freely available for UNIX-like systems you are strongly advised to first check the NetBSD package system. This automatically handles any changes necessary to make the software run on NetBSD, retrieval and installation of any other packages on which the software may depend, and simplifies installation (and deinstallation), both from source and precompiled binaries.
1.5.2/sparc/All
subdir. You can install them
with the following commands:
# export PKG_PATH=ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5.2/sparc/All # pkg_add -v tcsh # pkg_add -v cvs # pkg_add -v apache # pkg_add -v perl ...
The above commands will install the tcsh shell, the CVS source code management system, the Apache web server and the perl programming language as well as all the packages they depend on.
/usr/pkgsrc
(though other
locations work fine), with the commands:
#
mkdir /usr/pkgsrc
#
( cd /usr/pkgsrc ;
tar -zxpf - ) < pkgsrc.tar.gz
After extracting, then see the README
file in the
extraction directory (e.g. /usr/pkgsrc/README
) for more
information.
/etc/mail/aliases
to forward root mail to the right
place. Don't forget to run newaliases(1)
afterwards.
/etc/mail/sendmail.cf
file will almost definitely
need to be adjusted; files aiding in this can be found in /usr/share/sendmail
.
See the README file there for more
information.
/etc/rc.local
to run any local daemons you use.
/etc
files are documented in section 5 of
the manual; so just invoking
#
man 5
filename
is likely to give you more information on these files.