whew. i think that's the basics done.
This commit is contained in:
@@ -1,21 +1,79 @@
|
||||
{% extends 'formatting.ipxe.j2' %}
|
||||
{% block menu%}
|
||||
{# NET ############################################################################################################## #}
|
||||
{#
|
||||
# Refresh the DHCP lease just in case.
|
||||
dhcp
|
||||
echo MAIN MENU
|
||||
|
||||
#}
|
||||
{# ARCH DETECTION ################################################################################################### #}
|
||||
cpuid --ext 29 && set bits 64 || set bits 32
|
||||
cpuid --ext 29 && set arch x86_64 || set arch x86
|
||||
|
||||
iseq ${platform} efi && set is_efi y || set is_efi n
|
||||
{# BASE ############################################################################################################# #}
|
||||
:main
|
||||
menu BootBox @ {{ request.url_root }}
|
||||
{% for mt in ('install', 'utilities') %}
|
||||
item --gap -- == {{ mt.upper() }} ==
|
||||
item --gap -- = {{ mt.upper() }} =
|
||||
{% for os in db.getMenu(mt) %}
|
||||
item --key {{ os['shortcut'] }} {{ os['name'] }} ({{ os['shortcut'] }}) {{ os['desc'] }}
|
||||
{%- endfor %}
|
||||
{% endfor %}
|
||||
choose base
|
||||
|
||||
echo Selected: ${base}
|
||||
choose --timeout 60 --default rescue base || goto cancel
|
||||
set menu-timeout 0
|
||||
goto ${base}
|
||||
{# CANCEL ########################################################################################################### #}
|
||||
:cancel
|
||||
echo iPXE canceled; continuing boot.
|
||||
goto exit
|
||||
{# REBOOT ########################################################################################################### #}
|
||||
:reboot
|
||||
reboot
|
||||
{# EXIT ############################################################################################################# #}
|
||||
:exit
|
||||
exit 0
|
||||
{# CONFIGURE ######################################################################################################## #}
|
||||
:config
|
||||
config
|
||||
goto main
|
||||
{# SHELL ############################################################################################################ #}
|
||||
:ipxe_shell
|
||||
echo To return to the menu, use the "exit" command.
|
||||
shell
|
||||
goto :main
|
||||
{# INSTALL ########################################################################################################## #}
|
||||
{%- for os in db.getMenu('install') %}
|
||||
:{{ os['name'] }}
|
||||
menu == {{ os['desc'] }} ==
|
||||
{%- for sub_os in db.getMenu(os['name']) %}
|
||||
item --key {{ sub_os['shortcut'] }} {{ sub_os['name'] }} ({{ sub_os['shortcut'] }}) {{ sub_os['desc'] }} (version: {{ sub_os['version'] }})
|
||||
{%- endfor %}
|
||||
item --key < main (<) Back to Main Menu
|
||||
choose --timeout 60 --default main install_choice || goto cancel
|
||||
set menu-timeout 0
|
||||
goto ${install_choice}
|
||||
{% endfor %}
|
||||
{# UTILITIES ######################################################################################################## #}
|
||||
{%- for u in db.getMenu('utilities') %}
|
||||
:{{ u['name'] }}
|
||||
{%- if u['command'] %}
|
||||
{%- if u['command'].startswith('chain ') %}
|
||||
{{ u['command'] }}
|
||||
{%- else %}
|
||||
goto {{ u['name'] }}
|
||||
{%- endif %}
|
||||
{%- else %}
|
||||
menu === {{ u['desc'] }} ===
|
||||
{%- for su in db.getMenu(u['name']) %}
|
||||
{%- if su['name'] == 'uefi_shell' %}
|
||||
iseq ${is_efi} n && item --gap -- WARNING: Not detected as UEFI. These may not work correctly.
|
||||
{%- endif %}
|
||||
item --key {{ su['shortcut'] }} {{ su['name'] }} ({{ su['shortcut'] }}) {{ su['desc'] }} (version: {{ su['version'] }})
|
||||
{%- endfor %}
|
||||
item --key < main (<) Back to Main Menu
|
||||
choose --timeout 60 --default main {{ u['name'] }}_choice || goto cancel
|
||||
set menu-timeout 0
|
||||
goto {{'${'}}{{ u['name'] }}_choice{{ '}' }}
|
||||
{%- endif %}
|
||||
{% endfor %}
|
||||
# END
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user