Sfoglia il codice sorgente

adding POC live menu stuff loading settings from endpoints yaml

thelamer 5 anni fa
parent
commit
026c87546d

+ 10 - 0
endpoints.yml

@@ -0,0 +1,10 @@
+endpoints:
+  ubuntu-19.10-live-kernel:
+    path: /ubuntu-core-19.10/releases/download/5.3.0.18.21-60558c66-1.1/
+    files: [initrd, vmlinuz]
+  ubuntu-18.04-live-kernel:
+    path: /ubuntu-core-18.04/releases/download/4.15.0.20.23-dc9800c9-1.1/
+    files: [initrd, vmlinuz]
+  ubuntu-18.04-default-squash:
+    path: /ubuntu-squash/releases/download/18.04.3-7dfb37b3-1.1/
+    files: [filesystem.squashfs]

+ 1 - 0
netbootxyz.yml

@@ -4,4 +4,5 @@
   roles:
     - netbootxyz
   vars_files:
+    - endpoints.yml
     - user_overrides.yml

+ 10 - 0
roles/netbootxyz/templates/menu/boot.ipxe.j2

@@ -22,6 +22,9 @@ set sigs http://${boot_domain}/sigs/
 # set location of latest iPXE
 set ipxe_disk netboot.xyz-undionly.kpxe
 
+# set location of custom netboot.xyz live assets
+set live_endpoint https://github.com/netbootxyz
+
 ##################
 # official mirrors
 ##################
@@ -62,6 +65,13 @@ set slackware_base_dir slackware
 set ubuntu_mirror archive.ubuntu.com
 set ubuntu_base_dir ubuntu
 
+##############################
+# netboot-xyz hosted endpoints
+##############################
+
+{% for key, value in endpoints.iteritems() %}
+set {{ key }} {{ value['path'] }}
+{% endfor %}
 
 #################################################
 # determine architectures and enable menu options

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

@@ -0,0 +1,25 @@
+#!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 liveubuntu ${space} Ubuntu Live
+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

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

@@ -0,0 +1,27 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+menu Live Ubuntu Default (Unity) - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap Live Ubuntu Default (Unity)
+item bionic-18.04-default ${space} Bionic Beaver 18.04
+choose menu || goto live_exit
+echo ${cls}
+goto ${menu} ||
+iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
+
+:bionic-18.04-default
+kernel ${live_endpoint}${ubuntu-18.04-live-kernel}vmlinuz boot=casper netboot=http fetch=${live_endpoint}${ubuntu-18.04-default-squash}filesystem.squashfs initrd=initrd
+initrd ${live_endpoint}${ubuntu-18.04-live-kernel}initrd
+boot
+
+:change_menu
+chain ${menu}.ipxe || goto error
+goto live_menu
+
+:live_exit
+clear menu
+exit 0
+

+ 26 - 0
roles/netbootxyz/templates/menu/liveubuntu.ipxe.j2

@@ -0,0 +1,26 @@
+#!ipxe
+
+goto ${menu} ||
+
+:live_menu
+menu Live Ubuntu Distros - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap Live Ubuntu Distros
+item liveubuntu-default ${space} Ubuntu Live Default (Unity)
+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
+

+ 3 - 3
roles/netbootxyz/templates/menu/menu.ipxe.j2

@@ -1,7 +1,7 @@
 #!ipxe
 
 :start
-chain --autofree boot.cfg ||
+chain --autofree boot.ipxe ||
 iseq ${cls} serial && goto ignore_cls ||
 set cls:hex 1b:5b:4a  # ANSI clear screen sequence - "^[[J"
 set cls ${cls:string}
@@ -40,10 +40,10 @@ menu ${site_name}
 item --gap Default:
 item local ${space} Boot from local hdd
 item --gap Distributions:
-iseq ${menu_linux} 1 && item linux ${space} Linux Installs ||
+iseq ${menu_live} 1 && item live ${space} Live CDs ||
+iseq ${menu_linux} 1 && item linux ${space} Linux Network Installs ||
 iseq ${menu_bsd} 1 && item bsd ${space} BSD Installs ||
 iseq ${menu_freedos} 1 && item freedos ${space} FreeDOS || 
-iseq ${menu_live} 1 && item live ${space} Live Boot ||
 iseq ${menu_security} 1 && item security ${space} Security Related ||
 iseq ${menu_windows} 1 && item windows ${space} Windows ||
 item --gap Tools: