瀏覽代碼

#551 adding unix menu with smartos in it

thelamer 5 年之前
父節點
當前提交
eb1f4dd40c

+ 1 - 0
README.md

@@ -145,6 +145,7 @@ In addition to being able to host netboot.xyz locally, you can also create your
 | Scientific Linux | https://scientificlinux.org | Yes | No |
 | Scientific Linux | https://scientificlinux.org | Yes | No |
 | Septor | https://septor.sourceforge.io | No | Yes |
 | Septor | https://septor.sourceforge.io | No | Yes |
 | Slackware | https://www.slackware.com | Yes | No |
 | Slackware | https://www.slackware.com | Yes | No |
+| SmartOS | https://www.joyent.com/smartos | Yes | No |
 | SparkyLinux | https://sparkylinux.org/ | No | Yes |
 | SparkyLinux | https://sparkylinux.org/ | No | Yes |
 | Tails | https://tails.boum.org | No | Yes |
 | Tails | https://tails.boum.org | No | Yes |
 | Tiny Core Linux | https://tinycorelinux.net | Yes | Yes |
 | Tiny Core Linux | https://tinycorelinux.net | Yes | Yes |

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

@@ -47,6 +47,7 @@ set {{ key }}_base_dir {{ value.base_dir }}
 :architectures
 :architectures
 set menu_linux 1
 set menu_linux 1
 set menu_bsd 1
 set menu_bsd 1
+set menu_unix 1
 set menu_freedos 1
 set menu_freedos 1
 set menu_live 1
 set menu_live 1
 set menu_windows 1
 set menu_windows 1

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

@@ -48,6 +48,7 @@ item --gap Distributions:
 iseq ${menu_linux} 1 && item linux ${space} Linux Network Installs ||
 iseq ${menu_linux} 1 && item linux ${space} Linux Network Installs ||
 iseq ${menu_live} 1 && item live ${space} Live CDs ||
 iseq ${menu_live} 1 && item live ${space} Live CDs ||
 iseq ${menu_bsd} 1 && item bsd ${space} BSD Installs ||
 iseq ${menu_bsd} 1 && item bsd ${space} BSD Installs ||
+iseq ${menu_unix} 1 && item unix ${space} Unix Network Installs ||
 iseq ${menu_freedos} 1 && item freedos ${space} FreeDOS || 
 iseq ${menu_freedos} 1 && item freedos ${space} FreeDOS || 
 iseq ${menu_windows} 1 && item windows ${space} Windows ||
 iseq ${menu_windows} 1 && item windows ${space} Windows ||
 item --gap Tools:
 item --gap Tools:

+ 64 - 0
roles/netbootxyz/templates/menu/smartos.ipxe

@@ -0,0 +1,64 @@
+#!ipxe
+######################################
+# SmartOS                            #
+# https://www.joyent.com/smartos     #
+# Credit: https://github.com/bahamat #
+######################################
+
+
+:custom
+clear smartos_build
+clear kflags
+set noimport false
+set kmdb_e false
+set kmdb_b false
+goto smartos_menu
+
+:smartos_menu
+set os {{ releases.smartos.name }}
+menu ${os}
+item --gap Platform Images:
+{% for item in releases.smartos.versions %}
+item {{ item.code_name }} ${space} ${os} {{ item.name }}
+{% endfor %}
+item --gap Options:
+item toggle_pool ${space} Rescue mode: ${noimport}
+item toggle_kmdb_e ${space} Load Kernel Debugger: ${kmdb_e}
+item toggle_kmdb_b ${space} Boot Kernel Debugger First: ${kmdb_b}
+
+iseq ${noimport} true && item --gap ${space} ||
+iseq ${noimport} true && item --gap ${space} Zpool will not be imported. Rescue mode root password can be found at ||
+iseq ${noimport} true && item --gap ${space} http://us-east.manta.joyent.com/Joyent_Dev/public/SmartOS/smartos.html ||
+
+choose smartos_build || goto smartos_exit
+iseq ${smartos_build} toggle_pool && goto toggle_pool ||
+iseq ${smartos_build} toggle_kmdb_e && goto toggle_kmdb_e ||
+iseq ${smartos_build} toggle_kmdb_b && goto toggle_kmdb_b ||
+goto smartos_boot
+
+:smartos_boot
+iseq ${kmdb_e} true && set kflags:hex 2d:6b ||
+iseq ${kmdb_b} true && set kflags:hex 2d:6b:64 ||
+kernel ${smartos_mirror}${smartos_build}${smartos_base_dir}kernel/amd64/unix ${kflags:string} -B console=text,text-mode="115200,8,n,1,-",smartos=true,noimport=${noimport}${root_shadow:string}
+module ${smartos_mirror}${smartos_build}${smartos_base_dir}amd64/boot_archive type=rootfs name=ramdisk || goto fail
+module ${smartos_mirror}${smartos_build}${smartos_base_dir}amd64/boot_archive.hash type=hash name=ramdisk || goto fail
+boot
+
+:toggle_pool
+iseq ${noimport} true && set noimport false || set noimport true
+iseq ${noimport} false && clear root_shadow || set root_shadow:hex 2c:72:6f:6f:74:5f:73:68:61:64:6f:77:3d:27:24:35:24:32:48:4f:48:52:6e:4b:33:24:4e:76:4c:6c:6d:2e:31:4b:51:42:62:42:30:57:6a:6f:50:37:78:63:49:77:47:6e:6c:6c:68:7a:70:32:48:6e:54:2e:6d:44:4f:37:44:70:78:59:41:27:0a
+goto smartos_menu
+
+:toggle_kmdb_e
+iseq ${kmdb_e} true && set kmdb_e false || set kmdb_e true
+iseq ${kmdb_e} false && set kmdb_b false ||
+goto smartos_menu
+
+:toggle_kmdb_b
+iseq ${kmdb_b} true && set kmdb_b false || set kmdb_b true
+iseq ${kmdb_b} true && set kmdb_e true ||
+goto smartos_menu
+
+:smartos_exit
+clear menu
+exit 0

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

@@ -0,0 +1,29 @@
+#!ipxe
+
+goto ${menu} ||
+
+:unix_menu
+menu Unix Installers - Current Arch [ ${arch} ]
+iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
+item --gap Unix Distros:
+{% for key, value in releases.items() | sort(attribute='1.name') %}
+{% if value.enabled is defined and value.menu == "unix" and value.enabled | bool %}
+item {{ key }} ${space} {{ value.name }}
+{% endif %}
+{% endfor %}
+choose menu || goto unix_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 unix_menu
+
+:unix_exit
+clear menu
+exit 0