Selaa lähdekoodia

Adds Bootloader index generator

Adds snp* efi disks
Moves checksums file to be tunable variable
Generates a table for index of downloads
Antony Messerli 5 vuotta sitten
vanhempi
commit
8212907203

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

@@ -32,6 +32,7 @@ generate_menus: true
 
 # generates signatures for source files
 generate_checksums: true
+checksums_filename: "{{ site_name }}-sha256-checksums.txt"
 
 # bootloader options
 generate_disks: true
@@ -428,3 +429,51 @@ utilities:
     type: "memdisk"
     version: "538"
     util_path: "http://mirror.sysadminguide.net/ubcd/ubcd538.iso"
+
+bootloaders:
+  legacy:
+    - type: "ISO"
+      ipxe_bin: "ipxe.iso"
+      output_bin: ".iso"
+      desc: "Used for CD/DVD, Virtual CDs, DRAC/iLO, VMware, Virtual Box"
+    - type: "USB"
+      ipxe_bin: "ipxe.usb"
+      output_bin: ".usb"
+      desc: "Used for creation of USB Keys"
+    - type: "Kernel"
+      ipxe_bin: "ipxe.lkrn"
+      output_bin: ".lkrn"
+      desc: "Used for booting from GRUB/EXTLINUX"
+    - type: "Floppy"
+      ipxe_bin: "ipxe.dsk"
+      output_bin: ".dsk"
+      desc: "Virtual floppy disk for DRAC/iLO, VMware, Virtual Box, etc"
+    - type: "DHCP"
+      ipxe_bin: "ipxe.kpxe"
+      output_bin: ".kpxe"
+      desc: "DHCP boot image file, uses built-in iPXE NIC drivers"
+    - type: "DHCP-undionly"
+      ipxe_bin: "undionly.kpxe"
+      output_bin: "-undionly.kpxe"
+      desc: "DHCP boot image file, use if you have NIC issues"
+  uefi:
+    - type: "ISO"
+      ipxe_bin: "ipxe-efi.eiso"
+      output_bin: "-efi.iso"
+      desc: "EFI BIOS, works in Virtual Box EFI mode"
+    - type: "USB"
+      ipxe_bin: "ipxe-efi.usb"
+      output_bin: "-efi.usb"
+      desc: "Used for booting from GRUB/EXTLINUX"
+    - type: "DHCP"
+      ipxe_bin: "ipxe.efi"
+      output_bin: ".efi"
+      desc: "DHCP EFI boot image file, uses built-in iPXE NIC drivers"
+    - type: "DHCP-snp"
+      ipxe_bin: "snp.efi"
+      output_bin: "-snp.efi"
+      desc: "EFI w/ Simple Network Protocol, attempts to boot all net devices"
+    - type: "DHCP-snponly"
+      ipxe_bin: "snponly.efi"
+      output_bin: "-snponly.efi"
+      desc: "EFI w/ Simple Network Protocol, only boots from device chained from"

+ 2 - 2
roles/netbootxyz/tasks/generate_checksums.yml

@@ -1,6 +1,6 @@
 ---
   - name: Register a listing of all created iPXE bootloaders
-    command: ls -I checksums.txt {{ netbootxyz_root }}/ipxe/
+    command: ls -I {{ checksums_filename }} {{ netbootxyz_root }}/ipxe/
     register: netboot_disks
     tags:
       - skip_ansible_lint
@@ -24,7 +24,7 @@
   - name: Generate ipxe disk checksums
     template:
       src: checksums.txt.j2
-      dest: "{{ netbootxyz_root }}/ipxe/{{ site_name }}-sha256-checksums.txt"
+      dest: "{{ netbootxyz_root }}/ipxe/{{ checksums_filename }}"
 
   - name: Generate netboot.xyz index template
     template:

+ 7 - 1
roles/netbootxyz/tasks/generate_disks_efi.yml

@@ -26,7 +26,11 @@
   - name: Compile iPXE bootloader for EFI
     shell: |
       make clean
-      make EMBED={{ bootloader_filename }} TRUST={{ trust_files }} bin-x86_64-efi/ipxe.efi
+      make EMBED={{ bootloader_filename }} \
+           TRUST={{ trust_files }} \
+           bin-x86_64-efi/ipxe.efi \
+           bin-x86_64-efi/snp.efi \
+           bin-x86_64-efi/snponly.efi
     args:
       chdir: "{{ ipxe_source_dir }}/src"
     tags:
@@ -66,5 +70,7 @@
       remote_src: True
     with_items:
       - { src: "bin-x86_64-efi/ipxe.efi", dest: "{{ bootloader_filename }}.efi" }
+      - { src: "bin-x86_64-efi/snp.efi", dest: "{{ bootloader_filename }}-snp.efi" }
+      - { src: "bin-x86_64-efi/snponly.efi", dest: "{{ bootloader_filename }}-snponly.efi" }
       - { src: "ipxe-efi.eiso", dest: "{{ bootloader_filename }}-efi.iso" }
       - { src: "ipxe-efi.usb", dest: "{{ bootloader_filename }}-efi.usb" }

+ 52 - 5
roles/netbootxyz/templates/index.html.j2

@@ -1,8 +1,14 @@
 <!DOCTYPE html>
 <html lang="en">
   <head>
-    <title>{{ site_name }} BootLoaders</title>
+    <title>{{ site_name }} BootLoaders - Powered by netboot.xyz</title>
   </head>
+  <style>
+    table, th, td {
+    padding: 5px;
+    border: 1px solid black; 
+    }
+  </style>
   <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 />
@@ -11,9 +17,50 @@
   <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 />
+  <p>
+  Version: {{ boot_version }}<br>
+  Powered by <a href=https://netboot.xyz>netboot.xyz</a>
+  </p>
+  <p>Legacy (PCBIOS) iPXE Bootloaders</p>
+  <table style="width:100%">
+    <!-- table header -->
+    <tr>
+       <th> Type </th>
+       <th> Bootloader </th>
+       <th> Description </th>
+    </tr>
+    <!-- table rows -->
+    {% for bootloader_name in bootloader_disks %}
+    {% for item in bootloaders.legacy %}
+    <tr>
+       <td> {{ item.type }} </td>
+       <td> <a href="ipxe/{{ bootloader_name }}{{ item.output_bin }}">{{ bootloader_name }}{{ item.output_bin }}</a> </td>
+       <td> {{ item.desc }} </td>
+    </tr>
+    {% endfor %}
+    {% endfor %}
+  </table>
+
+  <p>UEFI iPXE Bootloaders</p>
+
+  <table style="width:100%">
+    <!-- table header -->
+    <tr>
+       <th> Type </th>
+       <th> Bootloader </th>
+       <th> Description </th>
+    </tr>
+    <!-- table rows -->
+    {% for bootloader_name in bootloader_disks %}
+    {% for item in bootloaders.uefi %}
+    <tr>
+       <td> {{ item.type }} </td>
+       <td> <a href="ipxe/{{ bootloader_name }}{{ item.output_bin }}">{{ bootloader_name }}{{ item.output_bin }}</a> </td>
+       <td> {{ item.desc }} </td>
+    </tr>
+    {% endfor %}
+    {% endfor %}
+  </table>
   </div>
-  {% for item in netboot_disks.stdout_lines %}
-  <a href="ipxe/{{ item }}">{{ item }}</a><br>
-  {% endfor %}
   </body>
-</html>
+</html>