#!ipxe echo Running pxe.cfg script :start dhcp show version || show mac || show ip || show uuid || #show user-class || show manufacturer || show product || show serial || show buildarch || show platform || show syslog || # Figure out if client is 64-bit capable cpuid --ext 29 && set arch x64 || set arch x86 cpuid --ext 29 && set archl amd64 || set archl i386 echo Architecture: ${arch} ${archl} prompt Press any key to continue set base-server pxe.jsw.gen.nz set base-server-ip 10.0.2.25 set syslog ${base-server-ip} set pxe-server http://${base-server} set cifs-server //${base-server} set nfs-server ${base-server-ip}:/var/www/pxe :distsel menu Choose distro to boot item dist-clonezilla Clonezilla Live #item dist-ubuntu-18.04 Ubuntu 18.04 daily Live item dist-ubuntu-18.04.4 Ubuntu 18.04.4 item dist-xubuntu-20.04.1 Xubuntu 20.04.1 item dist-fedora-32 Fedora 32 Workstation item dist-fedora-33 Fedora 33 Workstation item dist-acronis-universal-restore Acronis Universal Restore 2020 item dist-windows-10 Windows 10 Installer (64-bit) item dist-netboot.xyz netboot.xyz (github) item dist-netboot.xyz.local netboot.xyz (local) item --gap item --gap -- ------------------------- Advanced options ------------------------------- item --key c config Configure settings item shell Drop to iPXE shell item reboot Reboot computer item poweroff Power off computer item item --key x exit Exit iPXE and continue BIOS boot choose distro || goto distsel echo Distro: ${distro} goto ${distro} || echo Distro "${distro}" not found sleep 5 goto distsel :cancel echo You cancelled the menu, dropping you to a shell :shell echo Type 'exit' to get the back to the menu shell goto start :reboot reboot --warm :poweroff poweroff :exit exit :config config goto start :dist-clonezilla echo At: dist-clonezilla iseq ${arch} x86 || goto sel-i386-1 echo CPU is x86, selecting Clonezilla Live i386 set base-url ${pxe-server}/clonezilla_i386 echo base-url: ${base-url} goto sel-i386-x :sel-i386-1 echo CPU is x64, selecting Clonezilla Live x64 set base-url ${pxe-server}/clonezilla echo base-url: ${base-url} :sel-i386-x echo -n Boot Clonezilla Live? (y/n) ${} && read answer iseq ${answer} Y && goto sel-bootx || iseq ${answer} y && goto sel-bootx || reboot :sel-bootx echo Booting Clonezilla Live kernel ${base-url}/live/vmlinuz vga=ask boot=live username=user union=overlay config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch=no net.ifnames=0 nosplash noprompt fetch=${base-url}/live/filesystem.squashfs || initrd ${base-url}/live/initrd.img || boot || goto failed :dist-ubuntu-18.04 echo At: dist-ubuntu-18.04 iseq ${arch} x86 || goto ubuntu-18.04-1 echo CPU is x86, no i386 version of Ubuntu 18.04 is available on PXE server, aborting goto failed :ubuntu-18.04-1 echo Booting Ubuntu-18.04-daily set base-url ${pxe-server}/bionic-desktop-amd64-daily-20180412/ubuntu-installer/amd64 initrd ${base-url}/initrd.gz kernel ${base-url}/linux tasks=standard vga=788 -- quiet boot || echo Should not have returned from boot command! goto failed :dist-ubuntu-18.04.4 echo At: dist-ubuntu-18.04.4 iseq ${arch} x86 || goto ubuntu-18.04.4-1 echo CPU is x86, no i386 version of Ubuntu 18.04.4 is available on PXE server, aborting goto failed :ubuntu-18.04.4-1 set isoname ubuntu-18.04.4-desktop-amd64 echo Booting ${isoname} set base-url ${pxe-server}/${isoname} set cifs-path ${cifs-server}/${isoname} set nfs-path ${nfs-server}/${isoname} kernel ${base-url}/casper/vmlinuz vmlinuz initrd=initrd nfsroot=${nfs-path} netboot=nfs boot=casper #kernel ${base-url}/casper/vmlinuz vmlinuz initrd=initrd toram netboot=cifs nfsroot=${cifs-path} nfsopts=-ouser=,password=,ro boot=live boot=casper initrd ${base-url}/casper/initrd boot || echo Should not have returned from boot command! goto failed :dist-xubuntu-20.04.1 echo At: dist-xubuntu-20.04.1 iseq ${arch} x86 || goto xubuntu-20.04.1-1 echo CPU is x86, no i386 version of Ubuntu 18.04.4 is available on PXE server, aborting goto failed :xubuntu-20.04.1-1 set isoname xubuntu-20.04.1-desktop-amd64 echo Booting ${isoname} set base-url ${pxe-server}/${isoname} set cifs-path ${cifs-server}/${isoname} set nfs-path ${nfs-server}/${isoname} kernel ${base-url}/casper/vmlinuz vmlinuz initrd=initrd nfsroot=${nfs-path} netboot=nfs boot=casper ip=dhcp #kernel ${base-url}/casper/vmlinuz vmlinuz initrd=initrd nfsroot=${base-url} netboot=nfs boot=live boot=casper systemd.mask=tmp.mount #kernel ${base-url}/casper/vmlinuz vmlinuz initrd=initrd toram netboot=cifs nfsroot=${cifs-path} nfsopts=-ouser=,password=,ro boot=live boot=casper initrd ${base-url}/casper/initrd boot || echo Should not have returned from boot command! goto failed :dist-fedora-32 echo Booting Fedora 32 Workstation Live set fedora-name Fedora-Workstation-Live-x86_64-32-1.6 set fedora-url ${pxe-server}/${fedora-name} set ipparam BOOTIF=${netX/mac} dhcp kernel ${fedora-url}/isolinux/vmlinuz ${ipparam} root=live:${fedora-url}/LiveOS/squashfs.img ro rd.live.image rd.lvm=0 rd.luks=0 rd.md=0 rd.dm=0 initrd=initrd initrd ${fedora-url}/isolinux/initrd.img boot #sanboot ${fedora-url}.iso || goto failed :dist-fedora-33 echo Booting Fedora 33 Workstation Live set fedora-name Fedora33 set fedora-url ${pxe-server}/${fedora-name} set ipparam BOOTIF=${netX/mac} dhcp kernel ${fedora-url}/vmlinuz ${ipparam} root=live:${fedora-url}/squashfs.img ro rd.live.image rd.lvm=0 rd.luks=0 rd.md=0 rd.dm=0 initrd=initrd initrd ${fedora-url}/initrd boot goto failed :dist-acronis-universal-restore echo Booting Acronis Universal Restore 2020 sanboot ${pxe-server}/acronis_universal_restore_2020.iso || goto failed :dist-windows-10 imgfree set win_base_url ${pxe-server}/Windows_10 set win_arch x64 kernel ${pxe-server}/netbootxyz/wimboot initrd -n bootmgr ${win_base_url}/${win_arch}/bootmgr bootmgr || initrd -n bootmgr.efi ${win_base_url}/${win_arch}/bootmgr.efi bootmgr.efi || initrd -n bcd ${win_base_url}/${win_arch}/boot/bcd bcd || initrd -n bcd ${win_base_url}/${win_arch}/Boot/BCD bcd || initrd -n boot.sdi ${win_base_url}/${win_arch}/boot/boot.sdi boot.sdi || initrd -n boot.sdi ${win_base_url}/${win_arch}/Boot/boot.sdi boot.sdi || initrd -n boot.wim ${win_base_url}/${win_arch}/sources/boot.wim boot.wim boot :dist-netboot.xyz chain --autofree http://boot.netboot.xyz || goto failed :dist-netboot.xyz.local chain --autofree ${pxe-server}/netbootxyz/menu.ipxe || goto failed :failed echo Boot failed - dropping to iPXE shell shell goto failed