Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 70 lines (44 sloc) 2.632 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
This is setup to use ethernet cards "boot on lan" feature with Debian netboot.
It is shamefully based on http://www.debian-administration.org/articles/478
and advertised at http://yeupou.wordpress.com/2012/05/29/having-homemade-aliases-functions-and-such-available-to-every-interactive-shells/



To set this up:
---------------

On the server (you have a home server, right? *plonk*),

Put this directory somewhere clever, like /srv/pxe for instance (yes, that's what I did; but you can put it in /opt/my/too/long/path/i/cannot/remember if you really really want).

Run the ipxe-boot-update.sh main script. It will build up ipxe-boot config files and (by default) download GNULinux kernels and initrd.
(It will run any additional ipxe-boot-update.sh that you may add in subdirectories. See the one in GNULinux as example)

You may add a symlink to this script inside /etc/cron.monthly so you keep stuff up-to-date.

Then, you must install a "Trivial FTP Daemon" on you local server which will, in the context of PXE (Preboot Execution Environment), serve these files you just got:
      apt-get install tftpd-hpa
      update-rc.d tftpd-hpa defaults
Edit /etc/default/tftpd-hpa, especially TFTP_DIRECTORY setting (you know, /opt/my/what/the/...).

We'll, instead of using the basic PXE stuff, use iPXE by chainloading it.
(We could apt-get ipxe but the current version in Debian does not support useful commands like menu or cpuid) We'll simply do:
       cd /srv/pxe
       wget http://boot.ipxe.org/undionly.kpxe

Finally, you must update your DHCP Daemon so it advertises we're running PXE (filename and next-server options). With ISC dhcpd, in /etc/dhcp/dhcpd.conf, for my subnet, I have now:
 subnet 192.168.1.0 netmask 255.255.255.0 {
        range 192.168.1.100 192.168.1.200;

# iPXE
if exists user-class and option user-class = "iPXE" {
filename "ipxe-boot";
} else {
     filename "undionly.kpxe";
   }
next-server 192.168.1.1;
 }



Obviously, you wont forget to do:
      invoke-rc.d isc-dhcp-server restart
      invoke-rc.d tftpd-hpa start



To use it:
----------

On your client,

Go in the BIOS, look for "boot on lan" and whatever crap it may be called (it varies greatly), activate it. Then boot. It'll do some DHCP magic to find the path to the PXE and the menu should be printed on your screen at some point.


Further...:
-----------

You can decide to use http instead of tftpd for faster file transfer once
 iPXE is loaded (which means tfpd will still be necessary tough).

For instance, you can run
    export PREFIX=http://URL/pxe/
before starting the ipxe-boot-update.sh script.


# EOF
Something went wrong with that request. Please try again.