Installing Linux via PXE
(This apply for installing Linux Mandrake 8.2, but it should be easy for
other distributions)
Goal: We have a laptop PXE enabled (3Com, or Intel), without CDROM or Floppy
and we want to install linux.
We have on the network another computer to provide files.
1. What you need
Go http://www.bpbatch.org/, and download their TFTP server http://www.bpbatch.org/downloads/incomtftpdlx.tar.gz,
dhcp proxy http://www.bpbatch.org/downloads/proxydhcp.tar.gz,
and http://www.bpbatch.org/downloads/bpb-exe.tar.gz
You need a DHCP server too (V3).
2. Configuration
2.1 DHCP Server
Here is my config file:
option domain-name "net.mydomain.net";
option domain-name-servers ns2.mydomain.net;
option option-135 code 135 = text;
ddns-update-style none;
option subnet-mask 255.255.255.0;
default-lease-time -1;
max-lease-time 7200;
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
host annie {
##change the following to the HW address of your laptop
hardware ethernet 0:a0:b0:c0:d0:e0;
next-server 192.168.1.202;
fixed-address 192.168.1.18;
filename "bpbatch";
option vendor-encapsulated-options 01:04:00:00:00:00:ff;
class "pxeclients"
{
match if substring (option vendor-class-identifier, 0, 9) =
"PXEClient";
option option-135 "-i";
option vendor-class-identifier "PXEClient";
option vendor-encapsulated-options 01:04:00:00:00:00:ff;
# At least one of the vendor-specific option must be set. We set
# the MCAST IP address to 0.0.0.0 to tell the bootrom to still use
# TFTP (address 0.0.0.0 is considered as "no address")
option PXE.mtftp-ip 0.0.0.0;
vendor-option-space PXE;
}
}
Start your dhcp server with your favorite command. In the logs, something
normal should be written.
2.2 TFTP
Create a /tftpboot directory
and launch server with ./tftpd.libc6 -d /tftpboot
Copy files in the /tftpboot directory:
bpbatch bpbatch.ovl and bpbatch.hlp.
These files are needed for the first level of the install.
Get a mdk CD, and extract initrd and kernel from the image for network boot:
mount -o loop network.img /mnt/floppy
cp /mnt/floopy/vmlinuz /tftpboot
cp /mnt/floopy/network.rdz /tftpboot
umount /mnt/floppy
These two files are responsable for the second level of the boot.
2.3 DHCP Proxy
The program shipped with bpbatch is buggy, He doesn't listen on the 4011
port.
I've done a awful hack to get if working: delete line 209 and 218 (end of
if) from dhcpproxy.c before compiling.
Launch the program with ./proxydhcp 192.168.1.202 bpbatch
2.4 Mandrake NFS/FTP/HTTP install
This part is left as exercise.
3 Booting
Power on your laptop and configure your bios to use PXE booting.
The laptop will request an IP:
May 11 14:05:37 juliette dhcpd: DHCPDISCOVER from 00:a0:b0:c0:d0:e0 via eth0
May 11 14:05:37 juliette dhcpd: DHCPOFFER on 192.168.1.18 to 00:a0:b0:c0:d0:e0 via eth0
May 11 14:05:39 juliette dhcpd: DHCPREQUEST for 192.168.1.18 (192.168.1.202) from 00:a0:b0:c0:d0:e0 via eth0
May 11 14:05:39 juliette dhcpd: DHCPACK on 192.168.1.18 to 00:a0:b0:c0:d0:e0 via eth0
and Proxy DHCP will get some info:
Minimal PXE Proxy DHCP daemon, for use with BpBatch
By David Clerc & Marc Vuilleumier Stuckelberg, CUI, University of Geneva
Bootfile is 192.168.1.202:bpbatch
BOOTP/DHCP port in use, trying BINL mode
(do not forget to set tag 60 to PXEClient on your DHCP server)
Server started on port 4011
Datagram of 548 bytes received from 192.168.1.18
IF: eth0Sending 283 bytes
bpbatch and overlay file will be downloaded wia tftp:
TFTPD[00]: RRQ, fn= bpbatch, mode= octet, from= 192.168.1.18/2070
TFTPD: unsupported opcode= 0x0005, from= 192.168.1.18/2070
TFTPD[00]: RRQ, fn= bpbatch, mode= octet, from= 192.168.1.18/2071
TFTPD[00]: transfer= 2 KByte/sec, len= 2183, retries= 0
TFTPD[01]: RRQ, fn= bpbatch.ovl, mode= octet, from= 192.168.1.18/2072
TFTPD[01]: transfer= 187 KByte/sec, len= 191812, retries= 0
Nice shot, you should have a shell on your laptop!!
Now download the kernel, initrd and Boot it!
You'll have to type:
Set CacheNever="ON"
So cache is disabled
And indication for file parameters:
LinuxBoot "vmlinuz" "ramdisk_size=32000 root=/dev/ram3" "network.rdz"
You can add some more parameters for the kernel in the second string: text
or vga=791
Files are downloaded from tftp server.
Installation is starting!
Some remarks: manu@agat.net