commit 16e8ebf59f156b82764ae10c96c3671a4c74f527 Author: Alexandre CATTEAU Date: Fri Jul 29 10:42:54 2022 +0200 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..41538f9 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# PXE Server + +**NOTE: This an archive repository** + +This repository contains the required files and arborescence to host a PXE server via TFTP. Worked well with +Debian/Ubuntu (`tftpd-hpa`) and OpenBSD's native `tftpd`. + +### Files +`bios` and `efi64` directories are to be placed at TFTP server's root. `images` directories should be filled according +to Wiki (INSERT LINK). + +`dhcpd.conf` contains the specific directives you should add to your ISC DHCP server. diff --git a/bios/ldlinux.c32 b/bios/ldlinux.c32 new file mode 100755 index 0000000..0d8f2ef Binary files /dev/null and b/bios/ldlinux.c32 differ diff --git a/bios/libcom32.c32 b/bios/libcom32.c32 new file mode 100755 index 0000000..aedab33 Binary files /dev/null and b/bios/libcom32.c32 differ diff --git a/bios/libutil.c32 b/bios/libutil.c32 new file mode 100755 index 0000000..496fc30 Binary files /dev/null and b/bios/libutil.c32 differ diff --git a/bios/memdisk b/bios/memdisk new file mode 100644 index 0000000..3ada56c Binary files /dev/null and b/bios/memdisk differ diff --git a/bios/poweroff.c32 b/bios/poweroff.c32 new file mode 100755 index 0000000..eca2e48 Binary files /dev/null and b/bios/poweroff.c32 differ diff --git a/bios/pxechn.c32 b/bios/pxechn.c32 new file mode 100755 index 0000000..fdbda48 Binary files /dev/null and b/bios/pxechn.c32 differ diff --git a/bios/pxelinux.0 b/bios/pxelinux.0 new file mode 100644 index 0000000..61a3888 Binary files /dev/null and b/bios/pxelinux.0 differ diff --git a/bios/pxelinux.cfg/arch.conf b/bios/pxelinux.cfg/arch.conf new file mode 100644 index 0000000..f1cac31 --- /dev/null +++ b/bios/pxelinux.cfg/arch.conf @@ -0,0 +1,24 @@ +MENU TITLE **** KTO Network - BIOS PXE Arch Linux Menu **** + +LABEL local +MENU LABEL Arch Linux 2021-10-01 +LINUX images/archlinux/arch/boot/x86_64/vmlinuz-linux +INITRD images/archlinux/arch/boot/intel-ucode.img,images/archlinux/arch/boot/amd-ucode.img,images/archlinux/arch/boot/x86_64/initramfs-linux.img +APPEND archisobasedir=arch archiso_nfs_srv=192.168.0.54:/srv/tftp/bios/images/archlinux +SYSAPPEND 3 + +LABEL net +MENU LABEL Arch Linux Netboot +COM32 pxechn.c32 +APPEND images/archlinux/ipxe.pxe +TEXT HELP +This will download latest Arch release from the Internet. +THIS DOES NOT CURRENTLY WORK! +ENDTEXT + +MENU SEPARATOR + +LABEL back +MENU LABEL Back to main menu... +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/default diff --git a/bios/pxelinux.cfg/background.jpg b/bios/pxelinux.cfg/background.jpg new file mode 100644 index 0000000..fc8bc2b Binary files /dev/null and b/bios/pxelinux.cfg/background.jpg differ diff --git a/bios/pxelinux.cfg/debian.conf b/bios/pxelinux.cfg/debian.conf new file mode 100644 index 0000000..4fc4784 --- /dev/null +++ b/bios/pxelinux.cfg/debian.conf @@ -0,0 +1,28 @@ +MENU TITLE **** KTO Network - BIOS PXE Debian Menu **** + +LABEL standard +MENU LABEL Debian Standard Install +KERNEL images/debian-installer/amd64/linux +APPEND vga=788 initrd=images/debian-installer/amd64/initrd.gz + +LABEL expert +MENU LABEL Debian Expert Install +KERNEL images/debian-installer/amd64/linux +APPEND priority=low vga=788 initrd=images/debian-installer/amd64/initrd.gz --- + +LABEL rescue +MENU LABEL Debian Rescue Mode +KERNEL images/debian-installer/amd64/linux +APPEND vga=788 initrd=images/debian-installer/amd64/initrd.gz rescue/enable=true --- + +LABEL live-bullseye +MENU LABEL Debian 11 Live +KERNEL images/debian-bullseye-live/live/vmlinuz-5.10.0-8-amd64 +APPEND rootfstype=nfs netboot=nfs root=/dev/nfs ip=dhcp nfsroot=192.168.0.54:/srv/tftp/bios/images/debian-bullseye-live console-setup/layoutcode=fr initrd=images/debian-bullseye-live/live/initrd.img-5.10.0-8-amd64 + +MENU SEPARATOR + +LABEL back +MENU LABEL Back to main menu... +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/default diff --git a/bios/pxelinux.cfg/default b/bios/pxelinux.cfg/default new file mode 100644 index 0000000..341c6e0 --- /dev/null +++ b/bios/pxelinux.cfg/default @@ -0,0 +1,46 @@ +DEFAULT vesamenu.c32 pxelinux.cfg/graphics.conf ~ +PROMPT 0 +TIMEOUT 100 + +MENU TITLE **** KTO Network - BIOS PXE Menu **** + +MENU LABEL All below images are x86_64 only + +MENU SEPARATOR + +LABEL arch +MENU LABEL Arch Linux +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/arch.conf + +MENU SEPARATOR + +LABEL debian +MENU LABEL Debian +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/debian.conf + +MENU SEPARATOR + +LABEL ubuntu +MENU LABEL Ubuntu +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/ubuntu.conf + +MENU SEPARATOR + +LABEL localboot +MENU INDENT 2 +MENU LABEL Local Boot +MENU default +localboot 0 + +LABEL reboot +MENU INDENT 2 +MENU LABEL Reboot +kernel reboot.c32 + +LABEL shutdown +MENU INDENT 2 +MENU LABEL Shutdown +kernel poweroff.c32 diff --git a/bios/pxelinux.cfg/graphics.conf b/bios/pxelinux.cfg/graphics.conf new file mode 100644 index 0000000..678c6ef --- /dev/null +++ b/bios/pxelinux.cfg/graphics.conf @@ -0,0 +1,31 @@ +menu color screen * #90ffffff #00000000 * +menu color border * #ffff0000 #006F7072 * + +menu color title * #ffff0000 #006F7072 * + +menu color unsel * #ff818181 #00000000 * +menu color hotkey * #00000000 #00000000 * + +menu color sel * #ffff0000 #00ff0000 * +menu color hotsel * #e0ff0000 #200cd22d * + +menu color tabmsg * #ff727272 #00000000 * + +menu color cmdmark * #c0000000 #00000000 * +menu color cmdline * #c06F7072 #00000000 * + +menu color timeout_msg * #ff727272 #00000000 * +menu color timeout * #ffff0000 #00000000 * + +menu background pxelinux.cfg/background.jpg + +menu width 80 +menu margin 10 +menu passwordmargin 3 +menu rows 24 +menu tabmsgrow 20 +menu cmdlinerow 22 +# The following line sets at wich row will "Loading..." lines start (should thus be superior to rows) +menu endrow 24 +menu passwordrow 11 +menu timeoutrow 22 diff --git a/bios/pxelinux.cfg/ubuntu.conf b/bios/pxelinux.cfg/ubuntu.conf new file mode 100644 index 0000000..33a3c85 --- /dev/null +++ b/bios/pxelinux.cfg/ubuntu.conf @@ -0,0 +1,18 @@ +MENU TITLE **** KTO Network - BIOS PXE Ubuntu Menu **** + +LABEL live +MENU LABEL Lubuntu 18.04.1 LTS Live +KERNEL images/ubuntu-bionic-live/amd64/casper/vmlinuz +APPEND boot=casper rootfstype=nfs netboot=nfs nfsroot=192.168.0.54:/srv/tftp/bios/images/ubuntu-bionic-live/amd64 console-setup/layoutcode=fr splash systemd.mask=tmp.mount initrd=images/ubuntu-bionic-live/amd64/casper/initrd.lz -- + +LABEL live-hirsute +MENU LABEL Ubuntu 21.04 Live +KERNEL images/ubuntu-hirsute-live/amd64/casper/vmlinuz +APPEND boot=casper rootfstype=nfs netboot=nfs ip=dhcp nfsroot=192.168.0.54:/srv/tftp/bios/images/ubuntu-hirsute-live/amd64 console-setup/layoutcode=fr systemd.mask=tmp.mount initrd=images/ubuntu-hirsute-live/amd64/casper/initrd -- + +MENU SEPARATOR + +LABEL back +MENU LABEL Back to main menu... +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/default diff --git a/bios/reboot.c32 b/bios/reboot.c32 new file mode 100755 index 0000000..969244e Binary files /dev/null and b/bios/reboot.c32 differ diff --git a/bios/vesamenu.c32 b/bios/vesamenu.c32 new file mode 100755 index 0000000..f3f45fb Binary files /dev/null and b/bios/vesamenu.c32 differ diff --git a/dhcpd.conf b/dhcpd.conf new file mode 100644 index 0000000..69c4466 --- /dev/null +++ b/dhcpd.conf @@ -0,0 +1,23 @@ +# directives needed in ISC's dhcpd.conf + +... + +option arch code 93 = unsigned integer 16; + +allow booting; +allow bootp; + +subnet { + ... + # following line: 00:06 = efi32 ; 00:07 = efi64 + if option arch = 00:07 { + filename "efi64/syslinux.efi"; + } else { + filename "bios/pxelinux.0"; + #filename "bios/images/archlinux/ipxe.pxe"; + } + next-server ; + ... +} + +... diff --git a/efi64/bootnetx64.efi b/efi64/bootnetx64.efi new file mode 100644 index 0000000..04268b2 Binary files /dev/null and b/efi64/bootnetx64.efi differ diff --git a/efi64/bootx64.efi b/efi64/bootx64.efi new file mode 100644 index 0000000..9943e7a Binary files /dev/null and b/efi64/bootx64.efi differ diff --git a/efi64/grubnetx64.efi.signed b/efi64/grubnetx64.efi.signed new file mode 100644 index 0000000..cbe05bc Binary files /dev/null and b/efi64/grubnetx64.efi.signed differ diff --git a/efi64/ldlinux.e64 b/efi64/ldlinux.e64 new file mode 100755 index 0000000..2dfa66e Binary files /dev/null and b/efi64/ldlinux.e64 differ diff --git a/efi64/libcom32.c32 b/efi64/libcom32.c32 new file mode 100755 index 0000000..1c5c969 Binary files /dev/null and b/efi64/libcom32.c32 differ diff --git a/efi64/libutil.c32 b/efi64/libutil.c32 new file mode 100755 index 0000000..89b5058 Binary files /dev/null and b/efi64/libutil.c32 differ diff --git a/efi64/memdisk b/efi64/memdisk new file mode 100644 index 0000000..3ada56c Binary files /dev/null and b/efi64/memdisk differ diff --git a/efi64/poweroff.c32 b/efi64/poweroff.c32 new file mode 100755 index 0000000..c8e7e87 Binary files /dev/null and b/efi64/poweroff.c32 differ diff --git a/efi64/pxechn.c32 b/efi64/pxechn.c32 new file mode 100755 index 0000000..6573a46 Binary files /dev/null and b/efi64/pxechn.c32 differ diff --git a/efi64/pxelinux.cfg/arch.conf b/efi64/pxelinux.cfg/arch.conf new file mode 100644 index 0000000..d221208 --- /dev/null +++ b/efi64/pxelinux.cfg/arch.conf @@ -0,0 +1,24 @@ +MENU TITLE **** KTO Network - UEFI PXE Arch Linux Menu **** + +LABEL local +MENU LABEL Arch Linux 2021-10-01 +LINUX images/archlinux/arch/boot/x86_64/vmlinuz-linux +INITRD images/archlinux/arch/boot/intel-ucode.img,images/archlinux/arch/boot/amd-ucode.img,images/archlinux/arch/boot/x86_64/initramfs-linux.img +APPEND archisobasedir=arch archiso_nfs_srv=192.168.0.54:/srv/tftp/efi64/images/archlinux +SYSAPPEND 3 + +LABEL net +MENU LABEL Arch Linux Netboot +COM32 pxechn.c32 +APPEND images/archlinux/ipxe.efi +TEXT HELP +This will download latest Arch release from the Internet. +THIS DOES NOT CURRENTLY WORK! +ENDTEXT + +MENU SEPARATOR + +LABEL back +MENU LABEL Back to main menu... +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/default diff --git a/efi64/pxelinux.cfg/debian.conf b/efi64/pxelinux.cfg/debian.conf new file mode 100644 index 0000000..75453d1 --- /dev/null +++ b/efi64/pxelinux.cfg/debian.conf @@ -0,0 +1,23 @@ +MENU TITLE **** KTO Network - UEFI PXE Debian Menu **** + +LABEL standard +MENU LABEL Debian Standard Install +KERNEL images/debian-installer/amd64/linux +APPEND vga=788 initrd=images/debian-installer/amd64/initrd.gz + +LABEL expert +MENU LABEL Debian Expert Install +KERNEL images/debian-installer/amd64/linux +APPEND priority=low vga=788 initrd=images/debian-installer/amd64/initrd.gz --- + +LABEL rescue +MENU LABEL Debian Rescue Mode +KERNEL images/debian-installer/amd64/linux +APPEND vga=788 initrd=images/debian-installer/amd64/initrd.gz rescue/enable=true --- + +MENU SEPARATOR + +LABEL back +MENU LABEL Back to main menu... +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/default diff --git a/efi64/pxelinux.cfg/default b/efi64/pxelinux.cfg/default new file mode 100644 index 0000000..b399642 --- /dev/null +++ b/efi64/pxelinux.cfg/default @@ -0,0 +1,46 @@ +DEFAULT vesamenu.c32 pxelinux.cfg/graphics.conf ~ +PROMPT 0 +#TIMEOUT 100 + +MENU TITLE **** KTO Network - UEFI PXE Menu **** + +MENU LABEL All below images are x86_64 only + +MENU SEPARATOR + +LABEL arch +MENU LABEL Arch Linux +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/arch.conf + +MENU SEPARATOR + +LABEL debian +MENU LABEL Debian +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/debian.conf + +MENU SEPARATOR + +LABEL ubuntu +MENU LABEL Ubuntu +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/ubuntu.conf + +MENU SEPARATOR + +LABEL localboot +MENU INDENT 2 +MENU LABEL Local Boot +MENU default +localboot 0 + +LABEL reboot +MENU INDENT 2 +MENU LABEL Reboot +kernel reboot.c32 + +LABEL shutdown +MENU INDENT 2 +MENU LABEL Shutdown +kernel poweroff.c32 diff --git a/efi64/pxelinux.cfg/graphics.conf b/efi64/pxelinux.cfg/graphics.conf new file mode 100644 index 0000000..678c6ef --- /dev/null +++ b/efi64/pxelinux.cfg/graphics.conf @@ -0,0 +1,31 @@ +menu color screen * #90ffffff #00000000 * +menu color border * #ffff0000 #006F7072 * + +menu color title * #ffff0000 #006F7072 * + +menu color unsel * #ff818181 #00000000 * +menu color hotkey * #00000000 #00000000 * + +menu color sel * #ffff0000 #00ff0000 * +menu color hotsel * #e0ff0000 #200cd22d * + +menu color tabmsg * #ff727272 #00000000 * + +menu color cmdmark * #c0000000 #00000000 * +menu color cmdline * #c06F7072 #00000000 * + +menu color timeout_msg * #ff727272 #00000000 * +menu color timeout * #ffff0000 #00000000 * + +menu background pxelinux.cfg/background.jpg + +menu width 80 +menu margin 10 +menu passwordmargin 3 +menu rows 24 +menu tabmsgrow 20 +menu cmdlinerow 22 +# The following line sets at wich row will "Loading..." lines start (should thus be superior to rows) +menu endrow 24 +menu passwordrow 11 +menu timeoutrow 22 diff --git a/efi64/pxelinux.cfg/ubuntu.conf b/efi64/pxelinux.cfg/ubuntu.conf new file mode 100644 index 0000000..1ba85a4 --- /dev/null +++ b/efi64/pxelinux.cfg/ubuntu.conf @@ -0,0 +1,13 @@ +MENU TITLE **** KTO Network - UEFI PXE Ubuntu Menu **** + +LABEL live +MENU LABEL Lubuntu 18.04.1 LTS Live +KERNEL images/ubuntu-bionic-live/amd64/casper/vmlinuz +APPEND boot=casper rootfstype=nfs netboot=nfs nfsroot=192.168.0.54:/srv/tftp/bios/images/ubuntu-bionic-live/amd64 console-setup/layoutcode=fr splash systemd.mask=tmp.mount initrd=images/ubuntu-bionic-live/amd64/casper/initrd.lz -- + +MENU SEPARATOR + +LABEL back +MENU LABEL Back to main menu... +KERNEL vesamenu.c32 pxelinux.cfg/graphics.conf +APPEND pxelinux.cfg/default diff --git a/efi64/reboot.c32 b/efi64/reboot.c32 new file mode 100755 index 0000000..1b4b0dc Binary files /dev/null and b/efi64/reboot.c32 differ diff --git a/efi64/syslinux.efi b/efi64/syslinux.efi new file mode 100644 index 0000000..b1ba9c3 Binary files /dev/null and b/efi64/syslinux.efi differ diff --git a/efi64/vesamenu.c32 b/efi64/vesamenu.c32 new file mode 100755 index 0000000..5e7743e Binary files /dev/null and b/efi64/vesamenu.c32 differ