Taylorbyte.com

Documentation Wiki

pxe-boot

PXE Boot with arch chroot

Setup DHCP for PXE boot

edit /etc/dhcpd.conf and add the following 2 lines to the end of subnet block

filename "pxelinux.0";
next-server 192.168.0.1;

/etc/rc.d/dhcp4 restart

Install tftp-hpa

Pacman install tftp-hpa

pacman -S tftp-hpa

Configure tftp to store its files in apropriate place. edit /etc/conf.d/tftpd

change from

TFTPD_ARGS="-l -s /var/tftpboot"

to

TFTPD_ARGS="-l -s /srv/tftp"

Add tftpd to DAEMONS line in rc.conf

DAEMONS=(... tftpd ...)

Setup tftp files

Create directories

mkdir /srv/tftp/
mkdir /srv/tftp/pxelinux.cfg
mkdir -p /srv/tftp/arch-installer/boot
mkdir /srv/tftp/debian-installer
mkdir -p /srv/tftp/arch/boot

Get pxelinux.0 and vesamenu.c32 files

pacman -S syslinux
cp /usr/lib/syslinux/pxelinux.0 /srv/tftp
cp /usr/lib/syslinux/vesamenu.c32 /srv/tftp

cat > /srv/tftp/pxelinux.cfg/default << EOF
TIMEOUT 300

DEFAULT vesamenu.c32

MENU TITLE Boot Menu

label arch
linux arch/boot/vmlinuz-linux
append vga=normal initrd=arch/boot/initramfs-linux.img rw root=/dev/nfs nfsroot=192.168.0.1:/srv/nfs/arch ip=dhcp quiet

label arch-installer
linux arch-installer/boot/vm64
append vga=normal initrd=arch-installer/boot/initrd64.img quiet

label debian-installer
kernel debian-installer/images/amd64/text/linux
append vga=normal initrd=debian-installer/images/amd64/text/initrd.gz quiet

label debian-installer-gtk
kernel debian-installer/images/amd64/gtk/linux
append vga=normal initrd=debian-installer/images/amd64/gtk/initrd.gz quiet
EOF

Create arch chroot

Install devtools, used to create roots.

pacman -S devtools

Create chroot

mkdir /srv/nfs
mkarchroot /srv/nfs/arch base base-devel sudo net-tools mkinitcpio-nfs-utils nfs-utils

edit /etc/exports

/srv/nfs/arch 192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash)

Restart nfs-server

/etc/rc.d/nfs-server restart

To install any extra packages to chroot

mount -t proc none /srv/nfs/arch/proc
mount -t sysfs none /srv/nfs/arch/sys
mount -o bind /dev /srv/nfs/arch/dev

chroot /srv/nfs/arch

In chroot edit /etc/mkinitcpio.conf

MODULES="nfs"
HOOKS="base udev net autodetect pata scsi sata filesystems"

In chroot create initramfs

mkinitcpio -p linux

In chroot install kde

pacman -S kde xorg

Back on host copy kernel to tftp folder

cp /srv/nfs/arch/boot/vmlinuz-linux /srv/tftp/arch/boot/
cp /srv/nfs/arch/boot/initramfs-linux.img /srv/tftp/arch/boot/

PXE Boot with Installer

Download isos

cd /srv/tftp/arch-installer/boot
wget http://ftp.iinet.net.au/pub/archlinux/iso/archboot/latest/boot/vm64
wget http://ftp.iinet.net.au/pub/archlinux/iso/archboot/latest/boot/vmlinuz
wget http://ftp.iinet.net.au/pub/archlinux/iso/archboot/latest/boot/initrd.img
wget http://ftp.iinet.net.au/pub/archlinux/iso/archboot/latest/boot/initrd64.img

cd /srv/tftp/debian-installer/boot
wget http://ftp.iinet.net.au/debian/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/linux
wget http://ftp.iinet.net.au/debian/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz
wget http://ftp.iinet.net.au/debian/debian/dists/squeeze/main/installer-i386/current/images/netboot/gtk/debian-installer/i386/linux -O linuxgtk
wget http://ftp.iinet.net.au/debian/debian/dists/squeeze/main/installer-i386/current/images/netboot/gtk/debian-installer/i386/initrd.gz -O initrdgtk.gz
wget http://ftp.iinet.net.au/debian/debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux -O linux64
wget http://ftp.iinet.net.au/debian/debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz -O initrd64.gz
wget http://ftp.iinet.net.au/debian/debian/dists/squeeze/main/installer-amd64/current/images/netboot/gtk/debian-installer/amd64/linux -O linux64gtk
wget http://ftp.iinet.net.au/debian/debian/dists/squeeze/main/installer-amd64/current/images/netboot/gtk/debian-installer/amd64/initrd.gz -O initrd64gtk.gz