After facing issue after issue with Idera/R1soft’s PXE and CD-ROM boot media — specifically, ancient kernels which are unable to obtain network connectivity on modern hardware, I decided to roll my own PXE boot image including the R1soft agent and a few other tools with the latest Debian stable. It turned out to be easier than I expected — kudos to the debian-live project.
Boot into a debian Live-CD and set up the bootstrap environment. I’m using 7.6.0 (latest stable at this time).
apt-get install debootstrap squashfs-tools
mkdir -p work/chroot
If you’re creating the image from scratch, use the following commands.
debootstrap --arch=amd64 stable chroot
cp /etc/network/interfaces chroot/etc/network/interfaces # Needed for network connectivity
If you are re-working an existing image, you can import it instead.
unsquashfs -f -d chroot filesystem.squashfs
rm -f filesystem.squashfs
Now we prep the image and chroot.
cp /etc/resolv.conf chroot/etc/resolv.conf # Needed for network connectivity
mount none -t proc /proc
mount none -t sysfs /sys
mount none -t devpts /dev/pts
Now you can do whatever you want to the image by installing packages and modifying configurations. You need to install the kernel at a minimum if you want to load modules after boot such as raid. You can install kernel headers and compile 3rd party modules like the r1soft cdp agent. This is a minimal image, so don’t forget basic filesystem utilities like mdadm if you’re installing the r1soft agent; I learned the hard way and had to re-work the image several times. I enabled auto-login on tty1 through tty3 by installing mingetty and modifying inittab. I also like to redirect syslog to tty4 and disable any console logging on tty1 – tty3.
When you think you’re done, clean up and exit the chroot.
rm -rf /tmp/*
umount -lf /proc
umount -lf /sys
umount -lf /dev/pts
Compress and package the new filesystem image.
mksquashfs chroot filesystem.squashfs -e boot
Send it off to your HTTP webserver:
scp filesystem.squashfs user@webserver:/var/www/html/debian-live/.
And a working pxelinux.cfg entry after we’ve got the kernel and initrd in the correct place on the tftp server:
APPEND initrd=/debian-live/debian-live-7.6.0-amd64-standard.initrd.img dhcp ethdevice=eth0,eth1 boot=live fetch=http://webserver/debian-live/filesystem.squashfs