瀏覽代碼

Merge remote-tracking branch 'development-repo/development' into development

Antony Messerli 5 年之前
父節點
當前提交
7c0dda0cb3
共有 94 個文件被更改,包括 4643 次插入97 次删除
  1. 150 22
      .travis.yml
  2. 32 0
      Dockerfile-build
  3. 27 75
      README.md
  4. 20 0
      docker-build-root/dumper.sh
  5. 528 0
      endpoints.yml
  6. 24 0
      etc/netbootxyz/custom/README.md
  7. 36 0
      etc/netbootxyz/custom/custom.ipxe.j2
  8. 1 0
      inventory
  9. 39 0
      roles/netbootxyz/README.md
  10. 440 0
      roles/netbootxyz/defaults/main.yml
  11. 28 0
      roles/netbootxyz/files/ipxe/local/colour.h
  12. 1 0
      roles/netbootxyz/files/ipxe/local/crypto.h
  13. 11 0
      roles/netbootxyz/files/ipxe/local/general.h
  14. 10 0
      roles/netbootxyz/files/ipxe/local/general.h.efi
  15. 4 0
      roles/netbootxyz/files/ipxe/local/nap.h.efi
  16. 2 0
      roles/netbootxyz/files/ipxe/local/usb.h.efi
  17. 二進制
      roles/netbootxyz/files/memdisk
  18. 二進制
      roles/netbootxyz/files/wimboot
  19. 15 0
      roles/netbootxyz/meta/main.yml
  20. 26 0
      roles/netbootxyz/tasks/generate_checksums.yml
  21. 11 0
      roles/netbootxyz/tasks/generate_disks.yml
  22. 0 0
      roles/netbootxyz/tasks/generate_disks_arm.yml
  23. 78 0
      roles/netbootxyz/tasks/generate_disks_base.yml
  24. 70 0
      roles/netbootxyz/tasks/generate_disks_efi.yml
  25. 47 0
      roles/netbootxyz/tasks/generate_disks_legacy.yml
  26. 34 0
      roles/netbootxyz/tasks/generate_menus.yml
  27. 18 0
      roles/netbootxyz/tasks/generate_menus_custom.yml
  28. 24 0
      roles/netbootxyz/tasks/generate_signatures.yml
  29. 28 0
      roles/netbootxyz/tasks/main.yml
  30. 6 0
      roles/netbootxyz/templates/checksums.txt.j2
  31. 68 0
      roles/netbootxyz/templates/disks/netboot.xyz-gce.j2
  32. 69 0
      roles/netbootxyz/templates/disks/netboot.xyz-packet.j2
  33. 82 0
      roles/netbootxyz/templates/disks/netboot.xyz.j2
  34. 19 0
      roles/netbootxyz/templates/index.html.j2
  35. 46 0
      roles/netbootxyz/templates/menu/alpinelinux.ipxe.j2
  36. 55 0
      roles/netbootxyz/templates/menu/archlinux.ipxe.j2
  37. 27 0
      roles/netbootxyz/templates/menu/blackarch.ipxe.j2
  38. 108 0
      roles/netbootxyz/templates/menu/boot.cfg.j2
  39. 41 0
      roles/netbootxyz/templates/menu/bsd.ipxe.j2
  40. 83 0
      roles/netbootxyz/templates/menu/centos.ipxe.j2
  41. 47 0
      roles/netbootxyz/templates/menu/coreos.ipxe.j2
  42. 99 0
      roles/netbootxyz/templates/menu/debian.ipxe.j2
  43. 86 0
      roles/netbootxyz/templates/menu/devuan.ipxe.j2
  44. 83 0
      roles/netbootxyz/templates/menu/fedora.ipxe.j2
  45. 45 0
      roles/netbootxyz/templates/menu/flatcar.ipxe.j2
  46. 47 0
      roles/netbootxyz/templates/menu/freebsd.ipxe.j2
  47. 25 0
      roles/netbootxyz/templates/menu/freedos.ipxe.j2
  48. 32 0
      roles/netbootxyz/templates/menu/gentoo.ipxe.j2
  49. 40 0
      roles/netbootxyz/templates/menu/ipfire.ipxe.j2
  50. 40 0
      roles/netbootxyz/templates/menu/kali.ipxe.j2
  51. 30 0
      roles/netbootxyz/templates/menu/linux.ipxe.j2
  52. 37 0
      roles/netbootxyz/templates/menu/live-backbox.ipxe.j2
  53. 59 0
      roles/netbootxyz/templates/menu/live-debian.ipxe.j2
  54. 36 0
      roles/netbootxyz/templates/menu/live-elementary.ipxe.j2
  55. 49 0
      roles/netbootxyz/templates/menu/live-fedora.ipxe.j2
  56. 52 0
      roles/netbootxyz/templates/menu/live-kali.ipxe.j2
  57. 44 0
      roles/netbootxyz/templates/menu/live-manjaro.ipxe.j2
  58. 52 0
      roles/netbootxyz/templates/menu/live-mint.ipxe.j2
  59. 37 0
      roles/netbootxyz/templates/menu/live-peppermint.ipxe.j2
  60. 44 0
      roles/netbootxyz/templates/menu/live-popos.ipxe.j2
  61. 52 0
      roles/netbootxyz/templates/menu/live-q4os.ipxe.j2
  62. 37 0
      roles/netbootxyz/templates/menu/live-tails.ipxe.j2
  63. 67 0
      roles/netbootxyz/templates/menu/live-ubuntu.ipxe.j2
  64. 41 0
      roles/netbootxyz/templates/menu/live-voyager.ipxe.j2
  65. 52 0
      roles/netbootxyz/templates/menu/live-zorin.ipxe.j2
  66. 38 0
      roles/netbootxyz/templates/menu/live.ipxe.j2
  67. 44 0
      roles/netbootxyz/templates/menu/mageia.ipxe.j2
  68. 116 0
      roles/netbootxyz/templates/menu/menu.ipxe.j2
  69. 21 0
      roles/netbootxyz/templates/menu/nixos.ipxe.j2
  70. 33 0
      roles/netbootxyz/templates/menu/openbsd.ipxe.j2
  71. 89 0
      roles/netbootxyz/templates/menu/opensuse.ipxe.j2
  72. 27 0
      roles/netbootxyz/templates/menu/parrotsec.ipxe.j2
  73. 31 0
      roles/netbootxyz/templates/menu/rancheros.ipxe.j2
  74. 52 0
      roles/netbootxyz/templates/menu/rhel.ipxe.j2
  75. 59 0
      roles/netbootxyz/templates/menu/scientific.ipxe.j2
  76. 29 0
      roles/netbootxyz/templates/menu/security.ipxe.j2
  77. 31 0
      roles/netbootxyz/templates/menu/slackware.ipxe.j2
  78. 24 0
      roles/netbootxyz/templates/menu/tinycore.ipxe.j2
  79. 83 0
      roles/netbootxyz/templates/menu/ubuntu.ipxe.j2
  80. 90 0
      roles/netbootxyz/templates/menu/utils-efi.ipxe.j2
  81. 90 0
      roles/netbootxyz/templates/menu/utils-pcbios.ipxe.j2
  82. 59 0
      roles/netbootxyz/templates/menu/windows.ipxe.j2
  83. 1 0
      roles/netbootxyz/tests/inventory
  84. 5 0
      roles/netbootxyz/tests/test.yml
  85. 14 0
      roles/netbootxyz/vars/debian.yml
  86. 1 0
      roles/netbootxyz/vars/main.yml
  87. 10 0
      roles/netbootxyz/vars/redhat.yml
  88. 14 0
      roles/netbootxyz/vars/ubuntu.yml
  89. 56 0
      script/build_release
  90. 41 0
      script/message
  91. 4 0
      script/pre_install
  92. 8 0
      site.yml
  93. 31 0
      user_overrides.yml
  94. 1 0
      version.txt

+ 150 - 22
.travis.yml

@@ -1,23 +1,151 @@
 sudo: true
-dist: xenial
-language: c
-before_install:
-- openssl aes-256-cbc -K $encrypted_7d306b01dc1f_key -iv $encrypted_7d306b01dc1f_iv -in script/secrets.tar.enc -out script/secrets.tar -d
-- tar xvf script/secrets.tar -C script/
-- sudo apt-get update -qq
-- sudo apt-get install -qq binutils-dev binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu genisoimage liblzma-dev syslinux syslinux-common isolinux
-- sudo pip install awscli tornado
-script:
-- "./script/prep-release.sh"
-deploy:
-  - provider: s3
-    access_key_id: $AWS_ACCESS_KEY_ID
-    secret_access_key: $AWS_SECRET_ACCESS_KEY
-    bucket: $BUCKET_BOOT 
-    local_dir: build
-    skip_cleanup: true
-    on:
-      repo: antonym/netboot.xyz
-after_deploy:
-  - aws configure set preview.cloudfront true
-  - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DIST_ID_BOOT --paths "/*"
+
+language: bash
+
+services:
+  - docker
+
+env:
+  global:
+    - DEBIAN_FRONTEND="noninteractive"
+
+jobs:
+  include:
+    - stage: development
+      if: branch = development AND type != pull_request
+      script:
+        - ./script/build_release dev
+      after_failure:
+        - ./script/message failure
+      deploy:
+        - provider: s3
+          edge: true
+          access_key_id: $AWS_ACCESS_KEY_ID
+          secret_access_key: $AWS_SECRET_ACCESS_KEY
+          bucket: $BUCKET_DEV
+          local_dir: s3out
+          upload-dir: $TRAVIS_COMMIT
+          skip_cleanup: true
+          on:
+            branch: development
+      after_deploy:
+        - ./script/message dev-push
+
+
+    - stage: pull-request
+      if: type = pull_request
+      script:
+        - ./script/build_release pr
+
+
+    - stage: release-candidate
+      if: branch = RC AND type != pull_request
+      before_install:
+        - ./script/pre_install
+      script:
+        - ./script/build_release rc
+      workspaces:
+        create:
+          name: githubassets
+          paths:
+            - githubout 
+      after_failure:
+        - ./script/message failure
+      deploy:
+        - provider: s3
+          edge: true
+          access_key_id: $AWS_ACCESS_KEY_ID
+          secret_access_key: $AWS_SECRET_ACCESS_KEY
+          bucket: $BUCKET_LIVE
+          local_dir: s3out-latest
+          upload-dir: rc
+          skip_cleanup: true
+          on:
+            branch: RC
+        - provider: s3
+          edge: true
+          access_key_id: $AWS_ACCESS_KEY_ID
+          secret_access_key: $AWS_SECRET_ACCESS_KEY
+          bucket: $BUCKET_LIVE
+          local_dir: s3out
+          upload-dir: $RELEASE_TAG
+          skip_cleanup: true
+          on:
+            branch: RC
+    - stage: rc-github
+      if: branch = RC AND type != pull_request
+      before_install:
+        - ./script/pre_install
+      workspaces:
+        use: githubassets
+      script: skip
+      before_deploy:
+        - export RELEASE_TAG=$(cat version.txt)-RC
+        - git tag ${RELEASE_TAG}
+      deploy:
+        - provider: releases
+          api_key: $GITHUB_TOKEN
+          file_glob: true
+          file: githubout/*
+          prerelease: true
+          skip_cleanup: true
+          on:
+            branch: RC
+      after_deploy:
+        - aws configure set preview.cloudfront true
+        - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DIST_ID_BOOT --paths "rc/*" "rc/ipxe/*"
+        - ./script/message rc-push
+
+    - stage: release
+      if: branch = master AND type != pull_request
+      script:
+        - ./script/build_release release
+      workspaces:
+        create:
+          name: githubassets
+          paths:
+            - githubout 
+      after_failure:
+        - ./script/message failure
+      deploy:
+        - provider: s3
+          edge: true
+          access_key_id: $AWS_ACCESS_KEY_ID
+          secret_access_key: $AWS_SECRET_ACCESS_KEY
+          bucket: $BUCKET_LIVE
+          local_dir: s3out-latest
+          skip_cleanup: true
+          on:
+            branch: master
+        - provider: s3
+          edge: true
+          access_key_id: $AWS_ACCESS_KEY_ID
+          secret_access_key: $AWS_SECRET_ACCESS_KEY
+          bucket: $BUCKET_LIVE
+          local_dir: s3out
+          upload-dir: $RELEASE_TAG
+          skip_cleanup: true
+          on:
+            branch: master
+    - stage: release-github
+      if: branch = master AND type != pull_request
+      before_install:
+        - ./script/pre_install
+      workspaces:
+        use: githubassets
+      script: skip
+      before_deploy:
+        - export RELEASE_TAG=$(cat version.txt)
+        - git tag ${RELEASE_TAG}
+      deploy:
+        - provider: releases
+          api_key: $GITHUB_TOKEN
+          file_glob: true
+          file: githubout/*
+          skip_cleanup: true
+          on:
+            branch: master
+      after_deploy:
+        - aws configure set preview.cloudfront true
+        - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DIST_ID_BOOT --paths "/*" "/ipxe/*"
+        - ./script/message live-push

+ 32 - 0
Dockerfile-build

@@ -0,0 +1,32 @@
+FROM ubuntu:bionic as builder
+
+RUN \
+ echo "**** install deps ****" && \
+ apt-get update && \
+ apt-get install -y \
+	ansible \
+	apache2  \
+	build-essential \
+        dosfstools \
+	genisoimage \
+	git \
+	liblzma-dev \
+	python-minimal \
+	python-yaml \
+	syslinux
+
+# repo for build
+COPY . /ansible
+
+RUN \
+ echo "**** running ansible ****" && \
+ cd /ansible && \
+ ansible-playbook -i inventory site.yml
+
+# runtime stage
+FROM alpine:3.10
+
+COPY --from=builder /var/www/html/ /mnt/
+COPY docker-build-root/ /
+
+ENTRYPOINT [ "/dumper.sh" ]

+ 27 - 75
README.md

@@ -1,95 +1,47 @@
-## netboot.xyz
+## netboot.xyz - v2 - Under Construction
 
-[![Build Status](https://travis-ci.org/antonym/netboot.xyz.svg?branch=master)](https://travis-ci.org/antonym/netboot.xyz)
-[![Discord](https://img.shields.io/discord/425186187368595466)](https://discord.gg/An6PA2a)
+** THIS IS A WORK IN PROGRESS, DO NOT USE **
 
-![netboot.xyz menu](https://netboot.xyz/images/netboot.xyz.gif)
+** Templates are incomplete and still being worked ** 
 
-### Bootloader Downloads
+netboot.xyz rewritten in ansible to generate standalone netboot environments.
 
-These iPXE disks will automatically load into [boot.netboot.xyz](https://boot.netboot.xyz):
+The goal is to use this to generate the primary netboot.xyz site 
+but at the same time allow it to be customizable for any type of environment or user.
 
-| Type | Bootloader | Description |
-|------|------------|-------------|
-|ISO (Legacy)| [netboot.xyz.iso](https://boot.netboot.xyz/ipxe/netboot.xyz.iso)| Used for CD/DVD, Virtual CDs like DRAC/iLO, VMware, Virtual Box (Legacy) |
-|ISO (EFI)|[netboot.xyz-efi.iso](https://boot.netboot.xyz/ipxe/netboot.xyz-efi.iso)| Same as ISO (Legacy) but used for EFI BIOS, works in Virtual Box EFI mode |
-|Floppy| [netboot.xyz.dsk](https://boot.netboot.xyz/ipxe/netboot.xyz.dsk)| Used for 1.44 MB floppies, Virtual floppies like DRAC/iLO, VMware, Virtual Box|
-|USB| [netboot.xyz.usb](https://boot.netboot.xyz/ipxe/netboot.xyz.usb)| Used for creation of USB Keys|
-|Kernel| [netboot.xyz.lkrn](https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn)| Used for booting from GRUB/EXTLINUX|
-|DHCP| [netboot.xyz.kpxe](https://boot.netboot.xyz/ipxe/netboot.xyz.kpxe)| DHCP boot image file, uses built-in iPXE NIC drivers|
-|DHCP-undionly| [netboot.xyz-undionly.kpxe](https://boot.netboot.xyz/ipxe/netboot.xyz-undionly.kpxe)| DHCP boot image file, use if you have NIC issues|
-|EFI| [netboot.xyz.efi](https://boot.netboot.xyz/ipxe/netboot.xyz.efi)| EFI boot image file|
+The source files are now templates in order to make things a bit easier to generate.
 
-SHA256 checksums are generated during each build of iPXE and are located [here](https://boot.netboot.xyz/ipxe/netboot.xyz-sha256-checksums.txt).  You can also view the scripts that are embedded into the images [here](https://github.com/antonym/netboot.xyz/tree/master/ipxe/disks).
+This is a seperate repo for now but will more than likely roll into the existing repo.
 
-### What is netboot.xyz?
+# Building locally
 
-[netboot.xyz](http://www.netboot.xyz) is a convenient place to boot into any type of operating system or utility disk without the need of having to go spend time retrieving the ISO just to run it.  [iPXE](http://ipxe.org/) is used to provide a user friendly menu from within the BIOS that lets you easily choose the operating system you want along with any specific types of versions or bootable flags.
+## With Ansible
 
-If you already have iPXE up and running on the network, you can hit netboot.xyz at anytime by typing:
+To generate, run:
 
-    chain --autofree https://boot.netboot.xyz
+```
+ansible-playbook -i inventory site.yml
+```
 
-You'll need to make sure to have [DOWNLOAD_PROTO_HTTPS](https://github.com/ipxe/ipxe/blob/master/src/config/general.h#L56) enabled in iPXE.
+The build output will be located in /var/www/html on Debian OSs.
 
-### Documentation
+## With Docker
 
-See [netboot.xyz](https://netboot.xyz) for all documentation.  Some links to get started with are:
+```
+docker build -t localbuild -f Dockerfile-build .
+docker run --rm -it -v $(pwd):/buildout localbuild
+```
 
-* [Downloads](https://netboot.xyz/downloads/)
-* [Booting Methods](https://netboot.xyz/booting/)
-* [FAQ](https://netboot.xyz/faq/)
+The build output will be in the generated folder `buildout`
 
-If you'd like to contribute to the documentation, the netboot.xyz documenation is located at [netboot.xyz-docs](https://github.com/antonym/netboot.xyz-docs).
+## Local Overides
 
-### What Operating Systems are available?
+Ansible will handle source generation as well as ipxe disk generation with your settings.  The disk generation was worked on a while back so it needs work to catch it up to the existing state of netboot.xyz.
 
-* [Alpine Linux](https://alpinelinux.org)
-* [Arch Linux](https://www.archlinux.org)
-* [CentOS](https://centos.org)
-* [Debian](https://debian.org)
-* [Devuan](https://devuan.org)
-* [Fedora](https://fedoraproject.org)
-* [Flatcar Linux](https://www.flatcar-linux.org)
-* [FreeBSD](https://freebsd.org)
-* [FreeDOS](http://www.freedos.org)
-* [Gentoo](https://gentoo.org)
-* [IPFire](https://www.ipfire.org)
-* [Mageia](http://www.mageia.org)
-* [Microsoft Windows](https://www.microsoft.com)
-* [MirOS](https://www.mirbsd.org)
-* [NixOS](https://nixos.org)
-* [OpenBSD](http://openbsd.org)
-* [OpenSUSE](http://opensuse.org)
-* [RancherOS](http://rancher.com/rancher-os/)
-* [Red Hat Enterprise Linux](https://www.redhat.com/)
-* [Scientific Linux](http://scientificlinux.org)
-* [Tiny Core Linux](http://tinycorelinux.net)
-* [Ubuntu](http://www.ubuntu.com/)
+If you want to override the defaults, you can put overrides in user_overrides.yml.  See file for examples.
 
-#### Security Related
+Also note many user customizations are located in the boot.cfg file for the IPXE menus. A high level of customization can be achieved using our stock build output and hosting this along with the menus locally. 
 
-* [BlackArch Linux](https://blackarch.org)
-* [Kali Linux](https://www.kali.org)
-* [Parrot Security](https://www.parrotsec.org)
+## Self Hosted Custom Options
 
-#### Utilities
-
-* [AVG Rescue CD](https://www.avg.com/en-ww/download.prd-arl.)
-* [Breakin](http://www.advancedclustering.com/products/software/breakin/)
-* [Clonezilla](http://www.clonezilla.org/)
-* [DBAN](http://www.dban.org/)
-* [GParted](http://gparted.org)
-* [Grml](http://grml.org)
-* [Memtest](http://www.memtest.org/)
-* [Super Grub2 Disk](http://www.supergrubdisk.org)
-* [SystemRescueCD](https://www.system-rescue-cd.org)
-* [Ultimate Boot CD](http://www.ultimatebootcd.com)
-
-### Testing New Branches
-
-Under the **Utilities** menu on netboot.xyz, there's an option for ["Test netboot.xyz branch"](https://github.com/antonym/netboot.xyz/blob/master/src/utils.ipxe#L157).  If you've forked the code and have developed a new feature branch, you can use this option to chainload into that branch to test and validate the code.  All you need to do is specify your Github user name and the name of your branch or abbreviated hash of the commit. Also, disable the signature verification for *netboot.xyz* under **Signatures Checks**.
-
-### Feedback
-
-Feel free to open up an [issue](https://github.com/antonym/netboot.xyz/issues) on Github, swing by [Freenode IRC](http://freenode.net/) in the [#netbootxyz](http://webchat.freenode.net/?channels=#netbootxyz) channel, or ping us on [Discord](https://discord.gg/An6PA2a).  Follow us on [Twitter](https://twitter.com/netbootxyz) or like us on [Facebook](https://www.facebook.com/netboot.xyz)!
+In addition to being able to host netboot.xyz locally, you can also create your own custom templates for custom menus within netboot.xyz.  Please see [Custom User Menus](etc/netbootxyz/custom/README.md) for more information.

+ 20 - 0
docker-build-root/dumper.sh

@@ -0,0 +1,20 @@
+#! /bin/sh
+
+# check for dump dir
+if [ -d /buildout ]; then
+  # if there are no files in that directory use 777 perms as root
+  if [ `find /buildout -prune -empty 2>/dev/null` ]; then
+    /bin/mkdir -p /buildout/buildout
+    /bin/cp -r /mnt/* /buildout/buildout/
+    /bin/chmod 777 -R /buildout/buildout
+  # match the ownership of the first file we see
+  else
+    PERMS=`/usr/bin/find /buildout/* -print -quit |xargs stat -c "%u:%g"`
+    /bin/mkdir -p /buildout/buildout
+    /bin/cp -r /mnt/* /buildout/buildout/
+    /bin/chown $PERMS -R /buildout/buildout
+  fi
+else
+  /bin/echo "/buildout not found exiting"  
+  exit 1
+fi  

+ 528 - 0
endpoints.yml

@@ -0,0 +1,528 @@
+endpoints:
+  ubuntu-19.10-live-kernel:
+    path: /ubuntu-core-19.10/releases/download/5.3.0.18.21-aa695b8a/
+    files:
+    - initrd
+    - vmlinuz
+    os: ubuntu
+    version: '19.10'
+  ubuntu-18.04-live-kernel:
+    path: /ubuntu-core-18.04/releases/download/4.15.0.20.23-91c3d317/
+    files:
+    - initrd
+    - vmlinuz
+    os: ubuntu
+    version: '18.04'
+  ubuntu-18.04-default-squash:
+    path: /ubuntu-squash/releases/download/18.04.3-9e60a38f/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '18.04'
+    flavor: Unity
+    kernel: ubuntu-18.04-live-kernel
+  debian-10-live-kernel:
+    path: /debian-core-10/releases/download/4.19.67-2+deb10u1-4acbfed0/
+    files:
+    - initrd
+    - vmlinuz
+    os: debian
+    version: '10'
+  debian-9-live-kernel:
+    path: /debian-core-9/releases/download/4.9.189-3-44deb8e4/
+    files:
+    - initrd
+    - vmlinuz
+    os: debian
+    version: 9
+  manjaro-18.x-live-kernel:
+    path: /manjaro-core-18.x/releases/download/5.3.8-25c643fa/
+    files:
+    - initrd
+    - vmlinuz
+    os: manjaro
+    version: 18.x
+  debian-10-default-squash:
+    path: /debian-squash/releases/download/10.2.0-600c59c0/
+    files:
+    - filesystem.squashfs
+    os: debian
+    version: '10'
+    flavor: core
+    kernel: debian-10-live-kernel
+  manjaro-18.1.0-default-squash:
+    path: /manjaro-squash/releases/download/18.1.0-a9fc9ad4/
+    files:
+    - livefs.sfs
+    - rootfs.sfs
+    os: manjaro
+    version: 18.1.0
+    flavor: architect
+    kernel: manjaro-18.1.0-architect-kernel
+  ubuntu-18.04-xfce-squash:
+    path: /ubuntu-squash/releases/download/18.04.3-d9bd73c3/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '18.04'
+    flavor: xfce
+    kernel: ubuntu-18.04-live-kernel
+  ubuntu-18.04-KDE-squash:
+    path: /ubuntu-squash/releases/download/18.04.3-33e8e2f8/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '18.04'
+    flavor: KDE
+    kernel: ubuntu-18.04-live-kernel
+  ubuntu-18.04-LXDE-squash:
+    path: /ubuntu-squash/releases/download/18.04.3-2f9cd5be/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '18.04'
+    flavor: LXDE
+    kernel: ubuntu-18.04-live-kernel
+  ubuntu-18.04-Budgie-squash:
+    path: /ubuntu-squash/releases/download/18.04.3-fbf44fff/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '18.04'
+    flavor: Budgie
+    kernel: ubuntu-18.04-live-kernel
+  ubuntu-18.04-MATE-squash:
+    path: /ubuntu-squash/releases/download/18.04.3-c629718a/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '18.04'
+    flavor: MATE
+    kernel: ubuntu-18.04-live-kernel
+  ubuntu-18.04-kylin-squash:
+    path: /ubuntu-squash/releases/download/18.04.3-8c2102eb/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '18.04'
+    flavor: kylin
+    kernel: ubuntu-18.04-live-kernel
+  ubuntu-19.10-xfce-squash:
+    path: /ubuntu-squash/releases/download/862cad91-9437400f/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '19.10'
+    flavor: xfce
+    kernel: ubuntu-19.10-live-kernel
+  ubuntu-19.10-KDE-squash:
+    path: /ubuntu-squash/releases/download/9854741e-b243fefb/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '19.10'
+    flavor: KDE
+    kernel: ubuntu-19.10-live-kernel
+  ubuntu-19.10-LXDE-squash:
+    path: /ubuntu-squash/releases/download/8b8b0336-f53591b5/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '19.10'
+    flavor: LXDE
+    kernel: ubuntu-19.10-live-kernel
+  ubuntu-19.10-MATE-squash:
+    path: /ubuntu-squash/releases/download/b8a2a185-48069fc4/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '19.10'
+    flavor: MATE
+    kernel: ubuntu-19.10-live-kernel
+  ubuntu-19.10-Budgie-squash:
+    path: /ubuntu-squash/releases/download/945f7f4b-85bee8cf/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '19.10'
+    flavor: Budgie
+    kernel: ubuntu-19.10-live-kernel
+  debian-10-xfce-squash:
+    path: /debian-squash/releases/download/10.2.0-a0eae41d/
+    files:
+    - filesystem.squashfs
+    os: debian
+    version: '10'
+    flavor: xfce
+    kernel: debian-10-live-kernel
+  debian-10-gnome-squash:
+    path: /debian-squash/releases/download/10.2.0-787d3b4a/
+    files:
+    - filesystem.squashfs
+    os: debian
+    version: '10'
+    flavor: gnome
+    kernel: debian-10-live-kernel
+  debian-10-cinnamon-squash:
+    path: /debian-squash/releases/download/10.2.0-51162b7a/
+    files:
+    - filesystem.squashfs
+    os: debian
+    version: '10'
+    flavor: cinnamon
+    kernel: debian-10-live-kernel
+  ubuntu-19.10-kylin-squash:
+    path: /ubuntu-squash/releases/download/e7831484-762c8439/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '19.10'
+    flavor: kylin
+    kernel: ubuntu-19.10-live-kernel
+  debian-10-kde-squash:
+    path: /debian-squash/releases/download/10.2.0-88a7a1a3/
+    files:
+    - filesystem.squashfs
+    os: debian
+    version: '10'
+    flavor: kde
+    kernel: debian-10-live-kernel
+  debian-10-lxde-squash:
+    path: /debian-squash/releases/download/10.2.0-30a4aa90/
+    files:
+    - filesystem.squashfs
+    os: debian
+    version: '10'
+    flavor: lxde
+    kernel: debian-10-live-kernel
+  debian-10-lxqt-squash:
+    path: /debian-squash/releases/download/10.2.0-39d7e341/
+    files:
+    - filesystem.squashfs
+    os: debian
+    version: '10'
+    flavor: lxqt
+    kernel: debian-10-live-kernel
+  debian-10-mate-squash:
+    path: /debian-squash/releases/download/10.2.0-466ca031/
+    files:
+    - filesystem.squashfs
+    os: debian
+    version: '10'
+    flavor: mate
+    kernel: debian-10-live-kernel
+  ubuntu-19.10-default-squash:
+    path: /ubuntu-squash/releases/download/ee829212-575f2ecf/
+    files:
+    - filesystem.squashfs
+    os: ubuntu
+    version: '19.10'
+    flavor: Unity
+    kernel: ubuntu-19.10-live-kernel
+  fedora-31-gnome:
+    path: /fedora-assets/releases/download/1.9-808bb0da/
+    files:
+    - vmlinuz
+    - initrd
+    - squashfs.img
+    version: 31
+    flavor: GNOME
+    os: fedora
+  fedora-31-Cinnamon:
+    path: /fedora-assets/releases/download/1.9-5a52a02a/
+    files:
+    - vmlinuz
+    - initrd
+    - squashfs.img
+    version: 31
+    flavor: Cinnamon
+    os: fedora
+  fedora-31-KDE:
+    path: /fedora-assets/releases/download/1.9-dfbbe3cc/
+    files:
+    - vmlinuz
+    - initrd
+    - squashfs.img
+    os: fedora
+    version: 31
+    flavor: KDE
+  fedora-31-LXDE:
+    path: /fedora-assets/releases/download/1.9-c23f0dc4/
+    files:
+    - vmlinuz
+    - initrd
+    - squashfs.img
+    os: fedora
+    version: 31
+    flavor: LXDE
+  fedora-31-LXQt:
+    path: /fedora-assets/releases/download/1.9-19db8480/
+    files:
+    - vmlinuz
+    - initrd
+    - squashfs.img
+    os: fedora
+    version: 31
+    flavor: LXQt
+  fedora-31-MATE_Compiz:
+    path: /fedora-assets/releases/download/1.9-29013501/
+    files:
+    - vmlinuz
+    - initrd
+    - squashfs.img
+    os: fedora
+    version: 31
+    flavor: MATE_Compiz
+  fedora-31-SoaS:
+    path: /fedora-assets/releases/download/1.9-28104ec6/
+    files:
+    - vmlinuz
+    - initrd
+    - squashfs.img
+    os: fedora
+    version: 31
+    flavor: SoaS
+  fedora-31-Xfce:
+    path: /fedora-assets/releases/download/1.9-00e3a627/
+    files:
+    - vmlinuz
+    - initrd
+    - squashfs.img
+    os: fedora
+    version: 31
+    flavor: Xfce
+  manjaro-18.1.0-gnome-squash:
+    path: /manjaro-squash/releases/download/18.1.0-f94efa23/
+    files:
+    - livefs.sfs
+    - rootfs.sfs
+    - mhwdfs.sfs
+    - desktopfs.sfs
+    os: manjaro
+    version: 18.1.0
+    flavor: GNOME
+    kernel: manjaro-18.1.0-gui-kernel
+  manjaro-18.1.0-kde-squash:
+    path: /manjaro-squash/releases/download/18.1.0-a3f2c12b/
+    files:
+    - livefs.sfs
+    - rootfs.sfs
+    - mhwdfs.sfs
+    - desktopfs.sfs
+    os: manjaro
+    version: 18.1.0
+    flavor: KDE
+    kernel: manjaro-18.1.0-gui-kernel
+  manjaro-18.1.0-xfce-squash:
+    path: /manjaro-squash/releases/download/18.1.0-5dc05378/
+    files:
+    - livefs.sfs
+    - rootfs.sfs
+    - mhwdfs.sfs
+    - desktopfs.sfs
+    os: manjaro
+    version: 18.1.0
+    flavor: XFCE
+    kernel: manjaro-18.1.0-gui-kernel
+  elementaryos-5-default-squash:
+    path: /ubuntu-squash/releases/download/5-14ff2c98/
+    files:
+    - filesystem.squashfs
+    os: elementary-os
+    version: '5'
+    kernel: ubuntu-18.04-live-kernel
+  kali-xfce-squash:
+    path: /debian-squash/releases/download/2019.4-00ef2578/
+    files:
+    - filesystem.squashfs
+    os: kali
+    version: rolling
+    flavor: xfce
+    kernel: kali-rolling-live-kernel
+  kali-light-squash:
+    path: /debian-squash/releases/download/2019.4-544b485d/
+    files:
+    - filesystem.squashfs
+    os: kali
+    version: rolling
+    flavor: light
+    kernel: kali-rolling-live-kernel
+  kali-mate-squash:
+    path: /debian-squash/releases/download/2019.4-0e4d0210/
+    files:
+    - filesystem.squashfs
+    os: kali
+    version: rolling
+    flavor: MATE
+    kernel: kali-rolling-live-kernel
+  kali-rolling-live-kernel:
+    path: /debian-core-10/releases/download/5.3.9-3kali1-e9b26579/
+    files:
+    - initrd
+    - vmlinuz
+    os: kali
+    version: rolling
+  kali-kde-squash:
+    path: /debian-squash/releases/download/2019.4-d761db15/
+    files:
+    - filesystem.squashfs
+    os: kali
+    version: rolling
+    flavor: KDE
+    kernel: kali-rolling-live-kernel
+  kali-gnome-squash:
+    path: /debian-squash/releases/download/2019.4-734e93c5/
+    files:
+    - filesystem.squashfs
+    os: kali
+    version: rolling
+    flavor: Gnome
+    kernel: kali-rolling-live-kernel
+  kali-lxde-squash:
+    path: /debian-squash/releases/download/2019.4-78e57944/
+    files:
+    - filesystem.squashfs
+    os: kali
+    version: rolling
+    flavor: LXDE
+    kernel: kali-rolling-live-kernel
+  tails-4.0-live-kernel:
+    path: /debian-core-10/releases/download/5.3.2-1-8095e6f1/
+    files:
+    - initrd
+    - vmlinuz
+    os: tails
+    version: '4.0'
+  tails-4.0-default-squash:
+    path: /debian-squash/releases/download/4.0-41d3900f/
+    files:
+    - filesystem.squashfs
+    os: tails
+    version: '4.0'
+    kernel: tails-4.0-live-kernel
+  pop-19.10-default-squash:
+    path: /ubuntu-squash/releases/download/10-317de200/
+    files:
+    - filesystem.squashfs
+    os: pop
+    version: '19.10'
+    kernel: ubuntu-19.10-live-kernel
+  pop-18.04-default-squash:
+    path: /ubuntu-squash/releases/download/57-b1e9a9cc/
+    files:
+    - filesystem.squashfs
+    os: pop
+    version: '18.04'
+    kernel: ubuntu-18.04-live-kernel
+  manjaro-18.1.0-architect-kernel:
+    path: /manjaro-core-18.x/releases/download/4.19.69-1-MANJARO-6946b4cf/
+    files:
+    - initrd
+    - vmlinuz
+    os: manjaro
+    flavor: architect
+    version: 18.1.0
+  manjaro-18.1.0-gui-kernel:
+    path: /manjaro-core-18.x/releases/download/5.2.11-1-MANJARO-e2cddd8e/
+    files:
+    - initrd
+    - vmlinuz
+    os: manjaro
+    flavor: gui
+    version: 18.1.0
+  mint-19-xfce-squash:
+    path: /ubuntu-squash/releases/download/19.2-69724a44/
+    files:
+    - filesystem.squashfs
+    os: mint
+    version: '19'
+    flavor: xfce
+    kernel: ubuntu-18.04-live-kernel
+  mint-19-mate-squash:
+    path: /ubuntu-squash/releases/download/19.2-0b1e2ee6/
+    files:
+    - filesystem.squashfs
+    os: mint
+    version: '19'
+    flavor: MATE
+    kernel: ubuntu-18.04-live-kernel
+  mint-19-cinnamon-squash:
+    path: /ubuntu-squash/releases/download/19.2-0830904d/
+    files:
+    - filesystem.squashfs
+    os: mint
+    version: '19'
+    flavor: Cinnamon
+    kernel: ubuntu-18.04-live-kernel
+  zorin-15-gnome-squash:
+    path: /ubuntu-squash/releases/download/15-171ddffc/
+    files:
+    - filesystem.squashfs
+    os: zorin
+    version: '15'
+    flavor: GNOME
+    kernel: ubuntu-18.04-live-kernel
+  zorin-15-xfce-squash:
+    path: /ubuntu-squash/releases/download/15-24926a26/
+    files:
+    - filesystem.squashfs
+    os: zorin
+    version: '15'
+    flavor: XFCE
+    kernel: ubuntu-18.04-live-kernel
+  peppermint-10-default-squash:
+    path: /ubuntu-squash/releases/download/10-3bce362b/
+    files:
+    - filesystem.squashfs
+    os: peppermint
+    version: '10'
+    flavor: LXDE
+    kernel: ubuntu-18.04-live-kernel
+  backbox-6-default-squash:
+    path: /ubuntu-squash/releases/download/6-b44ce5ee/
+    files:
+    - filesystem.squashfs
+    os: BackBox
+    version: '6'
+    flavor: default
+    kernel: ubuntu-18.04-live-kernel
+  q4os-3.9-default-squash:
+    path: /debian-squash/releases/download/3.9-a721c7cc/
+    files:
+    - filesystem.squashfs
+    os: Q4OS
+    version: '3.9'
+    flavor: trinity
+    kernel: debian-10-live-kernel
+  q4os-3.9-plasma-squash:
+    path: /debian-squash/releases/download/3.9-8b894afb/
+    files:
+    - filesystem.squashfs
+    os: Q4OS
+    version: '3.9'
+    flavor: plasma
+    kernel: debian-10-live-kernel
+  voyager-bionic-squash:
+    path: /ubuntu-squash/releases/download/bionic-c535c643/
+    files:
+    - filesystem.squashfs
+    os: Voyager
+    version: bionic
+    flavor: bionic
+    kernel: ubuntu-18.04-live-kernel
+  voyager-buster-squash:
+    path: /debian-squash/releases/download/buster-1e606829/
+    files:
+    - filesystem.squashfs
+    os: Voyager
+    version: buster
+    flavor: buster
+    kernel: debian-10-live-kernel
+  voyager-eoan-squash:
+    path: /ubuntu-squash/releases/download/eoan-5a6a8fab/
+    files:
+    - filesystem.squashfs
+    os: Voyager
+    version: eoan
+    flavor: eoan
+    kernel: ubuntu-19.10-live-kernel

+ 24 - 0
etc/netbootxyz/custom/README.md

@@ -0,0 +1,24 @@
+# Custom Menus for Self Hosted netboot.xyz
+
+This directory contains custom iPXE files that are rendered
+during menu generation and available from the main menu via
+the custom menu option.
+
+When these options are set:
+
+```
+custom_generate_menus: true
+custom_templates_dir: "{{ netbootxyz_conf_dir }}/custom"
+```
+
+the menu will add an option for custom menus and attempt to load into
+custom/custom.ipxe.  From there custom options can be built and
+maintained seperately from the netboot.xyz source tree so that both
+menus can be updated independently.
+
+A sample menu is provided to demonstrate how to configure and set up
+a menu.  You can copy the custom directory from the repo:
+
+```
+cp etc/netbootxyz/custom /etc/netbootxyz/custom
+```

+ 36 - 0
etc/netbootxyz/custom/custom.ipxe.j2

@@ -0,0 +1,36 @@
+#!ipxe
+###
+### {{ site_name }} custom menu example
+###
+
+:custom
+clear custom_choice
+menu This is a Test Menu
+item --gap This is the first sub menu
+item option_one ${space} Loading a kernel and initrd
+item option_two ${space} Loading an ISO
+item --gap This is a second sub menu
+item option_three ${space} Loads another custom sub menu
+item option_four ${space} This is option four
+choose custom_choice || goto custom_exit
+echo ${cls}
+goto ${custom_choice}
+goto custom_exit
+
+:option_one
+kernel http://path.to/vmlinuz
+initrd http://path.to/initrd
+imgargs vmlinuz put_kernel_img_args_here
+boot || goto custom_exit
+
+:option_two
+kernel {{ memdisk_location }} raw iso
+initrd http://path.to/iso
+boot || goto custom_exit
+
+:option_three
+echo Chains into another menu...
+chain custom1.ipxe || goto custom
+
+:custom_exit
+exit

+ 1 - 0
inventory

@@ -0,0 +1 @@
+localhost ansible_connection=local

+ 39 - 0
roles/netbootxyz/README.md

@@ -0,0 +1,39 @@
+Ansible role: netbootxyz
+========================
+
+Uses Ansible to generate a self hosted environment of netboot.xyz for use anywhere
+
+Requirements
+------------
+
+Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
+
+Role Variables
+--------------
+
+A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
+
+Dependencies
+------------
+
+A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
+
+Example Playbook
+----------------
+
+Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
+
+    - hosts: servers
+      roles:
+         - { role: username.rolename, x: 42 }
+
+License
+-------
+
+Apache
+
+Author Information
+------------------
+
+Website: https://netboot.xyz
+Author: Antony Messerli

+ 440 - 0
roles/netbootxyz/defaults/main.yml

@@ -0,0 +1,440 @@
+---
+
+### site configuration ###
+site_name: netboot.xyz
+boot_domain: boot.netboot.xyz
+boot_version: 1.04
+boot_timeout: 300000
+time_server: "0.pool.ntp.org"
+
+# signature checking
+sigs_menu: false
+sigs_enabled: false
+img_sigs_enabled: false
+
+# helper app locations
+memdisk_location: "http://${boot_domain}/memdisk"
+wimboot_location: "http://${boot_domain}/wimboot"
+
+# iPXE upstream repo settings
+ipxe_repo: https://github.com/ipxe/ipxe
+ipxe_branch: master
+
+ipxe_source_dir: /usr/src/ipxe
+netbootxyz_root: /var/www/html
+netbootxyz_conf_dir: /etc/netbootxyz
+
+# live os settings
+live_endpoint: "https://github.com/netbootxyz"
+
+# generates menus
+generate_menus: true
+
+# generates signatures for source files
+generate_checksums: true
+
+# bootloader options
+generate_disks: true
+bootloader_https_enabled: true
+bootloader_http_enabled: true
+bootloader_disks:
+  - "netboot.xyz"
+
+# custom menus
+# custom_github_menus allows for github custom menus
+# custom_generate_menus allows for self hosted custom menus to be added
+custom_github_menus: true
+custom_generate_menus: false
+custom_templates_dir: "{{ netbootxyz_conf_dir }}/custom"
+
+# signature generation
+generate_signatures: false
+sigs_dir: "{{ netbootxyz_root }}/sigs"
+sigs_location: "http://${boot_domain}/sigs/"
+cert_dir: "/etc/netbootxyz/certs"
+ipxe_trust_args: "TRUST={{ ipxe_ca_location }}"
+ipxe_ca_url: http://ca.ipxe.org/ca.crt
+ipxe_ca_filename: ca-ipxe-org.crt
+codesign_cert_filename: codesign.crt
+codesign_key_filename: codesign.key
+cert_file_filename : ca-netboot-xyz.crt
+
+#bootloader_multiple: true
+#bootloader_disks:
+#  - "netboot.xyz"
+#  - "netboot.xyz-packet"
+    
+### release values ###
+releases:
+  alpinelinux:
+    name: "Alpine Linux"
+    mirror: "http://dl-cdn.alpinelinux.org"
+    base_dir: "alpine"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "3.10"
+        code_name: "v3.10"
+      - name: "Edge (development)"
+        code_name: "edge"
+  archlinux:
+    name: "Arch Linux"
+    mirror: "mirror.rackspace.com"
+    base_dir: "archlinux"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "2019.10.01"
+        code_name: "2019.10.01"
+  blackarch:
+    name: "BlackArch"
+    enabled: true
+    menu: "security"
+    versions:
+      - name: "2019.06.01"
+        code_name: "2019.06.01"
+  centos:
+    name: "CentOS"
+    mirror: "http://mirror.centos.org"
+    base_dir: "centos"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "8.0"
+        code_name: "8.0.1905"
+      - name: "8.0 Stream"
+        code_name: "8-stream"
+      - name: "7.7"
+        code_name: "7.7.1908"
+  coreos:
+    name: "Fedora CoreOS"
+    mirror: "https://builds.coreos.fedoraproject.org"
+    base_dir: "prod/streams/testing/builds"
+    enabled: true
+    menu: "linux"    
+    versions:
+      - name: "30"
+        code_name: "beta"
+  debian:
+    name: "Debian"      
+    mirror: "http://deb.debian.org"
+    archive_mirror: "http://archive.debian.org"
+    base_dir: "debian"
+    enabled: true
+    menu: "linux"    
+    versions:
+      stable:
+        - name: "10.0 (buster)"
+          code_name: "buster"
+        - name: "9.0 (stretch)"
+          code_name: "stretch"
+        - name: "8.0 (jessie)"
+          code_name: "jessie"
+        - name: "7.0 (jessie)"
+          code_name: "wheezy"
+      testing:
+        - name: "bullseye (testing)"
+          code_name: "bullseye"
+        - name: "sid (unstable)"
+          code_name: "sid"
+  devuan:
+    name: "Devuan"
+    mirror: "http://auto.mirror.devuan.org"
+    base_dir: "devuan"
+    enabled: true
+    menu: "linux"
+    versions:
+      stable:
+        - name: "ascii (stable)"
+          code_name: "ascii"
+        - name: "1.0 (jessie)"
+          code_name: "jessie"
+      testing:
+        - name: "beowulf (testing)"
+          code_name: "beowulf"
+  fedora:
+    name: "Fedora"
+    mirror: "http://mirrors.kernel.org"
+    base_dir: "fedora"
+    enabled: true
+    menu: "linux"    
+    versions:
+      - name: "31"
+        code_name: "31"
+      - name: "30"
+        code_name: "30"
+      - name: "29"
+        code_name: "29"
+  flatcar:
+    name: "Container Linux by Flatcar"
+    mirror: ""
+    enabled: true
+    menu: "linux"    
+    versions:
+      - name: "Stable Channel"
+        code_name: "stable"
+      - name: "Beta Channel"
+        code_name: "beta"
+      - name: "Alpha Channel"
+        code_name: "alpha"
+      - name: "Edge Channel"
+        code_name: "edge"
+  freebsd:
+    name: "FreeBSD"
+    enabled: false
+    menu: "bsd"
+    versions:
+      - name: "FreeBSD 12.0"
+        code_name: "12.0"
+        image_subdir: "12"
+      - name: "FreeBSD 11.2"
+        code_name: "11.2"
+        image_subdir: "11"
+      - name: "FreeBSD 11.1"
+        code_name: "11.1"
+        image_subdir: "11"
+      - name: "FreeBSD 11.0"
+        code_name: "11.0"
+        image_subdir: "11"
+      - name: "FreeBSD 10.4"
+        code_name: "10.4"
+        image_subdir: "10"
+  freedos:
+    name: "FreeDOS"
+    mirror: "http://www.freedos.org"
+    base_dir: "download/download"
+    enabled: true
+    menu: "dos"
+    versions:
+      - name: "1.2 Full Installer"
+        code_name: "FD12FULL"
+      - name: "1.2 Lite Installer"
+        code_name: "FD12LITE"
+  gentoo:
+    name: "Gentoo"
+    mirror: ""
+    enabled: false
+    menu: "linux"
+    versions:
+      - name: "Minimal CD 20160204 (amd64)"
+        code_name: "20160204"
+  ipfire:
+    name: "IPFire"
+    mirror: "https://downloads.ipfire.org"
+    base_dir: "releases/ipfire-2.x"
+    menu: "linux"
+    enabled: true
+    versions:
+      - name: "2.21 Core 126"
+        code_name: "2.21-core126"
+  kali:
+    name: "Kali Linux"
+    mirror: "http://http.kali.org"
+    base_dir: "kali"
+    enabled: true
+    menu: "security"
+    versions:
+      - name: "Rolling Edition (2019.4)"
+        code_name: "rolling"
+  livegrml:
+    name: "Grml Live Linux"
+    mirror: "http://download.grml.org"
+    enabled: true
+    menu: "live"
+    versions:
+      - name: "2018.12 Full"
+        code_name: "grml-full"
+      - name: "2018.12 Small"
+        code_name: "grml-small"
+  mageia:
+    name: "Mageia"
+    mirror: "http://mirrors.kernel.org"
+    base_dir: "mageia"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "7.1"
+        code_name: "7.1"
+      - name: "cauldron"
+        code_name: "cauldron"
+  nixos:
+    name: "NixOS"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "Nixos 19.09"
+        code_name: "19.09"
+      - name: "Nixos 19.03"
+        code_name: "19.03"
+      - name: "Nixox Unstable"
+        code_name: "unstable"
+  openbsd:
+    name: "OpenBSD"
+    mirror: "http://ftp.openbsd.org"
+    base_dir: "pub/OpenBSD"
+    enabled: true
+    menu: "bsd"
+    versions:
+      - name: "6.6"
+        code_name: "6.6"
+        image_ver: "66"
+      - name: "6.5"
+        code_name: "6.5"
+        image_ver: "65"
+      - name: "6.4"
+        code_name: "6.4"
+        image_ver: "64"
+      - name: "6.3"
+        code_name: "6.3"
+        image_ver: "63"
+      - name: "6.6 Latest Snapshot"
+        code_name: "snapshots"
+        image_ver: "66"
+  opensuse:
+    name: "OpenSUSE"
+    mirror: "http://download.opensuse.org"
+    base_dir: "distribution/leap"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "openSUSE Leap 15.1"
+        code_name: "15.1"
+      - name: "openSUSE Leap 15.0"
+        code_name: "15.0"
+      - name: "openSUSE Leap 42.3"
+        code_name: "42.3"
+      - name: "openSUSE tumbleweed"
+        code_name: "tumbleweed"
+  parrotsec:
+    name: "Parrot Security"
+    mirror: "https://mirrordirector.archive.parrotsec.org"
+    base_dir: "parrot"
+    enabled: true
+    menu: "security"
+    versions:
+      - name: "Stable Netinstall"
+        code_name: "stable"
+  rancheros:
+    name: "RancherOS"
+    mirror: "http://releases.rancher.com"
+    base_dir: "os/latest"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "Latest (20 MB)"
+        code_name: "latest"
+  scientific:
+    name: "Scientific Linux"
+    mirror: "http://ftp1.scientificlinux.org"
+    base_dir: "linux/scientific"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "7.7"
+        code_name: "7.7"
+      - name: "7.6"
+        code_name: "7.6"
+      - name: "6.10"
+        code_name: "6.10"
+      - name: "6.9"
+        code_name: "6.9" 
+  slackware:
+    name: "Slackware"
+    mirror: "http://mirror.rackspace.com"
+    base_dir: "slackware"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "Current"
+        code_name: "current"
+      - name: "14.2"
+        code_name: "14.2"
+      - name: "14.1"
+        code_name: "14.1"
+  tinycore:
+    name: "Tiny Core Linux"
+    mirror: "http://tinycorelinux.net"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "Core [ISO]"
+        code_name: "Core"
+      - name: "TinyCore [ISO]"
+        code_name: "TinyCore"
+      - name: "CorePlus [ISO]"
+        code_name: "CorePlus"
+  ubuntu:
+    name: "Ubuntu"
+    mirror: "http://archive.ubuntu.com"
+    archive_mirror: "http://old-releases.ubuntu.com"
+    base_dir: "ubuntu"
+    enabled: true
+    menu: "linux"
+    versions:
+      - name: "19.10 Eoan Ermine"
+        code_name: "eoan"
+      - name: "19.04 Disco Dingo"
+        code_name: "disco"
+      - name: "18.04 LTS Bionic Beaver"
+        code_name: "bionic"
+      - name: "16.04 LTS Xenial Xerus"
+        code_name: "xenial"
+
+# utility values
+utilities:
+  avg:
+    name: "AVG Rescue CD"
+    enabled: true
+    menu: "pcbios"
+    type: "memdisk"
+    version: "160420a12074"
+    util_path: "http://download.avg.com/filedir/inst/avg_arl_cdi_all_120_160420a12074.iso"
+  breakin:
+    name: "Breakin"
+    enabled: true
+    menu: "pcbios"
+    type: "memdisk"
+    version: "4.26.1-53"
+    util_path: "http://www.advancedclustering.com/wp-content/uploads/2017/02/bootimage-4.26.1-53.iso"
+  clonezilla:
+    name: "Clonezilla"
+    enabled: true
+    menu: "pcbios"
+    type: "memdisk"
+    version: "2.6.2-15"
+    util_path: "http://master.dl.sourceforge.net/project/clonezilla/clonezilla_live_stable/2.6.2-15/clonezilla-live-2.6.2-15-amd64.iso"
+  dban:
+    name: "DBAN"
+    enabled: true
+    menu: "pcbios"
+    type: "memdisk"
+    version: "2.3.0"
+    util_path: "http://master.dl.sourceforge.net/project/dban/dban/dban-2.3.0/dban-2.3.0_i586.iso"
+  gparted:
+    name: "GParted"
+    enabled: true
+    menu: "pcbios"
+    type: "memdisk"
+    version: "1.0.0-3"
+    util_path: "http://master.dl.sourceforge.net/project/gparted/gparted-live-stable/1.0.0-3/gparted-live-1.0.0-3-amd64.iso"
+  memtest:
+    name: "Memtest"
+    enabled: true
+    menu: "pcbios"
+    type: "memtest"
+    version: "5.01.0"
+    util_path: "https://boot.netboot.xyz/utils/memtest86-5.01.0"
+  supergrub:
+    name: "SuperGRUB"
+    enabled: true
+    menu: "pcbios"
+    type: "memdisk"
+    version: "2.04s1"
+    util_path: "http://master.dl.sourceforge.net/project/supergrub2/2.04s1/super_grub2_disk_2.04s1/super_grub2_disk_hybrid_2.04s1.iso"
+  ubcd:
+    name: "Ultimate Boot CD (UBCD)"
+    enabled: true
+    menu: "pcbios"
+    type: "memdisk"
+    version: "538"
+    util_path: "http://mirror.sysadminguide.net/ubcd/ubcd538.iso"

+ 28 - 0
roles/netbootxyz/files/ipxe/local/colour.h

@@ -0,0 +1,28 @@
+#undef COLOR_NORMAL_FG
+#undef COLOR_NORMAL_BG
+#undef COLOR_SELECT_FG
+#undef COLOR_SELECT_BG
+#undef COLOR_SEPARATOR_FG
+#undef COLOR_SEPARATOR_BG
+#undef COLOR_EDIT_FG
+#undef COLOR_EDIT_BG
+#undef COLOR_ALERT_FG
+#undef COLOR_ALERT_BG
+#undef COLOR_URL_FG
+#undef COLOR_URL_BG
+#undef COLOR_PXE_FG
+#undef COLOR_PXE_BG
+#define COLOR_NORMAL_FG		COLOR_CYAN
+#define COLOR_NORMAL_BG		COLOR_BLACK
+#define COLOR_SELECT_FG		COLOR_WHITE
+#define COLOR_SELECT_BG		COLOR_BLUE
+#define COLOR_SEPARATOR_FG	COLOR_WHITE
+#define COLOR_SEPARATOR_BG	COLOR_BLACK
+#define COLOR_EDIT_FG		COLOR_BLACK
+#define COLOR_EDIT_BG		COLOR_CYAN
+#define COLOR_ALERT_FG		COLOR_WHITE
+#define COLOR_ALERT_BG		COLOR_RED
+#define COLOR_URL_FG		COLOR_CYAN
+#define COLOR_URL_BG		COLOR_BLUE
+#define COLOR_PXE_FG		COLOR_BLACK
+#define COLOR_PXE_BG		COLOR_WHITE

+ 1 - 0
roles/netbootxyz/files/ipxe/local/crypto.h

@@ -0,0 +1 @@
+#undef OCSP_CHECK

+ 11 - 0
roles/netbootxyz/files/ipxe/local/general.h

@@ -0,0 +1,11 @@
+#define DIGEST_CMD            /* Image crypto digest commands */
+#define DOWNLOAD_PROTO_HTTPS  /* Secure Hypertext Transfer Protocol */      
+#define IMAGE_COMBOOT         /* COMBOOT */
+#define IMAGE_TRUST_CMD	      /* Image trust management commands */
+#define NET_PROTO_IPV6        /* IPv6 protocol */
+#define NSLOOKUP_CMD          /* DNS resolving command */
+#define NTP_CMD               /* NTP commands */
+#define PCI_CMD               /* PCI commands */
+#define REBOOT_CMD            /* Reboot command */
+#define TIME_CMD              /* Time commands */
+#define VLAN_CMD              /* VLAN commands */

+ 10 - 0
roles/netbootxyz/files/ipxe/local/general.h.efi

@@ -0,0 +1,10 @@
+#define DIGEST_CMD            /* Image crypto digest commands */
+#define DOWNLOAD_PROTO_HTTPS  /* Secure Hypertext Transfer Protocol */      
+#define IMAGE_TRUST_CMD	      /* Image trust management commands */
+#define NET_PROTO_IPV6        /* IPv6 protocol */
+#define NSLOOKUP_CMD          /* DNS resolving command */
+#define NTP_CMD               /* NTP commands */
+#define PCI_CMD               /* PCI commands */
+#define REBOOT_CMD            /* Reboot command */
+#define TIME_CMD              /* Time commands */
+#define VLAN_CMD              /* VLAN commands */

+ 4 - 0
roles/netbootxyz/files/ipxe/local/nap.h.efi

@@ -0,0 +1,4 @@
+/* nap.h */
+#undef NAP_EFIX86
+#undef NAP_EFIARM
+#define NAP_NULL

+ 2 - 0
roles/netbootxyz/files/ipxe/local/usb.h.efi

@@ -0,0 +1,2 @@
+/* usb.h */
+#define	USB_EFI	

二進制
roles/netbootxyz/files/memdisk


二進制
roles/netbootxyz/files/wimboot


+ 15 - 0
roles/netbootxyz/meta/main.yml

@@ -0,0 +1,15 @@
+galaxy_info:
+  author: Antony Messerli
+  description: Installs a self hosted version of netboot.xyz
+  license: Apache-2.0
+  min_ansible_version: 2.7
+  platforms:
+    - name: Ubuntu
+      versions:
+        - all
+    - name: Centos
+      versions:
+        - all
+  galaxy_tags:
+    - system
+dependencies: []

+ 26 - 0
roles/netbootxyz/tasks/generate_checksums.yml

@@ -0,0 +1,26 @@
+---
+  - name: Register a listing of all created iPXE bootloaders
+    command: ls -I checksums.txt {{ netbootxyz_root }}/ipxe/
+    register: netboot_disks
+
+  - name: Generate date
+    command: date
+    register: current_date
+
+  - name: Gather stat listing of directory
+    command: sha256sum -b {{ item }}
+    with_items:
+      - "{{ netboot_disks.stdout_lines }}"
+    args:
+      chdir: "{{ netbootxyz_root }}/ipxe/"
+    register: netboot_disks_stat
+
+  - name: Generate ipxe disk checksums
+    template:
+      src: checksums.txt.j2
+      dest: "{{ netbootxyz_root }}/ipxe/checksums.txt"
+
+  - name: Generate netboot.xyz index template
+    template:
+      src: index.html.j2
+      dest: "{{ netbootxyz_root }}/index.html"

+ 11 - 0
roles/netbootxyz/tasks/generate_disks.yml

@@ -0,0 +1,11 @@
+---
+
+  - include: generate_disks_base.yml
+
+  - include: generate_disks_legacy.yml
+    when:
+    - generate_disks_legacy | default(true) | bool
+
+  - include: generate_disks_efi.yml
+    when:
+    - generate_disks_efi | default(true) | bool

+ 0 - 0
roles/netbootxyz/tasks/generate_disks_arm.yml


+ 78 - 0
roles/netbootxyz/tasks/generate_disks_base.yml

@@ -0,0 +1,78 @@
+---
+
+  - name: Gathering facts
+    setup:
+
+  - name: Gather variables for each operating system
+    include_vars: "{{ item }}"
+    with_first_found:
+      - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
+      - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
+      - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
+      - "{{ ansible_distribution | lower }}.yml"
+      - "{{ ansible_os_family | lower }}.yml"
+
+  - name: Set var to bootloader of loop
+    set_fact:
+      bootloader_filename: "{{ bootloader_file }}"
+
+  - name: Create iPXE file directories
+    file:
+      path: "{{ item }}"
+      state: directory
+    with_items:
+      - "{{ netbootxyz_root }}/ipxe"
+      - "{{ cert_dir }}"
+
+  - name: Copy helper apps
+    copy:
+      src: "{{ item }}"
+      dest: "{{ netbootxyz_root }}"
+    with_items:
+      - memdisk
+      - wimboot
+
+  - name: Install required packages
+    package:
+      name: "{{ item }}"
+      state: present
+    with_items: "{{ netbootxyz_packages }}"
+
+  - name: Check out latest iPXE sources
+    git:
+      repo: "{{ ipxe_repo }}"
+      dest: "{{ ipxe_source_dir }}"
+      version: "{{ ipxe_branch }}"
+      force: true
+    register: ipxe_git_checkout
+      
+  - name: Copy iPXE Bootloader template to iPXE source directory
+    template:
+      src: "disks/{{ bootloader_filename }}.j2"
+      dest: "{{ ipxe_source_dir }}/src/{{ bootloader_filename }}"
+
+  - name: Touch iPXE config local files
+    file:
+      path: "{{ ipxe_source_dir }}/{{ item }}"
+      state: touch
+    with_items:
+      - src/config/local/console.h
+      - src/config/local/umalloc.h
+      - src/config/local/nap.h
+      - src/config/local/timer.h
+      - src/config/local/branding.h
+      - src/config/local/serial.h
+      - src/config/local/reboot.h
+      - src/config/local/sanboot.h
+      - src/config/local/fault.h
+      - src/config/local/dhcp.h
+      - src/config/local/sideband.h
+      - src/config/local/entropy.h
+      - src/config/local/crypto.h
+      - src/config/local/usb.h
+      - src/config/local/settings.h
+
+  - name: Retrieve iPXE CA
+    get_url:
+      url: "{{ ipxe_ca_url }}"
+      dest: "{{ cert_dir }}/{{ ipxe_ca_filename }}"

+ 70 - 0
roles/netbootxyz/tasks/generate_disks_efi.yml

@@ -0,0 +1,70 @@
+---
+
+  - name: Copy netboot.xyz local EFI iPXE configs
+    copy:
+      src: "ipxe/local/{{ item }}"
+      dest: "{{ ipxe_source_dir }}/src/config/local/{{ item }}"
+    with_items:
+      - colour.h
+      - crypto.h
+
+  - name: Copy netboot.xyz general.h.efi iPXE config
+    copy:
+      src: "ipxe/local/general.h.efi"
+      dest: "{{ ipxe_source_dir }}/src/config/local/general.h"
+
+  - name: Set trust file to ipxe ca
+    set_fact:
+      trust_files: "{{ cert_dir }}/{{ ipxe_ca_filename }}"
+    when: not generate_signatures
+
+  - name: Combine trust files if set
+    set_fact:
+      trust_files: "{{ cert_dir }}/{{ ipxe_ca_filename }},{{ cert_dir }}/{{ cert_file_filename }}"
+    when: generate_signatures | bool
+
+  - name: Compile iPXE bootloader for EFI
+    shell: |
+      make clean
+      make EMBED={{ bootloader_filename }} TRUST={{ trust_files }} bin-x86_64-efi/ipxe.efi
+    args:
+      chdir: "{{ ipxe_source_dir }}/src"
+    tags:
+    - skip_ansible_lint
+
+  - name: Generate iPXE EFI ISO Disk
+    shell: |
+      mkdir -p efi_tmp
+      dd if=/dev/zero of=efi_tmp/ipxe.img count=2880
+      mformat -i efi_tmp/ipxe.img -m 0xf8 -f 2880
+      mmd -i efi_tmp/ipxe.img ::efi ::efi/boot
+      mcopy -i efi_tmp/ipxe.img bin-x86_64-efi/ipxe.efi ::efi/boot/bootx64.efi
+      genisoimage -o ipxe-efi.eiso -eltorito-alt-boot -e ipxe.img -no-emul-boot efi_tmp
+    args:
+      chdir: "{{ ipxe_source_dir }}/src"
+      warn: false
+    tags:
+    - skip_ansible_lint
+
+  - name: Generate iPXE EFI USB image
+    shell: |
+      truncate -s 3MiB ipxe-efi.usb
+      mkfs.vfat ipxe-efi.usb
+      mmd -i ipxe-efi.usb "::/efi"
+      mmd -i ipxe-efi.usb "::/efi/boot"
+      mcopy -i ipxe-efi.usb bin-x86_64-efi/ipxe.efi "::/efi/boot/bootx64.efi"
+    args:
+      chdir: "{{ ipxe_source_dir }}/src"
+      warn: false
+    tags:
+    - skip_ansible_lint
+ 
+  - name: Copy iPXE EFI builds to http directory
+    copy:
+      src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
+      dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
+      remote_src: True
+    with_items:
+      - { src: "bin-x86_64-efi/ipxe.efi", dest: "{{ bootloader_filename }}.efi" }
+      - { src: "ipxe-efi.eiso", dest: "{{ bootloader_filename }}-efi.iso" }
+      - { src: "ipxe-efi.usb", dest: "{{ bootloader_filename }}-efi.usb" }

+ 47 - 0
roles/netbootxyz/tasks/generate_disks_legacy.yml

@@ -0,0 +1,47 @@
+---
+
+  - name: Copy netboot.xyz local legacy iPXE configs
+    copy:
+      src: "ipxe/local/{{ item }}"
+      dest: "{{ ipxe_source_dir }}/src/config/local/{{ item }}"
+    with_items:
+      - colour.h
+      - crypto.h
+      - general.h
+
+  - name: Set trust file to ipxe ca
+    set_fact:
+      trust_files: "{{ cert_dir }}/{{ ipxe_ca_filename }}"
+    when: not generate_signatures
+
+  - name: Combine trust args if set
+    set_fact:
+      trust_files: "{{ cert_dir }}/{{ ipxe_ca_filename }},{{ cert_dir }}/{{ cert_file_filename }}"
+    when: generate_signatures | bool
+
+  - name: Compile iPXE bootloader for Legacy BIOS
+    shell: |
+      make clean
+      make EMBED={{ bootloader_filename }} TRUST={{ trust_files }} bin/ipxe.dsk bin/ipxe.iso bin/ipxe.lkrn bin/ipxe.usb bin/ipxe.kpxe bin/undionly.kpxe
+    args:
+      chdir: "{{ ipxe_source_dir }}/src"
+    tags:
+    - skip_ansible_lint
+
+  - name: Copy iPXE files for Legacy BIOS to http directory
+    copy:
+      src: "{{ ipxe_source_dir }}/src/bin/ipxe{{ item }}"
+      dest: "{{ netbootxyz_root }}/ipxe/{{ bootloader_filename }}{{ item }}"
+      remote_src: True
+    with_items:
+    - ".dsk"
+    - ".iso"
+    - ".lkrn"
+    - ".usb"
+    - ".kpxe"
+
+  - name: Copy undionly.kpxe for Legacy BIOS to http directory
+    copy:
+      src: "{{ ipxe_source_dir }}/src/bin/undionly.kpxe"
+      dest: "{{ netbootxyz_root }}/ipxe/{{ bootloader_filename }}-undionly.kpxe"
+      remote_src: True

+ 34 - 0
roles/netbootxyz/tasks/generate_menus.yml

@@ -0,0 +1,34 @@
+---
+  - name: Combine overrides with release defaults
+    set_fact:
+      _releases: "{{ releases|combine(release_overrides, recursive=True) }}"
+    when: release_overrides is defined
+
+  - name: Set releases with user overrides
+    set_fact:
+      releases: "{{ _releases }}"
+    when: release_overrides is defined
+
+  - name: Combine overrides with utilities defaults
+    set_fact:
+      _utilities: "{{ utilities|combine(utilities_overrides, recursive=True) }}"
+    when: utilities_overrides is defined
+
+  - name: Set utility with user overrides
+    set_fact:
+      utilities: "{{ _utilities }}"
+    when: utilities_overrides is defined
+
+  - name: Generate directories
+    file:
+      path: "{{ netbootxyz_root }}"
+      state: directory
+
+  - name: Generate netboot.xyz source files templates
+    template:
+      src: "{{ item.src }}"
+      dest: "{{ netbootxyz_root }}/{{ item.path | regex_replace('.j2','') }}"
+    with_filetree: "templates/menu/"
+    when: item.state == "file"
+    tags:
+    - skip_ansible_lint

+ 18 - 0
roles/netbootxyz/tasks/generate_menus_custom.yml

@@ -0,0 +1,18 @@
+---
+
+  - name: Generate directories
+    file:
+      path: "{{ item }}"
+      state: directory
+    with_items:
+      - "{{ custom_templates_dir }}"
+      - "{{ netbootxyz_root }}/custom"
+
+  - name: Generate custom user menu templates
+    template:
+      src: "{{ item.src }}"
+      dest: "{{ netbootxyz_root }}/custom/{{ item.path | regex_replace('.j2','') }}"
+    with_filetree: "{{ custom_templates_dir }}"
+    when: item.state == "file"
+    tags:
+    - skip_ansible_lint

+ 24 - 0
roles/netbootxyz/tasks/generate_signatures.yml

@@ -0,0 +1,24 @@
+---
+  - name: Gather list of source files
+    command: ls {{ netbootxyz_root }}
+    register: source_files
+
+  - name: Create directories for signatures
+    file:
+      path: "{{ item }}"
+      state: directory
+    with_items:
+      - "{{ sigs_dir }}"
+
+  - name: Generate signatures for source files
+    shell: |
+      openssl cms -sign -binary -noattr -in {{ netbootxyz_root }}/{{ item }} \ 
+      -signer {{ codesign_cert_location }} -inkey {{ codesign_key_location }} -certfile {{ cert_file_location }} -outform DER \
+      -out {{ sigs_dir }}/{{ item }}.sig
+    args:
+      chdir: "{{ cert_dir }}"
+      warn: false
+    with_items:
+      - "{{ source_files.stdout_lines }}"
+    tags:
+    - skip_ansible_lint

+ 28 - 0
roles/netbootxyz/tasks/main.yml

@@ -0,0 +1,28 @@
+---
+  - include: generate_menus.yml
+    when:
+    - generate_menus | default(true) | bool
+
+  - include: generate_menus_custom.yml
+    when:
+    - custom_generate_menus | default(false) | bool
+
+  - include: generate_signatures.yml
+    when:
+    - generate_signatures | default(false) | bool
+    - codesign_cert_location is defined
+    - codesign_key_location is defined
+    - cert_file_location is defined
+
+  - include: generate_disks.yml
+    with_items:
+    - "{{ bootloader_disks }}"
+    loop_control:
+      loop_var: bootloader_file
+    when:
+    - generate_disks | default(true) | bool
+
+  - include: generate_checksums.yml
+    when:
+    - generate_checksums | default(true) | bool
+

+ 6 - 0
roles/netbootxyz/templates/checksums.txt.j2

@@ -0,0 +1,6 @@
+# {{ site_name }} bootloaders generated at {{ current_date.stdout }}
+# iPXE Commit: {{ ipxe_repo }}/commit/{{ ipxe_git_checkout.after }}
+
+{% for item in netboot_disks_stat.results %}
+{{ item.stdout }}
+{% endfor %}

+ 68 - 0
roles/netbootxyz/templates/disks/netboot.xyz-gce.j2

@@ -0,0 +1,68 @@
+#!ipxe
+set esc:hex 1b
+set bold ${esc:string}[1m
+set boldoff ${esc:string}[22m
+set fg_gre ${esc:string}[32m
+set fg_cya ${esc:string}[36m
+set fg_whi ${esc:string}[37m
+set HTTPS_ERR HTTPS appears to have failed... attempting HTTP
+set HTTP_ERR HTTP has failed, localbooting...
+set version 1.04
+set ipxe_cloud_config gce
+
+:start
+echo ${bold}${fg_gre}netboot.xyz ${fg_whi}v${version} for ${fg_cya}Google Compute Engine${boldoff}
+prompt --key m --timeout 4000 Hit the ${bold}m${boldoff} key to open failsafe menu... && goto failsafe || goto dhcp
+
+:dhcp
+echo
+dhcp || goto netconfig
+goto menu
+
+:failsafe
+menu netboot.xyz Failsafe Menu
+item localboot Boot to local drive
+item netconfig Manual network configuration
+item retry Retry boot
+item debug iPXE Debug Shell
+item reboot Reboot System
+choose failsafe_choice || exit
+goto ${failsafe_choice}
+
+:netconfig
+echo Network Configuration:
+echo Available interfaces...
+ifstat
+imgfree
+echo -n Set network interface number [0 for net0, defaults to 0]: ${} && read net
+isset ${net} || set net 0
+echo -n IP: && read net${net}/ip
+echo -n Subnet mask: && read net${net}/netmask
+echo -n Gateway: && read net${net}/gateway
+echo -n DNS: && read dns
+ifopen net${net}
+echo Attempting chainload of netboot.xyz...
+goto menu || goto failsafe
+
+:menu
+set conn_type https
+chain --autofree https://boot.netboot.xyz/menu.ipxe || echo ${HTTPS_ERR}
+sleep 5
+set conn_type http
+chain --autofree http://boot.netboot.xyz/menu.ipxe || echo ${HTTP_ERR}
+goto localboot
+
+:localboot
+exit
+
+:retry
+goto start
+
+:reboot
+reboot
+goto start
+
+:debug
+echo Type "exit" to return to menu
+shell
+goto failsafe

+ 69 - 0
roles/netbootxyz/templates/disks/netboot.xyz-packet.j2

@@ -0,0 +1,69 @@
+#!ipxe
+set esc:hex 1b
+set bold ${esc:string}[1m
+set boldoff ${esc:string}[22m
+set fg_gre ${esc:string}[32m
+set fg_red ${esc:string}[31m
+set fg_cya ${esc:string}[36m
+set fg_whi ${esc:string}[37m
+set HTTPS_ERR HTTPS appears to have failed... attempting HTTP
+set HTTP_ERR HTTP has failed, localbooting...
+set version 1.04
+set ipxe_cloud_config packet
+
+:start
+echo ${bold}${fg_gre}netboot.xyz ${fg_whi}v${version} for ${fg_red}packet.com${fg_whi}${boldoff}
+prompt --key m --timeout 4000 Hit the ${bold}m${boldoff} key to open failsafe menu... && goto failsafe || goto dhcp
+
+:dhcp
+echo
+dhcp || goto netconfig
+goto menu
+
+:failsafe
+menu netboot.xyz Failsafe Menu
+item localboot Boot to local drive
+item netconfig Manual network configuration
+item retry Retry boot
+item debug iPXE Debug Shell
+item reboot Reboot System
+choose failsafe_choice || exit
+goto ${failsafe_choice}
+
+:netconfig
+echo Network Configuration:
+echo Available interfaces...
+ifstat
+imgfree
+echo -n Set network interface number [0 for net0, defaults to 0]: ${} && read net
+isset ${net} || set net 0
+echo -n IP: && read net${net}/ip
+echo -n Subnet mask: && read net${net}/netmask
+echo -n Gateway: && read net${net}/gateway
+echo -n DNS: && read dns
+ifopen net${net}
+echo Attempting chainload of netboot.xyz...
+goto menu || goto failsafe
+
+:menu
+set conn_type https
+chain --autofree https://boot.netboot.xyz/menu.ipxe || echo ${HTTPS_ERR}
+sleep 5
+set conn_type http
+chain --autofree http://boot.netboot.xyz/menu.ipxe || echo ${HTTP_ERR}
+goto localboot
+
+:localboot
+exit
+
+:retry
+goto start
+
+:reboot
+reboot
+goto start
+
+:debug
+echo Type "exit" to return to menu
+shell
+goto failsafe

+ 82 - 0
roles/netbootxyz/templates/disks/netboot.xyz.j2

@@ -0,0 +1,82 @@
+#!ipxe
+set esc:hex 1b
+set bold ${esc:string}[1m
+set boldoff ${esc:string}[22m
+set fg_gre ${esc:string}[32m
+set fg_cya ${esc:string}[36m
+set fg_whi ${esc:string}[37m
+set TFTP_ERR Local TFTP failed... attempting remote HTTPS 
+set HTTPS_ERR HTTPS appears to have failed... attempting HTTP
+set HTTP_ERR HTTP has failed, localbooting...
+set site_name {{ site_name }}
+set boot_domain {{ boot_domain }}
+set version {{ boot_version }}
+
+:start
+echo ${bold}${fg_gre}${site_name} - ${fg_whi}v${version}${boldoff}
+iseq ${site_name} netboot.xyz || echo ${bold}${fg_whi}Powered by ${fg_gre}netboot.xyz${fg_whi}${boldoff}
+prompt --key m --timeout 4000 Hit the ${bold}m${boldoff} key to open failsafe menu... && goto failsafe || goto dhcp
+
+:dhcp
+echo
+dhcp || goto netconfig
+isset ${next-server} && iseq ${filename} {{ site_name }}.kpxe && goto tftpmenu ||
+isset ${next-server} && iseq ${filename} {{ site_name }}.efi && goto tftpmenu ||
+goto menu
+
+:failsafe
+menu ${boot_domain} Failsafe Menu
+item localboot Boot to local drive
+item netconfig Manual network configuration
+item retry Retry boot
+item debug iPXE Debug Shell
+item reboot Reboot System
+choose failsafe_choice || exit
+goto ${failsafe_choice}
+
+:netconfig
+echo Network Configuration:
+echo Available interfaces...
+ifstat
+imgfree
+echo -n Set network interface number [0 for net0, defaults to 0]: ${} && read net
+isset ${net} || set net 0
+echo -n IP: && read net${net}/ip
+echo -n Subnet mask: && read net${net}/netmask
+echo -n Gateway: && read net${net}/gateway
+echo -n DNS: && read dns
+ifopen net${net}
+echo Attempting chainload of ${boot_domain}...
+goto menu || goto failsafe
+
+:tftpmenu
+isset ${hostname} && chain --autofree tftp://${next-server}/HOSTNAME-${hostname}.ipxe || echo Custom boot by Hostname not found trying MAC...
+chain --autofree tftp://${next-server}/MAC-${mac:hexraw}.ipxe || echo Custom boot by MAC not found booting default...
+chain --autofree tftp://${next-server}/menu.ipxe || echo ${TFTP_ERR} && goto menu
+
+:menu
+{% if bootloader_https_enabled | bool %}
+set conn_type https
+chain --autofree https://${boot_domain}/menu.ipxe || echo ${HTTPS_ERR}
+sleep 5
+{% endif %}
+{% if bootloader_http_enabled | bool %}
+set conn_type http
+chain --autofree http://${boot_domain}/menu.ipxe || echo ${HTTP_ERR}
+{% endif %}
+goto localboot
+
+:localboot
+exit
+
+:retry
+goto start
+
+:reboot
+reboot
+goto start
+
+:debug
+echo Type "exit" to return to menu
+shell
+goto failsafe

+ 19 - 0
roles/netbootxyz/templates/index.html.j2

@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <title>{{ site_name }} BootLoaders</title>
+  </head>
+  <body>
+  <div style="font-family: monospace, fixed; font-weight: bold;">
+  <span style="">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;_&#160;&#160;&#160;_&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;_&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><br />
+  <span style="">&#160;_&#160;__&#160;&#160;&#160;___|&#160;|_|&#160;|__&#160;&#160;&#160;___&#160;&#160;&#160;___&#160;|&#160;|_&#160;&#160;__&#160;&#160;___&#160;&#160;&#160;_&#160;____</span><br />
+  <span style="">|&#160;&#39;_&#160;\&#160;/&#160;_&#160;\&#160;__|&#160;&#39;_&#160;\&#160;/&#160;_&#160;\&#160;/&#160;_&#160;\|&#160;__|&#160;\&#160;\/&#160;/&#160;|&#160;|&#160;|_&#160;&#160;/</span><br />
+  <span style="">|&#160;|&#160;|&#160;|&#160;&#160;__/&#160;|_|&#160;|_)&#160;|&#160;(_)&#160;|&#160;(_)&#160;|&#160;|_&#160;_&#160;&gt;&#160;&#160;&lt;|&#160;|_|&#160;|/&#160;/&#160;</span><br />
+  <span style="">|_|&#160;|_|\___|\__|_.__/&#160;\___/&#160;\___/&#160;\__(_)_/\_\\__,&#160;/___|</span><br />
+  <span style="">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;|___/&#160;&#160;&#160;&#160;&#160;</span><br />
+  </div>
+  {% for item in netboot_disks.stdout_lines %}
+  <a href="ipxe/{{ item }}">{{ item }}</a><br>
+  {% endfor %}
+  </body>
+</html>

+ 46 - 0
roles/netbootxyz/templates/menu/alpinelinux.ipxe.j2

@@ -0,0 +1,46 @@
+#!ipxe
+
+# Alpine Linux
+# https://alpinelinux.org
+
+isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${ip}::${gateway}:${netmask}::eth0:none:${dns}
+
+goto ${menu}
+
+:alpinelinux
+clear alpine_version
+set os {{ releases.alpinelinux.name }}
+iseq ${arch} x86_64 && set bootarch x86_64 || set bootarch x86
+menu ${os} [${bootarch}] - Image Sig Checks: [${img_sigs_enabled}]
+item --gap Releases
+{% for item in releases.alpinelinux.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose alpine_version || goto alpine_exit
+goto boot
+
+:boot
+set base-url ${alpinelinux_mirror}
+set dir ${alpinelinux_base_dir}/${alpine_version}/releases/${bootarch}/netboot
+set repo-url ${alpinelinux_mirror}/${alpinelinux_base_dir}/${alpine_version}/main
+imgfree
+kernel ${base-url}/${dir}/vmlinuz-vanilla ${ipparam} alpine_repo=${repo-url} modules=loop,squashfs modloop=${base-url}/${dir}/modloop-vanilla quiet nomodeset
+initrd ${base-url}/${dir}/initramfs-vanilla
+echo
+echo MD5sums:
+md5sum vmlinuz-vanilla initramfs-vanilla
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify vmlinuz-vanilla ${sigs}${dir}/vmlinuz-vanilla.sig || goto error
+imgverify initramfs-vanilla ${sigs}${dir}/initramfs-vanilla.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+goto alpine_exit
+
+:alpine_exit
+clear menu
+exit 0

+ 55 - 0
roles/netbootxyz/templates/menu/archlinux.ipxe.j2

@@ -0,0 +1,55 @@
+#!ipxe
+
+# Arch Linux Operating System
+# http://www.archlinux.org
+
+isset ${dhcp-server} || goto static_ip
+set ipparam BOOTIF=${netX/mac} ip=dhcp
+set real_archlinux_mirror http://${archlinux_mirror}
+goto goto_menu
+
+:static_ip
+# Arch Linux cannot use DNS if booted with a static IP
+# See https://bugs.archlinux.org/task/63174
+# Remove this hack when the above bug is properly resolved
+nslookup real_archlinux_mirror ${archlinux_mirror}
+set ipparam BOOTIF=${netX/mac} ip=${ip}::${gateway}:${netmask}
+
+:goto_menu
+goto ${menu} ||
+
+:archlinux
+set os {{ releases.archlinux.name }}
+clear arch_version
+menu ${os} - ${arch} - Image Sig Checks: [${img_sigs_enabled}]
+item --gap Latest Releases
+{% for item in releases.archlinux.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose arch_version || goto archlinux_exit
+goto boot
+
+:boot
+imgfree
+set dir ${archlinux_base_dir}/iso/${arch_version}/arch/boot
+set params initrd=archiso.img archiso_http_srv=http://${real_archlinux_mirror}/${archlinux_base_dir}/iso/${arch_version}/ archisobasedir=arch verify=y ${ipparam} net.ifnames=0 ${console}
+kernel http://${archlinux_mirror}/${dir}/x86_64/vmlinuz ${params} initrd=archiso.img
+initrd http://${archlinux_mirror}/${dir}/x86_64/archiso.img
+echo
+echo MD5sums:
+md5sum vmlinuz archiso.img
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify vmlinuz ${sigs}${dir}/x86_64/vmlinuz.sig || goto error
+imgverify archiso.img ${sigs}${dir}/x86_64/archiso.img.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+goto archlinux_exit
+
+:archlinux_exit
+clear menu
+exit 0

+ 27 - 0
roles/netbootxyz/templates/menu/blackarch.ipxe.j2

@@ -0,0 +1,27 @@
+#!ipxe
+
+# BlackArch Linux Operating System
+# https://blackarch.org/
+
+goto ${menu}
+
+:blackarch
+set os {{ releases.blackarch.name }}
+menu ${os} Installers
+item --gap Official Releases
+{% for item in releases.blackarch.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose blackarch_version || goto blackarch_exit
+goto blackarch_boot
+
+:blackarch_boot
+set blackarch_initrd http://distro.ibiblio.org/blackarch/iso/blackarch-linux-netinst-${blackarch_version}-x86_64.iso
+kernel ${memdisk} iso raw
+initrd ${blackarch_initrd}
+boot
+goto blackarch_exit
+
+:blackarch_exit
+clear menu
+exit 0

+ 108 - 0
roles/netbootxyz/templates/menu/boot.cfg.j2

@@ -0,0 +1,108 @@
+#!ipxe
+
+:global_vars
+# set site name
+set site_name {{ site_name }}
+
+# set boot domain
+set boot_domain {{ boot_domain }}
+
+# set location of memdisk
+set memdisk {{ memdisk_location }}
+
+# signature check enabled?
+set sigs_enabled {{ sigs_enabled | default(false) | bool }}
+
+# image signatures check enabled?
+set img_sigs_enabled {{ img_sigs_enabled | default(false) | bool }}
+
+# set location of signatures for sources
+set sigs {{ sigs_location }}
+
+# set location of latest iPXE
+set ipxe_disk netboot.xyz-undionly.kpxe
+
+# set location of custom netboot.xyz live assets
+set live_endpoint {{ live_endpoint }}
+
+##################
+# official mirrors
+##################
+:mirrors
+{% for key, value in releases.items() | sort(attribute='1.name') %}
+{% if value.mirror is defined and value.base_dir is defined %}
+### {{ value.name }}
+set {{ key }}_mirror {{ value.mirror }}
+set {{ key }}_base_dir {{ value.base_dir }}
+
+{% endif %}
+{% endfor %}
+#################################################
+# determine architectures and enable menu options
+#################################################
+:architectures
+set menu_linux 1
+set menu_bsd 1
+set menu_freedos 1
+set menu_live 1
+set menu_security 1
+set menu_windows 1
+set menu_utils 1
+iseq ${buildarch} i386 && goto x86_64 ||
+iseq ${buildarch} x86_64 && goto x86_64 ||
+iseq ${buildarch} arm64 && goto arm64 ||
+goto architectures_end
+:x86_64
+goto architectures_end
+:arm64
+set menu_freedos 0
+set menu_live 0
+set menu_security 0
+set menu_windows 0
+set menu_utils 0
+goto architectures_end
+:architectures_end
+goto clouds
+
+###################################
+# set iPXE cloud provider specifics
+###################################
+:clouds
+iseq ${ipxe_cloud_config} gce && goto gce ||
+iseq ${ipxe_cloud_config} packet && goto packet ||
+goto clouds_end
+
+:gce
+set console console=ttyS0,115200n8
+goto clouds_end
+
+:packet
+iseq ${buildarch} i386 && goto packet_x86_64 ||
+iseq ${buildarch} x86_64 && goto packet_x86_64 ||
+iseq ${buildarch} arm64 && goto packet_arm64 ||
+goto clouds_end
+
+:packet_x86_64
+set console console=ttyS1,115200n8
+iseq ${platform} efi && set ipxe_disk netboot.xyz-packet.efi || set ipxe_disk netboot.xyz-packet.kpxe
+set menu_freedos 0
+set menu_windows 0
+set menu_utils 0
+goto clouds_end
+
+:packet_arm64
+set console console=ttyAMA0,115200
+set ipxe_disk netboot.xyz-packet-arm64.efi
+set menu_bsd 0
+set menu_freedos 0
+set menu_live 0
+set menu_security 0
+set menu_windows 0
+set menu_utils 0
+goto clouds_end
+
+:clouds_end
+goto end
+
+:end
+exit

+ 41 - 0
roles/netbootxyz/templates/menu/bsd.ipxe.j2

@@ -0,0 +1,41 @@
+#!ipxe
+
+goto ${menu} ||
+
+:bsd_menu
+
+menu BSD Installers - Current Selected Architecture [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+
+# BSD based systems
+item --gap BSD Based Operating Systems
+{% for key, value in releases.items() | sort(attribute='1.name') %}
+{% if value.enabled is defined and value.menu == "bsd" and value.enabled | bool %}
+item {{ key }} ${space} {{ value.name }}
+{% endif %}
+{% endfor %}
+# Options
+item --gap Options:
+iseq ${arch} x86_64 && set bits 64 || set bits 32
+item changebits ${space} Architecture: ${arch} (${bits}bit)
+choose menu || goto bsd_exit
+
+echo ${cls}
+goto ${menu} ||
+iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
+
+:verify_sigs
+imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
+goto change_menu
+
+:change_menu
+chain ${menu}.ipxe || goto error
+goto bsd_menu
+
+:bsd_exit
+clear menu
+exit 0
+
+:changebits
+iseq ${arch} x86_64 && set arch i386 || set arch x86_64
+goto bsd_menu

+ 83 - 0
roles/netbootxyz/templates/menu/centos.ipxe.j2

@@ -0,0 +1,83 @@
+#!ipxe
+
+# CentOS Operating System
+# http://www.centos.org
+
+isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${ip}::${gateway}:${netmask}:::none nameserver=${dns}
+set ipparam BOOTIF=${netX/mac} ${ipparam}
+
+goto ${menu} ||
+
+:centos
+clear osversion
+set os {{ releases.centos.name }}
+menu ${os} - ${arch} - Image Sig Checks: [${img_sigs_enabled}]
+{% for item in releases.centos.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+isset ${osversion} || choose osversion || goto linux_menu
+echo ${cls}
+set dir ${centos_base_dir}/${osversion}/BaseOS/${arch}/os
+iseq ${osversion} 7.7.1908 && set dir ${centos_base_dir}/${osversion}/os/${arch} ||
+set repo ${centos_mirror}/${centos_base_dir}
+goto boottype
+
+:boottype
+set ova ${os} ${osversion}
+menu ${os} ${arch} boot type
+item graphical ${ova} graphical installer
+item text ${ova} text based installer
+item rescue ${ova} rescue
+item kickstart ${ova} set kickstart url [ ${ksurl} ]
+item kickstart_device ${ova} set ksdevice [ ${ksdevice} ]
+isset ${bt} || choose bt || goto centos
+echo ${cls}
+iseq ${bt} text && goto text ||
+iseq ${bt} rescue && goto rescue ||
+iseq ${bt} kickstart && goto kickstart ||
+iseq ${bt} kickstart_device && goto kickstart_device ||
+goto bootos_images
+
+:text
+set params text ||
+goto bootos_images
+
+:rescue
+set params rescue ||
+goto bootos_images
+
+:kickstart
+echo -n Specify kickstart URL for ${os} ${osversion}: && read ksurl
+set params ks=${ksurl} ||
+clear bt
+goto boottype
+
+:kickstart_device
+echo -n Specify ksdevice param for ${os} ${osversion}: && read ksdevice
+set ksdevice ${ksdevice} ||
+clear bt
+goto boottype
+
+:bootos_images
+imgfree
+kernel ${centos_mirror}/${dir}/images/pxeboot/vmlinuz repo=${repo} ${params} ${console} ${ipparam} initrd=initrd.img
+initrd ${centos_mirror}/${dir}/images/pxeboot/initrd.img
+echo
+echo MD5sums:
+md5sum vmlinuz initrd.img
+iseq ${osversion} 8-stream && echo Rolling release, skipping sig checks && goto skip_sigs ||
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify vmlinuz ${sigs}${dir}/images/pxeboot/vmlinuz.sig || goto error
+imgverify initrd.img ${sigs}${dir}/images/pxeboot/initrd.img.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+goto linux_menu
+
+:linux_menu
+clear menu
+exit 0

+ 47 - 0
roles/netbootxyz/templates/menu/coreos.ipxe.j2

@@ -0,0 +1,47 @@
+#!ipxe
+
+# Fedora CoreOS (Preview)
+# https://getfedora.org/coreos/
+
+goto ${menu}
+
+:coreos
+set os {{ releases.coreos.name }}
+isset ${install_device} || set install_device sda
+isset ${ignition_url} || set ignition_url skip
+menu ${os}
+item --gap ${os}:
+{% for item in releases.coreos.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+item install_dev ${space} Set install device: ${install_device}
+item ignition_config ${space} Set ignition config url: ${ignition_url}
+choose --default ${menu} menu || goto coreos_exit
+echo ${cls}
+goto ${menu} ||
+goto coreos_exit
+
+:stable
+:beta
+:alpha
+set release ${menu}
+set base_url ${coreos_mirror}/${coreos_base_dir}
+set build_version 30.20191014.0
+kernel ${base_url}/${build_version}/x86_64/fedora-coreos-${build_version}-installer-kernel nomodeset rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=${install_device} coreos.inst.ignition_url=${ignition_url} ${console} coreos.inst.image_url=${base_url}/${build_version}/x86_64/fedora-coreos-${build_version}-metal.raw.xz initrd=fedora-coreos-${build_version}-installer-initramfs.img
+initrd ${base_url}/${build_version}/x86_64/fedora-coreos-${build_version}-installer-initramfs.img
+boot
+goto coreos_exit
+
+:install_dev
+echo -n Please set desired install device:  && read install_device
+clear menu
+goto coreos
+
+:ignition_config
+echo -n Please set Ignition Configuration URL:  && read ignition_url
+clear menu
+goto coreos
+
+:coreos_exit
+clear menu
+exit 0

+ 99 - 0
roles/netbootxyz/templates/menu/debian.ipxe.j2

@@ -0,0 +1,99 @@
+#!ipxe
+
+# Debian Operating System
+# http://www.debian.org
+
+goto ${menu}
+
+:debian
+set os Debian
+clear debian_version
+clear older_release
+menu ${os} - ${arch_a} - Image Sig Checks: [${img_sigs_enabled}]
+item --gap Latest Releases
+{% for item in releases.debian.versions.stable %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+item --gap Testing Releases
+{% for item in releases.debian.versions.testing %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+item --gap Older Releases
+item older_release ${space} Set release codename...
+choose debian_version || goto debian_exit
+iseq ${debian_version} older_release && goto older_release ||
+goto mirrorcfg
+
+:older_release
+set older_release true
+set debian_mirror {{ releases.debian.archive_mirror }}
+echo Setting mirror to ${debian_mirror}
+clear debian_version
+echo -n Please set enter code name of release: ${} && read debian_version
+set dir ${debian_base_dir}/dists/${debian_version}/main/installer-${arch_a}/current/images/netboot/
+goto deb_boot_type
+
+:mirrorcfg
+set debian_mirror ${debian_mirror}
+set mirrorcfg mirror/suite=${debian_version}
+set dir ${debian_base_dir}/dists/${debian_version}/main/installer-${arch_a}/current/images/netboot/
+goto deb_boot_type
+
+:deb_boot_type
+menu ${os} [${debian_version}] Installer
+item --gap Install types
+item text ${space} Text Based Install
+item graphical ${space} Graphical Based Install
+item rescue ${space} Rescue Mode
+item expert ${space} Expert Install
+item preseed ${space} Specify preseed url...
+choose --default ${type} type || goto debian
+
+echo ${cls}
+goto deb_${type}
+
+:deb_rescue
+set install_params rescue/enable=true
+goto deb_text
+
+:deb_expert
+set install_params priority=low
+goto deb_text
+
+:deb_preseed
+echo -n Specify preseed URL for ${os} ${debian_version}: && read preseedurl
+set install_params auto=true priority=critical preseed/url=${preseedurl}
+goto deb_text
+
+:deb_text
+set dir ${dir}${menu}-installer/${arch_a}
+goto deb_boot
+
+:deb_graphical
+set dir ${dir}gtk/${menu}-installer/${arch_a}
+set install_params vga=788
+goto deb_boot
+
+:deb_boot
+imgfree
+echo Boot parameters: ${install_params} -- quiet ${params}
+kernel ${debian_mirror}/${dir}/linux ${install_params} ${netcfg} ${mirrorcfg} ${console} -- quiet ${params} initrd=initrd.gz
+initrd ${debian_mirror}/${dir}/initrd.gz
+echo
+echo MD5sums:
+md5sum linux initrd.gz
+iseq ${img_sigs_enabled} true && iseq ${older_release} true && goto skip_sigs ||
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify linux ${sigs}${dir}/linux.sig || goto error
+imgverify initrd.gz ${sigs}${dir}/initrd.gz.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+
+:debian_exit
+clear menu
+exit 0

+ 86 - 0
roles/netbootxyz/templates/menu/devuan.ipxe.j2

@@ -0,0 +1,86 @@
+#!ipxe
+
+# Devuan Operating System
+# http://www.devuan.org
+
+goto ${menu}
+
+:devuan
+set os Devuan
+clear devuan_version
+clear older_release
+menu ${os} - ${arch_a} - Image Sig Checks: [${img_sigs_enabled}]
+item --gap Latest Releases
+{% for item in releases.devuan.versions.stable %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+item --gap Testing Releases
+{% for item in releases.devuan.versions.testing %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose devuan_version || goto devuan_exit
+goto mirrorcfg
+
+:mirrorcfg
+set mirrorcfg mirror/suite=${devuan_version}
+set dir ${devuan_base_dir}/dists/${devuan_version}/main/installer-${arch_a}/current/images/netboot/
+goto devuan_boot_type
+
+:devuan_boot_type
+menu ${os} [${devuan_version}] Installer
+item --gap Install types
+item text ${space} Text Based Install
+item graphical ${space} Graphical Based Install
+item rescue ${space} Rescue Mode
+item expert ${space} Expert Install
+item preseed ${space} Specify preseed url...
+choose --default ${type} type || goto devuan
+
+echo ${cls}
+goto devuan_${type}
+
+:devuan_rescue
+set install_params rescue/enable=true
+goto devuan_text
+
+:devuan_expert
+set install_params priority=low
+goto devuan_text
+
+:devuan_preseed
+echo -n Specify preseed URL for ${os} ${devuan_version}: && read preseedurl
+set install_params auto=true priority=critical preseed/url=${preseedurl}
+goto devuan_text
+
+:devuan_text
+set dir ${dir}debian-installer/${arch_a}
+goto devuan_boot
+
+:devuan_graphical
+set dir ${dir}gtk/debian-installer/${arch_a}
+set install_params vga=788
+goto devuan_boot
+
+:devuan_boot
+imgfree
+echo Boot parameters: ${install_params} -- quiet ${params}
+kernel ${devuan_mirror}/${dir}/linux ${install_params} ${mirrorcfg} ${console} -- quiet ${params} initrd=initrd.gz
+initrd ${devuan_mirror}/${dir}/initrd.gz
+echo
+echo MD5sums:
+md5sum linux initrd.gz
+iseq ${img_sigs_enabled} true && iseq ${older_release} true && goto skip_sigs ||
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify linux ${sigs}${dir}/linux.sig || goto error
+imgverify initrd.gz ${sigs}${dir}/initrd.gz.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+
+:devuan_exit
+clear menu
+exit 0

+ 83 - 0
roles/netbootxyz/templates/menu/fedora.ipxe.j2

@@ -0,0 +1,83 @@
+#!ipxe
+
+# Fedora Operating System
+# https://getfedora.org/
+
+isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${ip}::${gateway}:${netmask}:::none nameserver=${dns}
+set ipparam BOOTIF=${netX/mac} ${ipparam}
+
+goto ${menu} ||
+
+:fedora
+clear osversion
+clear sku_type
+clear ova
+set os {{ releases.fedora.name }}
+menu ${os} - ${arch} - Image Sig Checks: [${img_sigs_enabled}]
+item --gap Latest Releases
+{% for item in releases.fedora.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+iseq ${arch} x86_64 && item rawhide ${space} ${os} rawhide ||
+isset ${osversion} || choose osversion || goto linux_menu
+set ova ${os} ${osversion}
+goto product_sku
+
+:product_sku
+menu ${os} ${arch} sku type
+item Everything ${ova} Everything
+item Server ${ova} Server
+item Workstation ${ova} Workstation
+item Atomic ${ova} Atomic
+iseq ${arch} x86_64 && item Silverblue ${ova} Silverblue ||
+isset ${sku_type} || choose sku_type || goto fedora
+set dir ${fedora_base_dir}/releases/${osversion}/${sku_type}/${arch}/os
+iseq ${osversion} rawhide && set dir ${fedora_base_dir}/development/${osversion}/${sku_type}/${arch}/os ||
+iseq ${sku_type} Atomic && iseq ${osversion} 29 && set dir fedora-alt/atomic/stable/Fedora-Atomic-29-20181025.1/AtomicHost/x86_64/os ||
+set ova ${ova} ${sku_type}
+echo ${cls}
+goto boottype
+
+:boottype
+menu ${os} ${arch} boot type
+item normal ${ova} install
+item rescue ${ova} rescue
+item kickstart ${ova} specify kickstart url
+isset ${bt} || choose bt || goto fedora
+echo ${cls}
+iseq ${bt} rescue && goto rescue ||
+iseq ${bt} kickstart && goto kickstart ||
+goto boot
+
+:rescue
+set params rescue ||
+goto boot
+
+:kickstart
+echo -n Specify kickstart URL for ${os} ${osversion}: && read ksurl
+set params ks=${ksurl} ||
+goto boot
+
+:boot
+imgfree
+kernel ${fedora_mirror}/${dir}/images/pxeboot/vmlinuz repo=${fedora_mirror}/${dir} ${params} ${console} ${ipparam} initrd=initrd.img
+initrd ${fedora_mirror}/${dir}/images/pxeboot/initrd.img
+echo
+echo MD5sums:
+md5sum vmlinuz initrd.img
+iseq ${osversion} rawhide && goto skip_sigs ||
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify vmlinuz ${sigs}${dir}/images/pxeboot/vmlinuz.sig || goto error
+imgverify initrd.img ${sigs}${dir}/images/pxeboot/initrd.img.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+goto linux_menu
+
+:linux_menu
+clear menu
+exit 0

+ 45 - 0
roles/netbootxyz/templates/menu/flatcar.ipxe.j2

@@ -0,0 +1,45 @@
+#!ipxe
+
+# Container Linux by flatcar
+# https://www.flatcar.com
+# For further info on:
+# iPXE and flatcar Container Linux: https://docs.flatcar-linux.org/os/booting-with-ipxe/
+# Setting up Ignition: https://docs.flatcar-linux.org/os/provisioning/
+# 64-bit only
+
+goto ${menu}
+
+:flatcar
+set os {{ releases.flatcar.name }}
+menu ${os}
+item --gap ${os}
+{% for item in releases.flatcar.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+item ignition_config ${space} Set flatcar.config.url: ${flatcar.config.url}
+choose --default ${menu} menu || goto flatcar_exit
+echo ${cls}
+goto ${menu} ||
+goto flatcar_exit
+
+:stable
+:beta
+:alpha
+:edge
+set release ${menu}
+set base-url http://${release}.release.flatcar-linux.net/amd64-usr/current
+kernel ${base-url}/flatcar_production_pxe.vmlinuz ${flatcar_firstboot} ${flatcar_params} ${console} flatcar.autologin=tty1 flatcar.autologin=ttyS0 initrd=flatcar_production_pxe_image.cpio.gz
+initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
+boot
+goto flatcar_exit
+
+:ignition_config
+echo -n Please set Ignition URL: && read flatcar.config.url
+set flatcar_params flatcar.config.url=${flatcar.config.url}
+set flatcar_firstboot flatcar.first_boot=1
+clear menu
+goto flatcar
+
+:flatcar_exit
+clear menu
+exit 0

+ 47 - 0
roles/netbootxyz/templates/menu/freebsd.ipxe.j2

@@ -0,0 +1,47 @@
+#!ipxe
+
+# FreeBSD Operating System
+# http://www.freebsd.org
+
+:freebsd_menu
+set os {{ releases.freebsd.name }}
+menu ${os}
+{% for item in releases.freebsd.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose ver || goto freebsd_exit
+
+{% for item in releases.freebsd.versions %}
+iseq ${ver} {{ item.code_name }} && set image_ver {{ item.code_name }}-RELEASE ||
+{% endfor %}
+
+iseq ${arch} x86_64 && goto freebsd_x64 ||
+set freebsd_arch i386
+goto boot_freebsd
+
+:freebsd_x64
+set freebsd_arch amd64
+goto boot_freebsd
+
+:boot_freebsd
+{% for item in releases.freebsd.versions %}
+iseq ${ver} {{ item.code_name }} && set image_subdir {{ item.image_subdir }}/${freebsd_arch} ||
+{% endfor %}
+set src https://mfsbsd.vx.sk/files/images/${image_subdir}/mfsbsd-${image_ver}-${freebsd_arch}.img
+imgfree
+echo This loads an mfsbsd installer (http://mfsbsd.vx.sk/).
+echo Root password for all images: mfsroot
+echo You'll need to configure networking manually for the installer disk as
+echo it uses dhcp by default:
+echo ifconfig xn0 inet <public ip> netmask 255.255.255.0
+echo route delete default; route add default <public ip x.x.x.1>
+echo echo "nameserver x.x.x.x" > /etc/resolv.conf
+echo Once network is configured, you can launch the usual installer:
+echo bsdinstall
+initrd ${src}
+chain ${memdisk} harddisk raw
+exit
+
+:freebsd_exit
+clear menu
+exit 0

+ 25 - 0
roles/netbootxyz/templates/menu/freedos.ipxe.j2

@@ -0,0 +1,25 @@
+#!ipxe
+
+# FreeDOS Operating System
+# http://www.freedos.org
+
+:freedos_menu
+set os {{ releases.freedos.name }}
+menu ${os}
+item --gap ${os}
+{% for item in releases.freedos.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose freedos_version || goto freedos_exit
+echo ${cls}
+goto freedos_install || goto freedos_exit
+
+:freedos_install
+imgfree
+kernel ${memdisk}
+initrd ${freedos_mirror}/${freedos_base_dir}/${freedos_version}.zip
+boot
+
+:freedos_exit
+clear menu
+exit 0

+ 32 - 0
roles/netbootxyz/templates/menu/gentoo.ipxe.j2

@@ -0,0 +1,32 @@
+#!ipxe
+
+# Gentoo Operating System
+# http://www.gentoo.org
+
+# Note: in order to boot Gentoo via iPXE, the method at http://blog.dastrup.com/?p=12 has been utilized to 
+# to allow for the Gentoo minimal disk to boot.  I've regenerated the latest boot disks and have put
+# them on https://sourceforge.net/projects/netboot-xyz/files/distros/gentoo/amd64/20160204/
+
+goto ${menu}
+
+:gentoo
+set os {{ releases.gentoo.name }}
+menu ${os} ${arch_a}
+{% for item in releases.gentoo.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose gentoo_version || goto gentoo_exit
+goto ${gentoo_version}
+
+:20160204
+set gentoopath https://master.dl.sourceforge.net/project/netboot-xyz/distros/gentoo/amd64/20160204
+echo Please note the gentoo ISO has been regenerated to work with iPXE
+echo using the method here: http://blog.dastrup.com/?p=12
+kernel --name gentoo-kernel ${gentoopath}/kernel root=/dev/ram0 init=/linuxrc loop=/image.squashfs looptype=squashfs cdroot=1 real_root=/ ${console}
+initrd --name gentoo-initrd.img ${gentoopath}/initrd
+boot
+goto gentoo
+
+:gentoo_exit
+clear menu
+chain linux.ipxe

+ 40 - 0
roles/netbootxyz/templates/menu/ipfire.ipxe.j2

@@ -0,0 +1,40 @@
+#!ipxe
+
+# IPFire
+# https://www.ipfire.org/
+
+goto ${menu} ||
+
+:ipfire
+clear osversion
+set os {{ releases.ipfire.name }}
+menu ${os} - Image Sig Checks: [${img_sigs_enabled}]
+{% for item in releases.ipfire.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+isset ${osversion} || choose osversion || goto linux_menu
+echo ${cls}
+set dir ${ipfire_base_dir}/${osversion}/images/x86_64
+goto ipfire_images
+
+:ipfire_images
+imgfree
+kernel ${ipfire_mirror}/${dir}/vmlinuz ${console} vga=791 initrd=instroot
+initrd ${ipfire_mirror}/${dir}/instroot
+echo
+echo MD5sums:
+md5sum vmlinuz instroot
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify vmlinuz ${sigs}ipfire/${dir}/vmlinuz.sig || goto error
+imgverify instroot ${sigs}ipfire/${dir}/instroot.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+
+:ipfire_exit
+clear menu
+exit 0

+ 40 - 0
roles/netbootxyz/templates/menu/kali.ipxe.j2

@@ -0,0 +1,40 @@
+#!ipxe
+
+# Kali Linux
+# http://www.kali.org
+
+goto ${menu} ||
+
+:kali
+set os {{ releases.kali.name }}
+menu ${os} - ${arch_a}
+{% for item in releases.kali.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose version || goto kali_exit
+
+:deb_boot_type
+set dir ${kali_base_dir}/dists/kali-${version}/main/installer-${arch_a}/current/images/netboot
+menu ${os} boot parameters
+item text ${os} text based install
+choose --default ${type} type || goto kali
+
+echo ${cls}
+goto deb_${type}
+
+:deb_text
+set dir ${dir}/debian-installer/${arch_a}
+goto deb_boot
+
+:deb_boot
+imgfree
+kernel ${kali_mirror}/${dir}/linux vga=788 ${console} -- quiet initrd=initrd.gz
+initrd ${kali_mirror}/${dir}/initrd.gz
+echo
+echo MD5sums:
+md5sum linux initrd.gz
+boot
+
+:kali_exit
+clear menu
+exit 0

+ 30 - 0
roles/netbootxyz/templates/menu/linux.ipxe.j2

@@ -0,0 +1,30 @@
+#!ipxe
+
+goto ${menu} ||
+
+:linux_menu
+menu Linux Installers - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap Popular Linux Operating Systems:
+{% for key, value in releases.items() | sort(attribute='1.name') %}
+{% if value.enabled is defined and value.menu == "linux" and value.enabled | bool %}
+item {{ key }} ${space} {{ value.name }}
+{% endif %}
+{% endfor %}
+item --gap All Others:
+choose menu || goto linux_exit
+echo ${cls}
+goto ${menu} ||
+iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
+
+:verify_sigs
+imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
+goto change_menu
+
+:change_menu
+chain ${menu}.ipxe || goto error
+goto linux_menu
+
+:linux_exit
+clear menu
+exit 0

+ 37 - 0
roles/netbootxyz/templates/menu/live-backbox.ipxe.j2

@@ -0,0 +1,37 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os BackBox
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item 6 ${space} ${os} 6
+choose live_version || goto live_exit
+goto ${live_version}
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "BackBox" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ value.version }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto {{ value.version }}-boot
+{% endif %}
+{% endfor %}
+
+:6-boot
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=http fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0
+

+ 59 - 0
roles/netbootxyz/templates/menu/live-debian.ipxe.j2

@@ -0,0 +1,59 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Debian Live
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item buster ${space} ${os} 10 (buster)
+choose live_version || goto live_exit
+menu ${os} ${live_version}
+item --gap ${os} Flavors
+goto ${live_version}
+
+:stretch
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "debian" and 'squash' in key and value.version == "9" %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version }} {{ value.flavor | title}}
+{% endif %}
+{% endfor %}
+goto flavor_select
+
+:buster
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "debian" and 'squash' in key and value.version == "10" %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version }} {{ value.flavor | title}}
+{% endif %}
+{% endfor %}
+goto flavor_select
+
+:flavor_select
+choose flavor || goto live_menu
+echo ${cls}
+goto ${flavor} ||
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "debian" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ key }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+goto boot
+{% endif %}
+{% endfor %}
+{% endif %}
+{% endfor %}
+
+:boot
+imgfree
+kernel ${kernel_url}vmlinuz boot=live fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0

+ 36 - 0
roles/netbootxyz/templates/menu/live-elementary.ipxe.j2

@@ -0,0 +1,36 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os elementary OS
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item elementaryos-5-default-squash ${space} ${os} 5 (Juno)
+choose live_version || goto live_exit
+goto ${live_version}
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "elementary-os" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ key }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto boot
+{% endif %}
+{% endfor %}
+
+:boot
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=http fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0

+ 49 - 0
roles/netbootxyz/templates/menu/live-fedora.ipxe.j2

@@ -0,0 +1,49 @@
+#!ipxe
+
+isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${ip}::${gateway}:${netmask}:::none nameserver=${dns}
+set ipparam BOOTIF=${netX/mac} ${ipparam}
+
+goto ${menu} ||
+
+:live_menu
+set os Fedora Live
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item 31 ${space} ${os} 31
+choose live_version || goto live_exit
+menu ${os} ${live_version}
+item --gap ${os} Flavors
+goto ${live_version}
+
+:31
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "fedora" and value.version == 31 %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version }} {{ value.flavor | title}}
+{% endif %}
+{% endfor %}
+goto flavor_select
+
+:flavor_select
+choose flavor || goto live_menu
+echo ${cls}
+goto ${flavor} ||
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "fedora" %}
+:{{ key }}
+set live_url ${live_endpoint}{{ value.path }}
+goto boot
+{% endif %}
+{% endfor %}
+
+:boot
+imgfree
+kernel ${live_url}vmlinuz ${ipparam} root=live:${live_url}squashfs.img ro rd.live.image rd.lvm=0 rd.luks=0 rd.md=0 rd.dm=0 initrd=initrd
+initrd ${live_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0
+

+ 52 - 0
roles/netbootxyz/templates/menu/live-kali.ipxe.j2

@@ -0,0 +1,52 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Kali Linux
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item rolling ${space} ${os} Rolling
+choose live_version || goto live_exit
+menu ${os} ${live_version}
+item --gap ${os} Flavors
+goto ${live_version}
+
+:rolling
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "kali" and 'squash' in key and value.version == "rolling" %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version | title }} {{ value.flavor | upper }}
+{% endif %}
+{% endfor %}
+goto flavor_select
+
+:flavor_select
+choose flavor || goto live_menu
+echo ${cls}
+goto ${flavor} ||
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "kali" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ key }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto boot
+{% endif %}
+{% endfor %}
+
+:boot
+imgfree
+kernel ${kernel_url}vmlinuz boot=live components username=root hostname=kali fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0
+

+ 44 - 0
roles/netbootxyz/templates/menu/live-manjaro.ipxe.j2

@@ -0,0 +1,44 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+menu Manjaro Live - Current Arch [ ${arch} ]
+item --gap Currently during boot you need to press ctrl+d/ctrl+c
+item --gap repeatedly when init hangs on starting a download
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap Manjaro Live
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "manjaro" and 'squash' in key %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version }} {{ value.flavor | title}}
+{% endif %}
+{% endfor %}
+choose menu || goto live_exit
+echo ${cls}
+goto ${menu} ||
+iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "manjaro" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ key }}
+imgfree
+set fetch_url ${live_endpoint}{{ value.path }}
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+kernel ${live_endpoint}{{ value.path }}vmlinuz misobasedir=manjaro ip=dhcp miso_http_srv=${fetch_url} nouveau.modeset=1 i915.modeset=1 radeon.modeset=1 driver=free tz=UTC lang=en_US keytable=us systemdshow_status=1 apparmor=1 security=apparmor
+initrd ${live_endpoint}{{ value.path }}initrd
+boot
+{% endif %}
+{% endfor %}
+{% endif %}
+{% endfor %}
+
+:change_menu
+chain ${menu}.ipxe || goto error
+goto live_menu
+
+:live_exit
+clear menu
+exit 0
+

+ 52 - 0
roles/netbootxyz/templates/menu/live-mint.ipxe.j2

@@ -0,0 +1,52 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Mint Live
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item 19 ${space} ${os} 19
+choose live_version || goto live_exit
+menu ${os} ${live_version}
+item --gap ${os} Flavors
+goto ${live_version}
+
+:19
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "mint" and 'squash' in key and value.version == "19" %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version }} {{ value.flavor | title}}
+{% endif %}
+{% endfor %}
+goto flavor_select
+
+:flavor_select
+choose flavor || goto live_menu
+echo ${cls}
+goto ${flavor} ||
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "mint" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ key }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto {{ value.version }}-boot
+{% endif %}
+{% endfor %}
+
+:19-boot
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=http fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0
+

+ 37 - 0
roles/netbootxyz/templates/menu/live-peppermint.ipxe.j2

@@ -0,0 +1,37 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Peppermint
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item 10 ${space} ${os} 10
+choose live_version || goto live_exit
+goto ${live_version}
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "peppermint" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ value.version }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto {{ value.version }}-boot
+{% endif %}
+{% endfor %}
+
+:10-boot
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=http fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0
+

+ 44 - 0
roles/netbootxyz/templates/menu/live-popos.ipxe.j2

@@ -0,0 +1,44 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Pop OS
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item 18.04 ${space} ${os} 18.04
+item 19.10 ${space} ${os} 19.10
+choose live_version || goto live_exit
+goto ${live_version}
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "pop" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ value.version }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto {{ value.version }}-boot
+{% endif %}
+{% endfor %}
+
+:18.04-boot
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=http fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:19.10-boot
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=url url=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0
+

+ 52 - 0
roles/netbootxyz/templates/menu/live-q4os.ipxe.j2

@@ -0,0 +1,52 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Q4OS Live
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item 3.9 ${space} ${os} 3.9
+choose live_version || goto live_exit
+menu ${os} ${live_version}
+item --gap ${os} Flavors
+goto ${live_version}
+
+:3.9
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "Q4OS" and 'squash' in key and value.version == "3.9" %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version }} {{ value.flavor | title}}
+{% endif %}
+{% endfor %}
+goto flavor_select
+
+:flavor_select
+choose flavor || goto live_menu
+echo ${cls}
+goto ${flavor} ||
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "Q4OS" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ key }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto {{ value.version }}-boot
+{% endif %}
+{% endfor %}
+
+:3.9-boot
+imgfree
+kernel ${kernel_url}vmlinuz boot=live fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0
+

+ 37 - 0
roles/netbootxyz/templates/menu/live-tails.ipxe.j2

@@ -0,0 +1,37 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Tails
+menu ${os} - Current Arch [ ${arch} ]
+item --gap Currently networking is not functional for this live image
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item tails-4.0-default-squash ${space} ${os} 4.0
+choose live_version || goto live_exit
+goto ${live_version}
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "tails" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ key }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto boot
+{% endif %}
+{% endfor %}
+
+:boot
+imgfree
+kernel ${kernel_url}vmlinuz boot=live fetch=${squash_url} initrd=initrd nopersistence noprompt timezone=Etc/UTC block.events_dfl_poll_msecs=1000 splash noautologin module=Tails slab_nomerge slub_debug=FZP mce=0 vsyscall=none page_poison=1 mds=full,nosmt union=aufs
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0

+ 67 - 0
roles/netbootxyz/templates/menu/live-ubuntu.ipxe.j2

@@ -0,0 +1,67 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Ubuntu Live
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item bionic ${space} ${os} 18.04
+item eoan ${space} ${os} 19.10
+choose live_version || goto live_exit
+menu ${os} ${live_version}
+item --gap ${os} Flavors
+goto ${live_version}
+
+:bionic
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "ubuntu" and 'squash' in key and value.version == "18.04" %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version }} {{ value.flavor | title}}
+{% endif %}
+{% endfor %}
+goto flavor_select
+
+:eoan
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "ubuntu" and 'squash' in key and value.version == "19.10" %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version }} {{ value.flavor | title}}
+{% endif %}
+{% endfor %}
+goto flavor_select
+
+:flavor_select
+choose flavor || goto live_menu
+echo ${cls}
+goto ${flavor} ||
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "ubuntu" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ key }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto {{ value.version }}-boot
+{% endif %}
+{% endfor %}
+
+:18.04-boot
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=http fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:19.10-boot
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=url url=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0
+

+ 41 - 0
roles/netbootxyz/templates/menu/live-voyager.ipxe.j2

@@ -0,0 +1,41 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Voyager Live
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item bionic ${space} ${os} Bionic
+item buster ${space} ${os} Buster
+item eoan ${space} ${os} Eoan
+choose live_version || goto live_exit
+
+:bionic
+set squash_url ${live_endpoint}{{ endpoints["voyager-bionic-squash"].path }}filesystem.squashfs
+set kernel_url ${live_endpoint}{{ endpoints["ubuntu-18.04-live-kernel"].path }}
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=http fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:buster
+set squash_url ${live_endpoint}{{ endpoints["voyager-buster-squash"].path }}filesystem.squashfs
+set kernel_url ${live_endpoint}{{ endpoints["debian-10-live-kernel"].path }}
+imgfree
+kernel ${kernel_url}vmlinuz boot=live fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:eoan
+set squash_url ${live_endpoint}{{ endpoints["voyager-eoan-squash"].path }}filesystem.squashfs
+set kernel_url ${live_endpoint}{{ endpoints["ubuntu-19.10-live-kernel"].path }}
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=url url=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0

+ 52 - 0
roles/netbootxyz/templates/menu/live-zorin.ipxe.j2

@@ -0,0 +1,52 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+set os Zorin Live
+menu ${os} - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap ${os} Versions
+item 15 ${space} ${os} 15
+choose live_version || goto live_exit
+menu ${os} ${live_version}
+item --gap ${os} Flavors
+goto ${live_version}
+
+:15
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "zorin" and 'squash' in key and value.version == "15" %}
+item {{ key }} ${space} {{ value.os | title }} {{ value.version }} {{ value.flavor | title}}
+{% endif %}
+{% endfor %}
+goto flavor_select
+
+:flavor_select
+choose flavor || goto live_menu
+echo ${cls}
+goto ${flavor} ||
+
+{% for key, value in endpoints.items() | sort %}
+{% if value.os == "zorin" and 'squash' in key %}
+{% set kernel_name = value.kernel %}
+:{{ key }}
+set squash_url ${live_endpoint}{{ value.path }}filesystem.squashfs
+{% for key, value in endpoints.items() | sort %}
+{% if key == kernel_name %}
+set kernel_url ${live_endpoint}{{ value.path }}
+{% endif %}
+{% endfor %}
+goto {{ value.version }}-boot
+{% endif %}
+{% endfor %}
+
+:15-boot
+imgfree
+kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=http fetch=${squash_url} initrd=initrd
+initrd ${kernel_url}initrd
+boot
+
+:live_exit
+clear menu
+exit 0
+

+ 38 - 0
roles/netbootxyz/templates/menu/live.ipxe.j2

@@ -0,0 +1,38 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+menu Live Boot Distributions - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap Live Boot Distributions
+item live-backbox ${space} BackBox
+item live-debian ${space} Debian
+item live-elementary ${space} elementary OS
+item live-fedora ${space} Fedora
+item live-kali ${space} Kali
+item live-q4os ${space} Q4OS
+item live-manjaro ${space} Manjaro
+item live-mint ${space} Mint
+item live-peppermint ${space} Peppermint
+item live-popos ${space} Pop OS
+item live-tails ${space} Tails
+item live-ubuntu ${space} Ubuntu
+item live-voyager ${space} Voyager
+item live-zorin ${space} Zorin OS
+choose menu || goto live_exit
+echo ${cls}
+goto ${menu} ||
+iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
+
+:verify_sigs
+imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
+goto change_menu
+
+:change_menu
+chain ${menu}.ipxe || goto error
+goto live_menu
+
+:live_exit
+clear menu
+exit 0

+ 44 - 0
roles/netbootxyz/templates/menu/mageia.ipxe.j2

@@ -0,0 +1,44 @@
+#!ipxe
+
+# Mageia Operating System
+# http://www.mageia.org/
+
+# No way to set the network interface by MAC address, let the installer ask the question
+isset ${dhcp-server} && set network dhcp || set network static,ip:${ip},netmask:${netmask},gateway:${gateway},dns:${dns}
+
+goto ${menu} ||
+
+:mageia
+set os {{ releases.mageia.name }}
+menu ${os} - ${arch} - Image Sig Checks: [${img_sigs_enabled}]
+{% for item in releases.mageia.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose version || goto mageia_exit
+goto mageia_boot
+
+:mageia_boot
+set dir ${mageia_base_dir}/distrib/${version}/x86_64 && set dir2 isolinux/x86_64 ||
+iseq ${arch} i386 && set dir ${mageia_base_dir}/distrib/${version}/i586 && set dir2 isolinux/i386 ||
+set automatic method:http,network:${network},server:${mageia_mirror},directory:/${dir}
+imgfree
+kernel ${mageia_mirror}/${dir}/${dir2}/vmlinuz
+initrd ${mageia_mirror}/${dir}/${dir2}/all.rdz
+imgargs vmlinuz automatic=${automatic} vga=788 splash=silent ${console} initrd=all.rdz
+echo
+echo MD5sums:
+md5sum vmlinuz all.rdz
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify vmlinuz ${sigs}${dir}/${dir2}/vmlinuz.sig || goto error
+imgverify all.rdz ${sigs}${dir}/${dir2}/all.rdz.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot || goto mageia
+
+:mageia_exit
+clear menu
+exit 0

+ 116 - 0
roles/netbootxyz/templates/menu/menu.ipxe.j2

@@ -0,0 +1,116 @@
+#!ipxe
+
+:start
+chain --autofree boot.cfg ||
+ntp {{ time_server }} ||
+iseq ${cls} serial && goto ignore_cls ||
+set cls:hex 1b:5b:4a  # ANSI clear screen sequence - "^[[J"
+set cls ${cls:string}
+:ignore_cls
+
+:version_check
+set latest_version 1.04
+echo ${cls}
+iseq ${version} ${latest_version} && goto version_up2date ||
+echo
+echo Updated version of {{ site_name }} is available:
+echo
+echo Running version.....${version}
+echo Updated version.....${latest_version}
+echo
+echo Please download the latest version from {{ site_name }}.
+echo
+echo Attempting to chain to latest version...
+chain --autofree http://${boot_domain}/ipxe/${ipxe_disk} ||
+:version_up2date
+
+isset ${arch} && goto skip_arch_detect ||
+cpuid --ext 29 && set arch x86_64 || set arch i386
+iseq ${buildarch} arm64 && set arch arm64 ||
+:skip_arch_detect
+isset ${menu} && goto ${menu} ||
+
+isset ${ip} || dhcp || echo DHCP failed
+
+:main_menu
+clear menu
+set space:hex 20:20
+set space ${space:string}
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+menu ${site_name}
+item --gap Default:
+item local ${space} Boot from local hdd
+item --gap Distributions:
+iseq ${menu_linux} 1 && item linux ${space} Linux Network Installs ||
+iseq ${menu_live} 1 && item live ${space} Live CDs ||
+iseq ${menu_bsd} 1 && item bsd ${space} BSD Installs ||
+iseq ${menu_freedos} 1 && item freedos ${space} FreeDOS || 
+iseq ${menu_security} 1 && item security ${space} Security Related ||
+iseq ${menu_windows} 1 && item windows ${space} Windows ||
+item --gap Tools:
+iseq ${menu_utils} 1 && item utils-${platform} ${space} Utilities ||
+iseq ${arch} x86_64 && set bits 64 || set bits 32
+item changebits ${space} Architecture: ${arch} (${bits}bit)
+item shell ${space} iPXE shell
+item netinfo ${space} Network card info
+{% if sigs_menu | bool %}
+item --gap Signature Checks:
+item sig_check ${space} netboot.xyz [ enabled: ${sigs_enabled} ]
+item img_sigs_check ${space} Images [ enabled: ${img_sigs_enabled} ]
+{% endif %}
+{% if custom_github_menus | bool %}
+isset ${github_user} && item --gap Custom Github Menu: ||
+isset ${github_user} && item custom-github ${space} ${github_user}'s Custom Menu ||
+{% endif %}
+{% if custom_generate_menus | bool %}
+item --gap Custom User Menus: ||
+item custom-user ${space} Custom User Menus
+{% endif %}
+isset ${menu} && set timeout 0 || set timeout {{ boot_timeout }}
+choose --timeout ${timeout} --default ${menu} menu || goto local
+echo ${cls}
+goto ${menu} ||
+iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
+
+:verify_sigs
+imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
+goto change_menu
+
+:change_menu
+chain ${menu}.ipxe || goto error
+goto main_menu
+
+:error
+echo Error occured, press any key to return to menu ...
+prompt
+goto main_menu
+
+:local
+echo Booting from local disks ...
+exit 0
+
+:shell
+echo Type "exit" to return to menu.
+set menu main_menu
+shell
+goto main_menu
+
+:changebits
+iseq ${arch} x86_64 && set arch i386 || set arch x86_64
+goto main_menu
+
+:sig_check
+iseq ${sigs_enabled} true && set sigs_enabled false || set sigs_enabled true
+goto main_menu
+
+:img_sigs_check
+iseq ${img_sigs_enabled} true && set img_sigs_enabled false || set img_sigs_enabled true
+goto main_menu
+
+:custom-github
+chain https://raw.githubusercontent.com/${github_user}/netboot.xyz-custom/master/custom.ipxe || goto error
+goto main_menu
+
+:custom-user
+chain custom/custom.ipxe
+goto main_menu

+ 21 - 0
roles/netbootxyz/templates/menu/nixos.ipxe.j2

@@ -0,0 +1,21 @@
+#!ipxe
+
+# NixOS
+# https://nixos.org/
+
+set os {{ releases.nixos.name }}
+menu ${os}
+item --gap Official Releases
+{% for item in releases.nixos.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose version || goto nixos_exit
+{% for item in releases.nixos.versions %}
+iseq ${version} {{ item.code_name }} && set link https://hydra.nixos.org/job/nixos/release-{{ item.code_name }}/nixos.netboot.x86_64-linux/latest-finished/download/netboot.ipxe ||
+{% endfor %}
+chain ${link}
+goto nixos_exit
+
+:nixos_exit
+clear menu
+exit 0

+ 33 - 0
roles/netbootxyz/templates/menu/openbsd.ipxe.j2

@@ -0,0 +1,33 @@
+#!ipxe
+
+# OpenBSD Operating System
+# http://www.openbsd.org
+
+:openbsd_menu
+set os {{ releases.openbsd.name }}
+menu ${os}
+{% for item in releases.openbsd.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose ver || goto openbsd_exit
+{% for item in releases.openbsd.versions %}
+iseq ${ver} {{ item.code_name }} && set image_ver {{ item.image_ver }} ||
+{% endfor %}
+iseq ${arch} x86_64 && goto openbsd_x64 ||
+set openbsd_arch i386
+goto boot_openbsd
+
+:openbsd_x64
+set openbsd_arch amd64
+goto boot_openbsd
+
+:boot_openbsd
+set src ${openbsd_mirror}/${openbsd_base_dir}/${ver}/${openbsd_arch}/cd${image_ver}.iso
+imgfree
+initrd ${src}
+chain ${memdisk} iso raw
+exit
+
+:openbsd_exit
+clear menu
+exit 0

+ 89 - 0
roles/netbootxyz/templates/menu/opensuse.ipxe.j2

@@ -0,0 +1,89 @@
+#!ipxe
+
+# OpenSUSE Operating System
+# http://opensuse.org
+
+isset ${dhcp-server} || goto static_ip
+set netsetup netsetup=dhcp
+goto goto_menu
+
+:static_ip
+# Need to convert netmask into prefix, because otherwise the installer
+# accepts it but configures the network with /32 prefix, which installs
+# fine but breaks connectivity to devices in the same network.
+set prefix 32
+
+iseq ${netmask} 0.0.0.0 && set prefix 0 ||
+
+iseq ${netmask} 128.0.0.0 && set prefix 1 ||
+iseq ${netmask} 192.0.0.0 && set prefix 2 ||
+iseq ${netmask} 224.0.0.0 && set prefix 3 ||
+iseq ${netmask} 240.0.0.0 && set prefix 4 ||
+iseq ${netmask} 248.0.0.0 && set prefix 5 ||
+iseq ${netmask} 252.0.0.0 && set prefix 6 ||
+iseq ${netmask} 254.0.0.0 && set prefix 7 ||
+iseq ${netmask} 255.0.0.0 && set prefix 8 ||
+
+iseq ${netmask} 255.128.0.0 && set prefix 9 ||
+iseq ${netmask} 255.192.0.0 && set prefix 10 ||
+iseq ${netmask} 255.224.0.0 && set prefix 11 ||
+iseq ${netmask} 255.240.0.0 && set prefix 12 ||
+iseq ${netmask} 255.248.0.0 && set prefix 13 ||
+iseq ${netmask} 255.252.0.0 && set prefix 14 ||
+iseq ${netmask} 255.254.0.0 && set prefix 15 ||
+iseq ${netmask} 255.255.0.0 && set prefix 16 ||
+
+iseq ${netmask} 255.255.128.0 && set prefix 17 ||
+iseq ${netmask} 255.255.192.0 && set prefix 18 ||
+iseq ${netmask} 255.255.224.0 && set prefix 19 ||
+iseq ${netmask} 255.255.240.0 && set prefix 20 ||
+iseq ${netmask} 255.255.248.0 && set prefix 21 ||
+iseq ${netmask} 255.255.252.0 && set prefix 22 ||
+iseq ${netmask} 255.255.254.0 && set prefix 23 ||
+iseq ${netmask} 255.255.255.0 && set prefix 24 ||
+
+iseq ${netmask} 255.255.255.128 && set prefix 25 ||
+iseq ${netmask} 255.255.255.192 && set prefix 26 ||
+iseq ${netmask} 255.255.255.224 && set prefix 27 ||
+iseq ${netmask} 255.255.255.240 && set prefix 28 ||
+iseq ${netmask} 255.255.255.248 && set prefix 29 ||
+iseq ${netmask} 255.255.255.252 && set prefix 30 ||
+iseq ${netmask} 255.255.255.254 && set prefix 31 ||
+iseq ${netmask} 255.255.255.255 && set prefix 32 ||
+
+set netsetup netsetup=hostip,gateway,nameserver hostip=${ip}/${prefix} gateway=${gateway} nameserver=${dns}
+
+:goto_menu
+set netsetup ${netsetup} BOOTIF=${netX/mac}
+
+set distro opensuse
+menu openSUSE - ${arch} - Image Sig Checks: [${img_sigs_enabled}]
+{% for item in releases.opensuse.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose version || goto opensuse_exit
+set dir ${opensuse_base_dir}/${version}/repo/oss
+iseq ${version} tumbleweed && set dir ${version}/repo/oss ||
+
+imgfree
+kernel ${opensuse_mirror}/${dir}/boot/x86_64/loader/linux
+initrd ${opensuse_mirror}/${dir}/boot/x86_64/loader/initrd
+imgargs linux ${netsetup} install=${opensuse_mirror}/${dir} ${params} ${console} initrd=initrd
+echo
+echo MD5sums:
+md5sum linux initrd
+iseq ${img_sigs_enabled} true && iseq ${version} tumbleweed && goto skip_sigs ||
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify linux ${sigs}${distro}/${dir}/boot/x86_64/loader/linux.sig || goto error
+imgverify initrd ${sigs}${distro}/${dir}/boot/x86_64/loader/initrd.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+
+:opensuse_exit
+clear menu
+exit 0

+ 27 - 0
roles/netbootxyz/templates/menu/parrotsec.ipxe.j2

@@ -0,0 +1,27 @@
+#!ipxe
+
+# Parrot Security Linux
+# https://www.parrotsec.org
+
+goto ${menu}
+
+:parrotsec
+set os {{ releases.parrotsec.name }}
+menu ${os} Installers
+item --gap Official Releases
+{% for item in releases.parrotsec.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose parrotsec_version || goto parrotsec_exit
+goto parrotsec_boot
+
+:parrotsec_boot
+set parrotsec_initrd https://mirrordirector.archive.parrotsec.org/parrot/dists/${parrotsec_version}/main/installer-${arch_a}/current/images/netboot/mini.iso
+kernel ${memdisk} iso raw
+initrd ${parrotsec_initrd}
+boot
+goto parrotsec_exit
+
+:parrotsec_exit
+clear menu
+exit 0

+ 31 - 0
roles/netbootxyz/templates/menu/rancheros.ipxe.j2

@@ -0,0 +1,31 @@
+#!ipxe
+
+# RancherOS
+# http://rancher.com/rancher-os/
+
+:rancheros_menu
+set os {{ releases.rancheros.name }}
+set url ${rancheros_mirror}
+menu ${os}
+{% for item in releases.rancheros.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose version || goto rancheros_exit
+goto ${version}
+
+:latest
+echo ${cls}
+set folder ${rancheros_base_dir}
+goto boot
+
+:boot
+echo Login in with username: rancher, password: rancher
+echo To install: ros install -d /dev/sda1
+imgfree
+kernel ${url}/${folder}/vmlinuz rancher.state.autoformat=[/dev/sda] rancher.password=rancher initrd=initrd
+initrd ${url}/${folder}/initrd
+boot
+
+:rancheros_exit
+clear menu
+exit 0

+ 52 - 0
roles/netbootxyz/templates/menu/rhel.ipxe.j2

@@ -0,0 +1,52 @@
+#!ipxe
+
+# Redhat Enterprise Linux (RHEL)
+# https://www.redhat.com
+
+isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${ip}::${gateway}:${netmask}:::none nameserver=${dns}
+set ipparam BOOTIF=${netX/mac} ${ipparam}
+
+set rhel_arch x86_64
+goto ${menu} ||
+
+:rhel
+set os Red Hat Enterprise Linux
+clear rhel_version
+menu ${os}
+item --gap Installers
+item rhel_install ${space} Load ${os} Installer...
+item --gap Options:
+item arch_set ${space} Architecture [ ${rhel_arch} ]
+item url_set ${space} Base URL [ ${rhel_base_url} ]
+choose rhel_version || goto rhel_exit
+goto ${rhel_version}
+
+:arch_set
+iseq ${rhel_arch} x86_64 && set rhel_arch i386 || set rhel_arch x86_64
+goto rhel
+
+:url_set
+echo Set the HTTP URL of an extracted RHEL ISO without the trailing slash:
+echo e.g. http://www.mydomain.com/rhel/7
+echo
+echo -n URL: ${} && read rhel_base_url
+echo
+echo netboot.xyz will attempt to load the following files:
+echo ${rhel_base_url}/os/${rhel_arch}/images/pxeboot/vmlinuz
+echo ${rhel_base_url}/os/${rhel_arch}/images/pxeboot/initrd.img
+echo
+prompt Press any key to return to RHEL Menu...
+goto rhel
+
+:rhel_install
+isset ${rhel_base_url} && goto boot || echo URL not set... && goto url_set
+
+:boot
+imgfree
+kernel ${rhel_base_url}/os/${rhel_arch}/images/pxeboot/vmlinuz repo=${rhel_base_url}/os/${rhel_arch} ${console} ${ipparam} initrd=initrd.img
+initrd ${rhel_base_url}/os/${rhel_arch}/images/pxeboot/initrd.img
+md5sum vmlinuz initrd.img
+boot
+
+:rhel_exit
+exit 0

+ 59 - 0
roles/netbootxyz/templates/menu/scientific.ipxe.j2

@@ -0,0 +1,59 @@
+#!ipxe
+
+# Scientific Linux Operating System
+# https://www.scientificlinux.org/
+
+isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${ip}::${gateway}:${netmask}:::none nameserver=${dns}
+set ipparam BOOTIF=${netX/mac} ${ipparam}
+
+goto ${menu} ||
+
+:scientific
+clear osversion
+set os Scientific Linux
+menu ${os} ${arch}
+{% for item in releases.scientific.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+item other Choose other version [o]
+isset ${osversion} || choose osversion || goto linux_menu
+iseq ${osversion} other || goto scientific_skip_read_osversion
+echo ${cls}
+echo -n Enter version: ${} && read osversion
+:scientific_skip_read_osversion
+set dir ${scientific_base_dir}/${osversion}/${arch}/os
+set repo ${scientific_mirror}/${dir}
+
+goto boottype
+
+:boottype
+set ova ${os} ${osversion}
+menu ${os} ${arch} boot type
+item normal ${ova}
+item rescue ${ova} rescue
+item kickstart ${ova} specify kickstart url
+isset ${bt} || choose bt || goto scientific
+echo ${cls}
+iseq ${bt} rescue && goto rescue ||
+iseq ${bt} kickstart && goto kickstart ||
+goto bootos_images
+
+:rescue
+set params rescue ||
+goto bootos_images
+
+:kickstart
+echo -n Specify kickstart URL for ${os} ${osversion}: && read ksurl
+set params ks=${ksurl} ||
+goto bootos_images
+
+:bootos_images
+imgfree
+kernel ${scientific_mirror}/${dir}/images/pxeboot/vmlinuz repo=${repo} ${params} ${console} ${ipparam}
+initrd ${scientific_mirror}/${dir}/images/pxeboot/initrd.img
+boot
+goto linux_menu
+
+:linux_menu
+clear menu
+exit 0

+ 29 - 0
roles/netbootxyz/templates/menu/security.ipxe.j2

@@ -0,0 +1,29 @@
+#!ipxe
+
+goto ${menu} ||
+
+:security_menu
+menu Security Distributions - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap Security Distributions
+{% for key, value in releases.items() | sort %}
+{% if value.enabled is defined and value.menu == "security" and value.enabled | bool %}
+item {{ key }} ${space} {{ value.name }}
+{% endif %}
+{% endfor %}
+choose menu || goto security_exit
+echo ${cls}
+goto ${menu} ||
+iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
+
+:verify_sigs
+imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
+goto change_menu
+
+:change_menu
+chain ${menu}.ipxe || goto error
+goto security_menu
+
+:security_exit
+clear menu
+exit 0

+ 31 - 0
roles/netbootxyz/templates/menu/slackware.ipxe.j2

@@ -0,0 +1,31 @@
+#!ipxe
+
+# Slackware Operating System
+# http://www.slackware.com
+
+goto ${menu}
+
+:slackware
+set os slackware
+iseq ${arch} x86_64 && set sbits 64 || clear sbits
+
+menu ${os}
+{% for item in releases.slackware.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+item --key o other Choose other version [o]
+choose version || exit 0
+iseq ${version} other || goto skip_read_version
+echo ${cls}
+echo -n Enter version: ${} && read version
+:skip_read_version
+set dir ${slackware_base_dir}/slackware${sbits}-${version}
+goto boot
+
+:boot
+imgfree
+kernel ${slackware_mirror}/${dir}/kernels/huge.s/bzImage
+initrd ${slackware_mirror}/${dir}/isolinux/initrd.img
+imgargs bzImage load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 SLACK_KERNEL=huge.s ${params} ${console}
+isset ${debug} && prompt ||
+boot

+ 24 - 0
roles/netbootxyz/templates/menu/tinycore.ipxe.j2

@@ -0,0 +1,24 @@
+#!ipxe
+
+# Tiny Core Linux
+# http://tinycorelinux.net/downloads.html
+
+set tinycore_mirror {{ releases.tinycore.mirror }}
+
+:tinycore_menu
+set dir 10.x/x86/release
+menu Tiny Core Linux 10.x
+{% for item in releases.tinycore.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+choose version || goto tinycore_exit
+
+echo ${cls}
+
+kernel ${memdisk} iso raw ${params}
+initrd ${tinycore_mirror}/${dir}/${version}-current.iso
+boot
+
+:tinycore_exit
+clear menu
+exit 0

+ 83 - 0
roles/netbootxyz/templates/menu/ubuntu.ipxe.j2

@@ -0,0 +1,83 @@
+#!ipxe
+
+# Ubuntu Operating System
+# https://www.ubuntu.com
+
+goto ${menu}
+
+:ubuntu
+set os Ubuntu
+clear ubuntu_version
+menu ${os} - ${arch_a} - Image Sig Checks: [${img_sigs_enabled}]
+item --gap Latest Releases
+{% for item in releases.ubuntu.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+item --gap Older Releases
+item older_release ${space} Set release codename...
+choose ubuntu_version || goto ubuntu_exit
+iseq ${ubuntu_version} older_release && goto older_release ||
+goto mirrorcfg
+
+:older_release
+set older_release true
+set ubuntu_mirror {{ releases.ubuntu.archive_mirror }}
+echo Setting mirror to ${ubuntu_mirror}
+clear ubuntu_version
+echo -n Please set enter code name of release: ${} && read ubuntu_version
+set dir ${ubuntu_base_dir}/dists/${ubuntu_version}-updates/main/installer-${arch_a}/current/images/netboot/
+goto deb_boot_type
+
+:mirrorcfg
+set mirrorcfg mirror/suite=${ubuntu_version}
+set dir ${ubuntu_base_dir}/dists/${ubuntu_version}-updates/main/installer-${arch_a}/current/images/netboot/
+iseq ${ubuntu_version} eoan && set dir ${ubuntu_base_dir}/dists/${ubuntu_version}/main/installer-${arch_a}/current/images/netboot/ ||
+
+:deb_boot_type
+menu ${os} [${ubuntu_version}] Installer
+item --gap Install types
+item install ${space} Install
+item rescue ${space} Rescue Mode
+item expert ${space} Expert Install
+item preseed ${space} Specify preseed url...
+choose --default ${type} type || goto ubuntu
+echo ${cls}
+goto deb_${type}
+
+:deb_rescue
+set install_params rescue/enable=true
+goto deb_boot
+
+:deb_expert
+set install_params priority=low
+goto deb_boot
+
+:deb_preseed
+echo -n Specify preseed URL for ${os} ${ubuntu_version}: && read preseedurl
+set install_params auto=true priority=critical preseed/url=${preseedurl}
+goto deb_boot
+
+:deb_install
+:deb_boot
+set dir ${dir}${menu}-installer/${arch_a}
+imgfree
+kernel ${ubuntu_mirror}/${dir}/linux ${install_params} ${mirrorcfg} ${console} -- quiet ${params} initrd=initrd.gz
+initrd ${ubuntu_mirror}/${dir}/initrd.gz
+echo
+echo MD5sums:
+md5sum linux initrd.gz
+iseq ${img_sigs_enabled} true && iseq ${older_release} true && goto skip_sigs ||
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify linux ${sigs}${dir}/linux.sig || goto error
+imgverify initrd.gz ${sigs}${dir}/initrd.gz.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+
+:ubuntu_exit
+clear menu
+exit 0

+ 90 - 0
roles/netbootxyz/templates/menu/utils-efi.ipxe.j2

@@ -0,0 +1,90 @@
+#!ipxe
+
+menu Utilities - Image Sig Checks: [${img_sigs_enabled}]
+item --gap Utilities:
+{% for key, value in utilities.items() | sort(attribute='1.name') %}
+{% if value.enabled | bool and value.menu == "efi" %}
+item {{ key }} ${space} {{ value.name }}
+{% endif %}
+{% endfor %}
+item --gap netboot.xyz tools:
+item nbxyz-custom ${space} Set Github username [user: ${github_user}]
+item testdistro ${space} Test Distribution ISO
+item testpr ${space} Test forked netboot.xyz branch or hash
+choose --default ${menu} menu || goto utils_exit
+echo ${cls}
+goto ${menu} ||
+chain ${menu}.ipxe || goto utils_exit
+goto utils_exit
+
+{% for key, value in utilities.items() | sort %}
+{% if value.enabled | bool and value.menu == "efi" %}
+:{{ key }}
+set util_path {{ value.util_path }}
+set util_file {{ value.util_path | basename }}
+set util_version {{ value.version }}
+goto boot_{{ value.type }}
+{% endif %}
+{% endfor %}
+
+:boot_memdisk
+imgfree
+kernel ${memdisk} iso raw
+initrd --name ${util_file} ${util_path}
+echo
+echo MD5sums:
+md5sum memdisk ${util_file}
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify memdisk ${sigs}memdisk.sig || goto error
+imgverify ${util_file} ${sigs}${menu}/${util_file}.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+goto utils_exit
+
+:boot_memtest
+chain https://${util_path} && goto main_menu ||
+goto utils_exit
+
+:nbxyz-custom
+echo EXPERIMENTAL
+echo 
+echo Make sure you have a fork of https://github.com/antonym/netboot.xyz-custom.
+echo You can then customize your fork as needed and set up your own custom options.
+echo Once your username is set, a custom option will appear on the main menu.
+echo
+echo -n Please enter your Github username: ${} && read github_user
+goto utils_exit 
+
+:testdistro
+echo This option will allow you to test booting an ISO using memdisk. Please
+echo specify the URL of the ISO you want to test and it will automatically
+echo attempt to load the ISO using memdisk.
+echo -n URL: ${} && read distro_iso
+kernel ${memdisk} iso raw
+initrd ${distro_iso}
+boot
+goto utils_exit
+
+:testpr
+clear github_user
+clear github_branch_or_hash
+echo This will chainload into a testing branch of netboot.xyz. You'll need to enter
+echo your Github username and the first part of the commit hash of the commit you want
+echo to test or the branch name. This assumes you are testing from a forked netboot.xyz
+echo repo.
+echo
+echo -n Specify Github username: ${} && read github_user
+echo -n Specify Github branch name or commit hash ( i.e. my_feature or 30b7ca ): ${} && read github_branch_or_hash
+echo
+echo Attempting to chainload branch or hash:
+chain --autofree https://raw.githubusercontent.com/${github_user}/netboot.xyz/${github_branch_or_hash}/src/menu.ipxe || echo Unable to find Github branch or hash... && sleep 5 && goto utils_exit
+goto utils_exit
+
+:utils_exit
+clear menu
+exit 0

+ 90 - 0
roles/netbootxyz/templates/menu/utils-pcbios.ipxe.j2

@@ -0,0 +1,90 @@
+#!ipxe
+
+menu Utilities - Image Sig Checks: [${img_sigs_enabled}]
+item --gap Utilities:
+{% for key, value in utilities.items() | sort(attribute='1.name') %}
+{% if value.enabled | bool and value.menu == "pcbios" %}
+item {{ key }} ${space} {{ value.name }}
+{% endif %}
+{% endfor %}
+item --gap netboot.xyz tools:
+item nbxyz-custom ${space} Set Github username [user: ${github_user}]
+item testdistro ${space} Test Distribution ISO
+item testpr ${space} Test forked netboot.xyz branch or hash
+choose --default ${menu} menu || goto utils_exit
+echo ${cls}
+goto ${menu} ||
+chain ${menu}.ipxe || goto utils_exit
+goto utils_exit
+
+{% for key, value in utilities.items() | sort %}
+{% if value.enabled | bool and value.menu == "pcbios" %}
+:{{ key }}
+set util_path {{ value.util_path }}
+set util_file {{ value.util_path | basename }}
+set util_version {{ value.version }}
+goto boot_{{ value.type }}
+{% endif %}
+{% endfor %}
+
+:boot_memdisk
+imgfree
+kernel ${memdisk} iso raw
+initrd --name ${util_file} ${util_path}
+echo
+echo MD5sums:
+md5sum memdisk ${util_file}
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking signatures...
+imgverify memdisk ${sigs}memdisk.sig || goto error
+imgverify ${util_file} ${sigs}${menu}/${util_file}.sig || goto error
+echo Signatures verified!
+echo
+:skip_sigs
+boot
+goto utils_exit
+
+:boot_memtest
+chain https://${util_path} && goto main_menu ||
+goto utils_exit
+
+:nbxyz-custom
+echo EXPERIMENTAL
+echo 
+echo Make sure you have a fork of https://github.com/antonym/netboot.xyz-custom.
+echo You can then customize your fork as needed and set up your own custom options.
+echo Once your username is set, a custom option will appear on the main menu.
+echo
+echo -n Please enter your Github username: ${} && read github_user
+goto utils_exit 
+
+:testdistro
+echo This option will allow you to test booting an ISO using memdisk. Please
+echo specify the URL of the ISO you want to test and it will automatically
+echo attempt to load the ISO using memdisk.
+echo -n URL: ${} && read distro_iso
+kernel ${memdisk} iso raw
+initrd ${distro_iso}
+boot
+goto utils_exit
+
+:testpr
+clear github_user
+clear github_branch_or_hash
+echo This will chainload into a testing branch of netboot.xyz. You'll need to enter
+echo your Github username and the first part of the commit hash of the commit you want
+echo to test or the branch name. This assumes you are testing from a forked netboot.xyz
+echo repo.
+echo
+echo -n Specify Github username: ${} && read github_user
+echo -n Specify Github branch name or commit hash ( i.e. my_feature or 30b7ca ): ${} && read github_branch_or_hash
+echo
+echo Attempting to chainload branch or hash:
+chain --autofree https://raw.githubusercontent.com/${github_user}/netboot.xyz/${github_branch_or_hash}/src/menu.ipxe || echo Unable to find Github branch or hash... && sleep 5 && goto utils_exit
+goto utils_exit
+
+:utils_exit
+clear menu
+exit 0

+ 59 - 0
roles/netbootxyz/templates/menu/windows.ipxe.j2

@@ -0,0 +1,59 @@
+#!ipxe
+
+# Microsoft Windows
+# https://www.microsoft.com
+
+set win_arch x64
+goto ${menu} ||
+
+:windows
+set os Microsoft Windows
+clear win_version
+menu ${os} 
+item --gap Installers
+item win_install ${space} Load ${os} Installer...
+item --gap Options:
+item arch_set ${space} Architecture [ ${win_arch} ]
+item url_set ${space} Base URL [ ${win_base_url} ]
+choose win_version || goto windows_exit
+goto ${win_version}
+
+:arch_set
+iseq ${win_arch} x64 && set win_arch x86 || set win_arch x64
+goto windows
+
+:url_set
+echo Set the HTTP URL of an extracted Windows ISO without the trailing slash:
+echo e.g. http://www.mydomain.com/windows
+echo
+echo -n URL: ${} && read win_base_url
+echo
+echo netboot.xyz will attempt to load the following files:
+echo ${win_base_url}/${win_arch}/bootmgr
+echo ${win_base_url}/${win_arch}/boot/bcd
+echo ${win_base_url}/${win_arch}/boot/boot.sdi
+echo ${win_base_url}/${win_arch}/sources/boot.wim
+echo
+prompt Press any key to return to Windows Menu...
+goto windows
+
+:win_install
+isset ${win_base_url} && goto boot || echo URL not set... && goto url_set
+
+:boot
+kernel {{ wimboot_location }}
+initrd ${win_base_url}/${win_arch}/bootmgr bootmgr
+initrd ${win_base_url}/${win_arch}/boot/bcd bcd
+initrd ${win_base_url}/${win_arch}/boot/boot.sdi boot.sdi
+initrd ${win_base_url}/${win_arch}/sources/boot.wim boot.wim
+md5sum wimboot
+iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
+:verify_sigs
+echo
+echo Checking wimboot signature...
+imgverify wimboot ${sigs}wimboot.sig || goto error
+:skip_sigs
+boot
+
+:windows_exit
+exit 0

+ 1 - 0
roles/netbootxyz/tests/inventory

@@ -0,0 +1 @@
+localhost

+ 5 - 0
roles/netbootxyz/tests/test.yml

@@ -0,0 +1,5 @@
+---
+- hosts: localhost
+  remote_user: root
+  roles:
+    - netbootxyz

+ 14 - 0
roles/netbootxyz/vars/debian.yml

@@ -0,0 +1,14 @@
+---
+netbootxyz_packages:
+  - apache2
+  - binutils-dev
+  - binutils-aarch64-linux-gnu
+  - dosfstools
+  - gcc-aarch64-linux-gnu
+  - build-essential
+  - genisoimage
+  - git
+  - isolinux
+  - liblzma-dev
+  - syslinux
+  - syslinux-common

+ 1 - 0
roles/netbootxyz/vars/main.yml

@@ -0,0 +1 @@
+---

+ 10 - 0
roles/netbootxyz/vars/redhat.yml

@@ -0,0 +1,10 @@
+---
+netbootxyz_packages:
+  - dosfstools
+  - gcc
+  - genisoimage
+  - git
+  - httpd
+  - minizip-devel
+  - syslinux
+  - xz-devel

+ 14 - 0
roles/netbootxyz/vars/ubuntu.yml

@@ -0,0 +1,14 @@
+---
+netbootxyz_packages:
+  - apache2
+  - binutils-dev
+  - binutils-aarch64-linux-gnu
+  - dosfstools
+  - gcc-aarch64-linux-gnu
+  - build-essential
+  - genisoimage
+  - git
+  - isolinux
+  - liblzma-dev
+  - syslinux
+  - syslinux-common

+ 56 - 0
script/build_release

@@ -0,0 +1,56 @@
+#!/bin/bash
+
+set -e
+
+TYPE=$1
+
+# Set boot domain
+if [[ "${TYPE}" == "dev" ]]; then
+  BOOT_DOMAIN="s3.amazonaws.com/${BUCKET_DEV}/${TRAVIS_COMMIT}"
+elif [[ "${TYPE}" == "pr" ]]; then
+  BOOT_DOMAIN="test.com"
+elif [[ "${TYPE}" == "rc" ]]; then
+  BOOT_DOMAIN="staging.boot.netboot.xyz/$(cat version.txt)-RC"
+elif [[ "${TYPE}" == "release" ]]; then
+  BOOT_DOMAIN="staging.boot.netboot.xyz/$(cat version.txt)"
+fi
+sed -i \
+  "/^#boot_domain/c\boot_domain: ${BOOT_DOMAIN}" \
+  user_overrides.yml
+
+# Build release
+docker build -t localbuild -f Dockerfile-build .
+docker run --rm -it -v $(pwd):/buildout localbuild
+
+# Generate folder outputs
+mkdir -p s3out
+cp -r buildout/* s3out/
+mkdir -p githubout
+mv buildout/ipxe/* githubout/
+cd buildout
+rm -Rf ipxe
+tar -czf menus.tar.gz *
+mv menus.tar.gz ../githubout
+cd ..
+
+
+# Latest style endpoints for RC and Live
+if [[ "${TYPE}" == "release" ]] || [[ "${TYPE}" == "rc" ]]; then
+  rm -Rf buildout/
+  if [[ "${TYPE}" == "release" ]]; then
+    sed -i \
+      "/^boot_domain/c\boot_domain: staging.boot.netboot.xyz" \
+      user_overrides.yml
+    docker build -t localbuild -f Dockerfile-build .
+    docker run --rm -it -v $(pwd):/buildout localbuild
+  fi
+  if [[ "${TYPE}" == "rc" ]]; then
+    sed -i \
+      "/^boot_domain/c\boot_domain: staging.boot.netboot.xyz/rc" \
+      user_overrides.yml
+    docker build -t localbuild -f Dockerfile-build .
+    docker run --rm -it -v $(pwd):/buildout localbuild
+  fi
+  mkdir -p s3out-latest
+  cp -r buildout/* s3out-latest/
+fi

+ 41 - 0
script/message

@@ -0,0 +1,41 @@
+#!/bin/bash
+
+TYPE=$1
+
+if [ "${TYPE}" == "dev-push" ]; then
+  BOOT_URL="https://s3.amazonaws.com/${BUCKET_DEV}/${TRAVIS_COMMIT}/index.html"
+elif [ "${TYPE}" == "rc-push" ]; then
+  BOOT_URL="https://staging.boot.netboot.xyz/$(cat version.txt)-RC/index.html"
+elif [ "${TYPE}" == "live-push" ]; then
+  BOOT_URL="https://staging.boot.netboot.xyz/$(cat version.txt)/index.html"
+fi
+
+
+# send status to discord
+if [ "${TYPE}" == "failure" ]; then
+  curl -X POST -H "Content-Type: application/json" --data \
+  '{
+    "avatar_url": "https://avatars.io/twitter/travisci",
+    "embeds": [
+      {
+        "color": 16711680,
+        "description": "__**Failed to Build**__ \n**Build:**  '${TRAVIS_BUILD_WEB_URL}'\n**Status:**  Failure\n**Change:** https://github.com/netbootxyz/netboot.xyz/commit/'${TRAVIS_COMMIT}'\n"
+      }
+    ],
+    "username": "Travis CI"
+  }' \
+  ${DISCORD_HOOK_URL}
+else
+  curl -X POST -H "Content-Type: application/json" --data \
+  '{
+    "avatar_url": "https://avatars.io/twitter/travisci",
+    "embeds": [
+      {
+        "color": 1681177,
+        "description": "__**Boot Menu Published**__ \n**Files:** '${BOOT_URL}' \n**Build:**  '${TRAVIS_BUILD_WEB_URL}'\n**Change:** https://github.com/netbootxyz/netboot.xyz/commit/'${TRAVIS_COMMIT}'\n"
+      }
+    ],
+    "username": "Travis CI"
+  }' \
+  ${DISCORD_HOOK_URL}
+fi

+ 4 - 0
script/pre_install

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# Install aws cli
+sudo pip install awscli tornado

+ 8 - 0
site.yml

@@ -0,0 +1,8 @@
+---
+- hosts: localhost
+  user: root
+  roles:
+    - netbootxyz
+  vars_files:
+    - endpoints.yml
+    - user_overrides.yml

+ 31 - 0
user_overrides.yml

@@ -0,0 +1,31 @@
+---
+
+# overrides defaults in netbootxyz role
+generate_menus: true
+generate_disks: true
+generate_checksums: true
+
+# set desired site name
+#site_name: mysitename.com
+
+# set desired boot domain
+#boot_domain: boot.mysitename.com
+
+# set boot version
+#boot_version: 1.00
+
+#bootloader_tftp_enabled: false
+#bootloader_https_enabled: true
+#bootloader_http_enabled: true
+
+# set release overrides from standard netboot.xyz defaults
+#release_overrides:
+#  alpinelinux:
+#    name: "Alpine Linux"
+#  fedora:
+#    mirror: "mirrors.kernel.org"
+
+# set utilities_overrides from standard netboot.xyz defaults
+#utilities_overrides:
+#  supergrub:
+#    enabled: false

+ 1 - 0
version.txt

@@ -0,0 +1 @@
+1.9.7