[nSLUG] PXE Server

Donald Teed dteed at artistic.ca
Wed Mar 3 17:05:50 AST 2004

I've received an email from the maker of udpcast with
instructions on how to make a menu for the PXE Server.

Some of this is specific to use of udpcast, but
I felt I should leave in that aspect for anyone else
that wants hints for udpcast.

If anyone is following this problem and needs something similar,
and for example your solution doesn't require an initrd file and such,
adjust the picture accordingly.

We are using dhcp server and tftp server on a linux box
to provide a PXE boot with a menu so that specific kernel
parameters can be associated with a menu.  The client
needs to enter a number cooresponding to the type of
task they want to do, and then hit enter.  This is desired
because (a) the people using this are not necessarily
technical, and (b) shaving seconds off the process of imaging
a hundreds or thousands of machines is worthwhile.

1. Using cast-o-matic (or a local makeImage) make an initrd that has everything preconfigured except disk partition, and send/receive mode.  (this
is a udpcast specific step)

2. In /etc/dhcpd.conf you set the following (in case you haven't this

--  start of snippet within dhcp.conf --

class "pxe" {
   match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
   filename "udpcast/pxelinux.0";  # Uncomment }

--  end of snippet within dhcp.conf --

3. Place your linux and initrd files, and syslinux's
pxelinux.0 under /tftpboot/udpcast
(linux is the linux kernel file)

4. Put the attached example into your into your
/tftpboot/udpcast/pxelinux.cfg/default file
The example assumes that you have Windows on /dev/hda1
and Linux on /dev/hda2. Adapt as appropriate
(The idea is that you supply on the kernel command
line those parameters that are _not_ set in the initrd.
Actually it would be more elegant to supply _all_ parameters
on the kernel command line, but unfortunately the kernel
only seems to take the first 6 params into account...)

-- attached sample default --
label 0
  localboot 0

label 1
  kernel linux
  append initrd=initrd disk=/dev/hda umode=snd auto=yes 

label 2
  kernel linux
  append initrd=initrd disk=/dev/hda1 umode=snd auto=yes 

label 3
  kernel linux
  append initrd=initrd disk=/dev/hda2 umode=snd auto=yes 

label 4
  kernel linux
  append initrd=initrd disk=/dev/hda umode=rcv auto=yes 

label 5
  kernel linux
  append initrd=initrd disk=/dev/hda1 umode=rcv auto=yes 

label 6
  kernel linux
  append initrd=initrd disk=/dev/hda2 umode=rcv auto=yes 

implicit	0
display		message
prompt		1
timeout		0

-- end of attached sample default --

5. Put the attached message file into /tftpboot/udpcast/message

-- begin of attached sample message file --
0. Boot from local hard disk
1. Sender for full hard disk
2. Sender for Windows partition
3. Sender for Linux partition
4. Receiver for full hard disk
5. Receiver for Windows partition
6. Receiver for Linux partition
-- end of attached sample message file--

--Donald Teed

More information about the nSLUG mailing list