diff options
Diffstat (limited to 'usr/src/boot/forth/menu.4th')
-rw-r--r-- | usr/src/boot/forth/menu.4th | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/usr/src/boot/forth/menu.4th b/usr/src/boot/forth/menu.4th index 1fd20811c6..fee6ec3806 100644 --- a/usr/src/boot/forth/menu.4th +++ b/usr/src/boot/forth/menu.4th @@ -3,6 +3,7 @@ \ Copyright (c) 2006-2015 Devin Teske <dteske@FreeBSD.org> \ Copyright 2020 OmniOS Community Edition (OmniOSce) Association. \ All rights reserved. +\ Copyright 2019 Joyent, Inc. \ \ Redistribution and use in source and binary forms, with or without \ modification, are permitted provided that the following conditions @@ -332,7 +333,7 @@ also menu-infrastructure definitions \ Print the frame caption at (x,y) s" loader_menu_title" getenv dup -1 = if - drop s" Welcome to illumos" + drop s" Welcome to SmartOS" then TRUE ( use default alignment ) s" loader_menu_title_align" getenv dup -1 <> if @@ -549,14 +550,39 @@ also menu-infrastructure definitions then ; -\ Takes an integer on the stack and updates the timeout display. +: do_ipxe ( -- bool) + \ getenv? leaves -1 on stack if the env var exists. Thus if both + \ headnode and ipxe exist then the sum of what will be left on the + \ stack should be -2. + s" headnode" getenv? s" ipxe" getenv? + -2 = if + s" ipxe" getenv s" true" compare 0= if + true + else + false + then + else + false + then +; + +\ Takes a single integer on the stack and updates the timeout display. The +\ integer must be between 0 and 9 (we will only update a single digit in the +\ source message). \ : menu-timeout-update ( N -- ) \ Enforce minimum dup 0 < if drop 0 then - menu_timeout_x @ menu_timeout_y @ at-xy \ position cursor + s" headnode" getenv? if + do_ipxe if + s" Autoboot in N seconds from PXE. [Space] to pause" ( n -- n c-addr/u ) + else + s" Autoboot in N seconds from the USB Key. [Space] to pause" ( n -- n c-addr/u ) + then + else + s" Autoboot in N seconds. [Space] to pause" ( n -- n c-addr/u ) + then dup 0> if s" Autoboot in " type @@ -1012,8 +1038,16 @@ also menu-namespace dup over 13 = swap 10 = or if drop ( no longer needed ) cursor-normal cursor-set - s" boot" evaluate - exit ( pedantic; never reached ) + do_ipxe if + s" efi-version" getenv? if + s" ipxe_chainload" evaluate + else + s" ipxe_boot" evaluate + then + else + s" boot" evaluate + exit ( pedantic; never reached ) + then then dup menureboot @ = if 0 reboot then |