Showing posts with label PXE. Show all posts
Showing posts with label PXE. Show all posts

Wednesday, November 29, 2017

iPXE boot from tftpd

Why do they keep making life difficult ?

Upgraded to the latest Prox v5 and went to do a test tftp boot. Always worked before. Suddenly faced with a continuously looping iPXE BIOS thingy.

And rubbish documentation on the subject.

All I wanted was a simple 'boot from existing tftpd setup'. Easy. Or not.

So, the answer is easy, ish.

http://ipxe.org/cmd/chain

Boot, press Control + B and then type

chain tftp://10.1.2.3/pxelinux.0

No idea how to make this default on Proxmox though.

What is inexcusable is that it can't figure this out by itself and means I have to go wasting time hunting about for stuff.

Grrrrrrrr. Bloody smartarse developers.

Tuesday, May 24, 2016

Proxmox v4 using Jessie PXE boot

Had a bit of fun getting this running with my existing PXE setup. I wanted a non standard disk layout for Proxmox.

The Debian PXE way (stupidly) assumes it is the only distro in town so making it work with a tftp setup with multiple distros is a touch more tricky.

I assume you have a working tftp setup.

I store my image files in:

/tftpboot/images/somedirectory

I have the following directories in my tftpboot directory:

com32 > contains vesamenu.c32 etc
graphics > contains background images
images > contains directories for each distro
pxelinux.cfg > contains config files

pxelinux.0 is in the root tftpboot directory

To make Debian boot we have to amend a whole pile of paths.... tftpd is very dumb so you have to be pretty specific about where stuff is stored.

First I extracted the relevant Debian boot files from netboot.tar.gz to

/tftpboot/images/debian

In my 'default' tftpd config file I have several menu choices leading off to other menus and configs. I first added a link to the Debian installer menu.

cat /tftpboot/pxelinux.cfg/default

# header stuff
label Debian Netinstall
 menu label ^Debian Netinstall
 kernel com32/vesamenu.c32
 append pxelinux.cfg/debian

I then added a 'debian' config file containing the following:

cat /tftpboot/pxelinux.cfg/debian

# D-I config version 1.0
include images/debian/debian-installer/amd64/boot-screens/menu.cfg
default images/debian/debian-installer/amd64/boot-screens/vesamenu.c32
prompt 0
timeout 0

Now you have to adjust paths/directories in the debian config files.

In my case here : /tftpboot/images/debian/debian-installer/amd64/boot-screens

grep -r -l debian-installer * | xargs sed -i "s|debian-installer|images/debian/debian-installer|g"

One last issue is the possible lack of firmware for your hardware.

I fixed this by doing the following:

# cd to the directory where you have your initrd
cd /tftpboot/debian-installer/amd64
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
[ -f firmware.cpio.gz ] || wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/stable/current/firmware.cpio.gz
cat initrd.gz.orig firmware.cpio.gz > initrd.gz

Hopefully you can now PXE boot and get your Debian installed