Skip to content

yeupou/calaboose.pxe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#
# FILE DISCONTINUED HERE
# UPDATED VERSION AT
#         https://gitlab.com/yeupou/calaboose.pxe/raw/master/README
#
#                                 |     |
#                                 \_V_//
#                                 \/=|=\/
#                                  [=v=]
#                                __\___/_____
#                               /..[  _____  ]
#                              /_  [ [  M /] ]
#                             /../.[ [ M /@] ]
#                            <-->[_[ [M /@/] ]
#                           /../ [.[ [ /@/ ] ]
#      _________________]\ /__/  [_[ [/@/ C] ]
#     <_________________>>0---]  [=\ \@/ C / /
#        ___      ___   ]/000o   /__\ \ C / /
#           \    /              /....\ \_/ /
#        ....\||/....           [___/=\___/
#       .    .  .    .          [...] [...]
#      .      ..      .         [___/ \___]
#      .    0 .. 0    .         <---> <--->
#   /\/\.    .  .    ./\/\      [..]   [..]
#
#
# FILE DISCONTINUED H
#         https://gitlab.com/yeupou/bada/raw/master/README
#
#                                 |     |
#                                 \_V_//
#                                 \/=|=\/
#                                  [=v=]
#                                __\___/_____
#                               /..[  _____  ]
#                              /_  [ [  M /] ]
#                             /../.[ [ M /@] ]
#                            <-->[_[ [M /@/] ]
#                           /../ [.[ [ /@/ ] ]
#      _________________]\ /__/  [_[ [/@/ C] ]
#     <_________________>>0---]  [=\ \@/ C / /
#        ___      ___   ]/000o   /__\ \ C / /
#           \    /              /....\ \_/ /
#        ....\||/....           [___/=\___/
#       .    .  .    .          [...] [...]
#      .      ..      .         [___/ \___]
#      .    0 .. 0    .         <---> <--->
#   /\/\.    .  .    ./\/\      [..]   [..]
#  / / / .../|  |\... \ \ \    _[__]   [__]_
# / / /       \/       \ \ \  [____>   <____]
#
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*), assuming your network is 192.168.1.?

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).

(Note: if you are using a dpkg-based distribution, you can get this with apt-get instead of git. Read https://github.com/yeupou/stalag13 and get stalag13-utils-pxe)

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 though), assuming you have an http server like nginx running.

With the default setup, you first need to add a symlink from /srv/pxe to /var/www/pxe 

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

(you should also edit /etc/cron.monthly/pxe accordingly)


# EOF

About

Setup for ethernet boot on lan with iPXE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages