Skip to content
/ pixie Public
forked from p3lim/pixie

PXE server with embedded TFTP, HTTP and iPXE ROMs

License

Notifications You must be signed in to change notification settings

zhong/pixie

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixie

TFTP and HTTP server specifically designed to serve iPXE ROMs and scripts.

pixie comes embedded with the following ROMs provided by the iPXE project:

  • undionly.kpxe - for legacy (BIOS) machines
  • ipxe.efi - for 64-bit EFI machines
  • ipxe32.efi - for 32-bit EFI machines

It comes with an embedded iPXE script, which is used to chainload into per-machine iPXE scripts or access an iPXE shell. It has no dependencies, everything is in one binary.

iPXE menu

Usage

Run the pixie binary using default ports, specifying path to store iPXE scripts:

pixie -d /srv/ipxe

Define iPXE script for a machine with the MAC-address 00:11:22:33:44:55:

cat >/srv/ipxe/00-11-22-33-44-55.ipxe <<EOF
#!ipxe
initrd http://dl.rockylinux.org/pub/rocky/8/BaseOS/x86_64/os/images/pxeboot/initrd.img
kernel http://dl.rockylinux.org/pub/rocky/8/BaseOS/x86_64/os/images/pxeboot/vmlinuz initrd=initrd.magic
boot
EOF

Configure pixie as the next-server on the DHCP server.
Example for ISC dhcpd:

option client-architecture code 93 = unsiged integer 16;
if exists user-class and option user-class = "iPXE" {
	filename "chain.ipxe";
} elsif option client-architecture = 00:00 {
	filename "undionly.kpxe";
} else {
	filename "ipxe.efi";
}
next-server 192.168.0.100;

Example for dnsmasq:

dhcp-match=set:ipxe,175
dhcp-vendorclass=BIOS,PXEClient:Arch:00000
dhcp-boot=tag:!ipxe,tag:BIOS,undionly.kpxe,pixie,192.168.0.100
dhcp-boot=tag:!ipxe,tag:!BIOS,ipxe.efi,pixie,192.168.0.100
dhcp-boot=tag:ipxe,chain.ipxe,pixie,192.168.0.100

In both these examples pixie runs on 192.168.0.100

When a machine with the MAC-address of 00:11:22:33:44:55 now attempts to PXE boot, the following will happen:

  1. The machine queries DHCP (standard procedure from PXE)
  2. The DHCP server will instruct the machine to download a new ROM from pixie (next-server) using TFTP
    • if the machine is running BIOS it will ask for undionly.kpxe
    • if the machine is running EFI it will ask for ipxe.efi
  3. The machine downloads and runs the iPXE ROM from pixie
  4. The machine queries DHCP again (this time from iPXE)
  5. The DHCP server will instruct the machine to download the chain.ipxe file from pixie using TFTP
  6. The machine downloads and runs the chain.ipxe script
  7. The machine chainloads into its iPXE script from pixie using HTTP
  8. The machine boots the operating system

See --help for more options.

About

PXE server with embedded TFTP, HTTP and iPXE ROMs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 98.8%
  • Dockerfile 1.2%