|
|
|
|
4.3 Preparing the Boot of the Target System
This section covers the configuration tasks needed in complex boot
scenarios. It contains ready-to-apply configuration examples for DHCP,
PXE boot, TFTP, and Wake on LAN.
4.3.1 Setting Up a DHCP Server
There are two ways to set up a DHCP server. For
SUSE Linux Enterprise Server 9 and higher, YaST provides a graphical
interface to the process. Users of any other SUSE Linux-based products and
non-SUSE Linux users should manually edit the configuration files or use
the front-end provided by their operating system vendors.
Setting Up a DHCP Server with YaST
To announce the TFTP server's location to the network clients and
specify the boot image file the
installation target should use, add two declarations to your DHCP server
configuration.
-
Log in as root to the machine hosting the DHCP server.
-
Start .
-
Complete the setup wizard for basic DHCP server setup.
-
Select and select
when warned about leaving the start-up
dialog.
-
In the dialog,
select the subnet in which the new system should be located and
click .
-
In the dialog select
to add a new option to the subnet's
configuration.
-
Select filename and enter
pxelinux.0 as the value.
-
Add another option (next-server) and set its
value to the address of the TFTP server.
-
Select and to
complete the DHCP server configuration.
To configure DHCP to provide a static IP address to a specific
host, enter the of the DHCP server
configuration module (Step 4) and add
a new declaration of the host type. Add the options
hardware and fixed-address to this
host declaration and provide the appropriate values.
Setting Up a DHCP Server Manually
All the DHCP server needs to do, apart from providing automatic
address allocation to your network clients, is to announce the IP
address of the TFTP server and the file that should be pulled in by
the installation routines on the target machine.
-
Log in as root to the machine hosting the DHCP server.
-
Append the following lines to your DHCP server's
configuration file located under
/etc/dhcpd.conf: group {
# PXE related stuff
#
# "next server" defines the tftp server that will be used
next server ip_tftp_server:
#
# "filename" specifies the pxelinux image on the tftp server
# the server runs in chroot under /srv/tftpboot
filename "pxelinux.0";
}
Replace
ip_of_the_tftp_server
with the actual IP address of the TFTP server.
For more information about the options available in
dhcpd.conf, refer to the
dhcpd.conf manual page.
-
Restart the DHCP server by executing rcdhcpd
restart.
If you plan on using SSH for the remote control of a PXE and Wake on
LAN installation, explicitly specify the IP address DHCP
should provide to the installation target. To
achieve this, modify the above-mentioned DHCP configuration according
to the following example:
group {
# PXE related stuff
#
# "next server" defines the tftp server that will be used
next server ip_tftp_server:
#
# "filename" specifies the pxelinux image on the tftp server
# the server runs in chroot under /srv/tftpboot
filename "pxelinux.0";
host test { hardware ethernet mac_address;
fixed-address some_ip_address; }
}
The host statement introduces the hostname of the installation
target. To bind the hostname and IP address to a specific host, you
must know and specify the system's hardware (MAC) address. Replace
all the variables used in this example with the actual values that
match your environment.
After restarting the DHCP server, it provides a static IP to
the host specified, enabling you to connect to the system
via SSH.
4.3.2 Setting Up a TFTP Server
Set up a TFTP server with YaST on SUSE Linux Enterprise Server and
SUSE Linux or set it up manually on any other Linux operating
system that supports xinetd and tftp. The TFTP server delivers the boot
image to the target system once it boots and sends a request for it.
Setting Up a TFTP Server Using YaST
-
Log in as root.
-
Start and install
the requested package.
-
Click to make sure that the server is
started and included in the boot routines. No further action
from your side is required to secure this. xinetd starts
tftpd at boot time.
-
Click to open the
appropriate port in the firewall running on your machine. If
there is no firewall running on your server, this option is not
available.
-
Click to browse for the boot image
directory. The default directory /tftpboot is
created and selected automatically.
-
Click to apply your settings and
start the server.
Setting Up a TFTP Server Manually
-
Log in as root and install the packages
tftp and
xinetd.
-
If unavailable, create /srv/tftpboot and
/srv/tftpboot/pxelinux.cfg
directories.
-
Add the appropriate files needed for the boot image as
described in Section 4.3.3,
Using PXE Boot.
-
Modify the configuration of xinetd located under
/etc/xinetd.d/ to make sure that the TFTP server
is started on boot:
-
If it does not exist, create a file called
tftp under this directory with
touch tftp. Then run
chmod 755 tftp.
-
Open the file tftp and add the
following lines: service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
}
-
Save the file and restart xinetd with
rcxinetd restart.
4.3.3 Using PXE Boot
Some technical background information as well as PXE's complete
specifications are available in the Preboot Execution Environment (PXE)
Specification (ftp://download.intel.com/labs/manage/wfm/download/pxespec.pdf).
-
Change to the directory of your installation repository and
copy the linux, initrd,
message, and memtest
files to the /srv/tftpboot directory by
entering the following: cp -a boot/loader/linux boot/loader/initrd
boot/loader/message boot/loader/memtest /srv/tftpboot
-
Install the syslinux package directly from
your installation
CDs or DVDs with YaST.
-
Copy the /usr/share/syslinux/pxelinux.0
file to the /srv/tftpboot directory by
entering the following: cp -a /usr/share/syslinux/pxelinux.0 /srv/tftpboot
-
Change to the directory of your installation repository and
copy the isolinux.cfg file to
/srv/tftpboot/pxelinux.cfg/default by entering the
following: cp -a boot/loader/isolinux.cfg /srv/tftpboot/pxelinux.cfg/default
-
Edit the
/srv/tftpboot/pxelinux.cfg/default file and
remove the lines beginning with gfxboot,
readinfo, and framebuffer.
-
Insert the following entries in the append lines of the default
failsafe and apic labels:
-
insmod=kernel module
-
By means of this entry, enter the network kernel module needed to
support network installation on the PXE client. Replace
kernel module with the appropriate module
name for your network device.
-
netdevice=interface
-
This entry defines the client's network interface that
must be used for the network installation. It is only
necessary if the client is equipped with several network
cards and must be adapted accordingly. In case of a single
network card, this entry can be omitted.
-
install=nfs://ip_instserver/path_instsource/CD1
-
This entry defines the NFS server and the installation source for
the client installation. Replace
ip_instserver with the actual IP address of
your installation server. path_instsource
should be replaced with the actual path to the installation sources.
HTTP, FTP, or SMB sources are addressed in a similar manner, except
for the protocol prefix, which should read http,
ftp, or smb.
An example /srv/tftpboot/pxelinux.cfg/default
file follows. Adjust the protocol prefix for the installation
source to match your network setup and specify your preferred method
of connecting to the installer by adding the
vnc and vncpassword or the
ssh and sshpassword
options to the install entry. The lines
separated by \ must be entered as one continuous
line without a line break and without the \. default linux
# default
label linux
kernel linux
append initrd=initrd ramdisk_size=65536 insmod=e100 \
install=nfs://ip_instserver/path_instsource/product
# failsafe
label failsafe
kernel linux
append initrd=initrd ramdisk_size=65536 ide=nodma apm=off acpi=off \
insmod=e100 install=nfs://ip_instserver/path_instsource/product
# apic
label apic
kernel linux
append initrd=initrd ramdisk_size=65536 apic insmod=e100 \
install=nfs://ip_instserver/path_instsource/product
# manual
label manual
kernel linux
append initrd=initrd ramdisk_size=65536 manual=1
# rescue
label rescue
kernel linux
append initrd=initrd ramdisk_size=65536 rescue=1
# memory test
label memtest
kernel memtest
# hard disk
label harddisk
kernel
linux append SLX=0x202
implicit 0
display message
prompt 1
timeout 100
Replace ip_instserver and
path_instsource with the values
used in your setup.
The following section serves as a short reference to the
PXELINUX options used in this setup. Find more information about the
options available in the documentation of the
syslinux package located under
/usr/share/doc/packages/syslinux/.
4.3.4 PXELINUX Configuration Options
The options listed here are a subset of all the options available
for the PXELINUX configuration file.
-
DEFAULT kernel
options...
-
Sets the default kernel command line. If PXELINUX boots
automatically, it acts as if the entries after DEFAULT had
been typed in at the boot prompt, except the auto option is
automatically added, indicating an automatic boot.
If no configuration file is present or no DEFAULT entry is
present in the configuration file, the default is the kernel name
linux with no options.
-
APPEND options...
-
Add one or more options to the kernel command line. These are
added for both automatic and manual boots. The options are added
at the very beginning of the kernel command line, usually
permitting explicitly entered kernel options to override
them.
-
LABEL label KERNEL
image APPEND
options...
-
Indicates that if label is entered
as the kernel to boot, PXELINUX should instead boot
image and the specified
APPEND options should be used instead of the
ones specified in the global section of the file (before the
first LABEL command). The default for
image is the same as
label and, if no
APPEND is given, the default is to use the
global entry (if any). Up to 128 LABEL entries
are permitted.
Note that GRUB uses the following syntax: title mytitle
kernel my_kernel my_kernel_options
initrd myinitrd
PXELINUX uses the following syntax: label mylabel
kernel mykernel
append myoptions
Labels are mangled as if they were filenames and they must
be unique after mangling. For example, the two labels
v2.1.30 and v2.1.31 would not be
distinguishable under PXELINUX because both mangle to the same
DOS filename.
The kernel does not have to be a Linux kernel;
it can be a boot sector or a COMBOOT file.
- APPEND -
-
Append nothing. APPEND with a single hyphen
as argument in a LABEL section can be used to
override a global APPEND.
-
LOCALBOOT type
-
On PXELINUX, specifying LOCALBOOT 0 instead
of a KERNEL option means invoking this
particular label and causes a local disk boot instead of a kernel
boot.
All other values are undefined. If you do not know what the
UNDI or PXE stacks are, specify 0.
-
TIMEOUT time-out
-
Indicates how long to wait at the boot prompt until booting
automatically, in units of 1/10 second. The time-out is canceled as
soon as the user types anything on the keyboard, assuming
the user will complete the command begun.
A time-out of zero disables the time-out completely (this is
also the default). The maximum possible time-out value is 35996 (just
less than one hour).
-
PROMPT flag_val
-
If flag_val is 0, displays the boot prompt
only if Shift or Alt is pressed or Caps
Lock or Scroll Lock is set (this is
the default). If flag_val is 1, always displays
the boot prompt.
F2 filename
F1 filename
..etc...
F9 filename
F10 filename
Displays the indicated file on the screen when a function key
is pressed at the boot prompt. This can be
used to implement preboot online help (presumably for the kernel
command line options). For backward compatibility with earlier
releases, F10 can be also entered as
F0. Note that there is currently no way to bind
filenames to F11 and
F12.
4.3.5 Preparing the Target System for PXE Boot
Prepare the system's BIOS for PXE boot by including the PXE option
in the BIOS boot order.
WARNING: BIOS Boot Order
Do not place the PXE option ahead of the hard disk boot option in
the BIOS. Otherwise this system would try to reinstall itself every
time you boot it.
4.3.6 Preparing the Target System for Wake on LAN
Wake on LAN (WOL) requires the appropriate BIOS option to be
enabled prior to the installation. Also, note down the MAC address of
the target system. This data is needed to initiate Wake on LAN.
4.3.7 Wake on LAN
Wake on LAN allows a machine to be turned on by a special network
packet containing the machine's MAC address. Because every
machine in the world has a unique MAC identifier, you do not need to
worry about accidentally turning on the wrong machine.
IMPORTANT: Wake on LAN across Different Network Segments
If the controlling machine is not located in the same network
segment as the installation target that should be awakened, either
configure the WOL requests to be sent as multicasts or remotely
control a machine on that network segment to act as the sender of these
requests.
Users of SUSE Linux Enterprise Server 9 and higher can use a YaST module
called WOL to easily configure Wake on LAN. Users of other versions of
SUSE Linux-based operating systems can use a command line tool.
4.3.8 Wake on LAN with YaST
-
Log in as root.
-
Start .
-
Click and enter the hostname and MAC address
of the target system.
-
To turn on this machine, select the appropriate entry and
click .
4.3.9 Manual Wake on LAN
-
Log in as root.
-
Start and
install the
package netdiag.
-
Open a terminal and enter the following command as root to wake
the target: ether-wake mac_of_target
Replace mac_of_target
with the actual MAC address of the target.
|
|
|