The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 807 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 807 errorHandler->error





Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Submenus through chain loading. Any drawbacks?
2013-11-27, 15:52 (This post was last modified: 2013-11-28 09:12 by lawnmover.)
Post: #1
Submenus through chain loading. Any drawbacks?
Hi all,

while playing with iPXE lately and having a working setup working distros came flying in so my main menu got a bit crowed and I decided to go with submenus. Following the example on https://gist.github.com/robinsmidsrod/22...u-ipxe-L16 I found the file a bit to big and tried to split the submenus into seperate files calling them with chain filename. This worked reall easy. Just now I wonder if there might be any drawbacks in the method I'm using?

This calls menu-inst.ipxe just fine and presents the submenu.
Code:
# calling the submenu from main menu
:menu-misc
chain --replace --autofree ${boot-url}/menu-inst.ipxe

The back item just calls the main menu with chain and were back at the main menu.
Code:
#!ipxe

# set menu timeout
set submenu-timeout 0

# set default menu. run after menu timeout
isset ${submenu-default} || set submenu-default back

##################
# Show Main Menu #
##################

:menu-inst
menu Install Media
#item --gap --          --- Entries ---
item --key d debian     Debian Wheezy (Gnome)
item debianK            Debian Wheezy (KDE)
item debianL            Debian Wheezy (LXDE)
item debianX            Debian Wheezy (XFCE)
item --gap --
item --key b back       Back to Main Menu

choose --timeout ${submenu-timeout} --default ${submenu-default} selected || goto cancel
set submenu-timeout 0
goto ${selected}

:debian
kernel isos/debian/netboot${arch}/linux priority=low vga=788 ${desktop}
initrd isos/debian/netboot${arch}/initrd.gz
boot || goto failed

:debianK
set desktop kde
goto debian

:debianL
set desktop lxde
goto debian

:debianX
set desktop xcfe
goto debian

:back
chain --replace --autofree ${menu-url}

:failed
echo Booting failed.
prompt Press key to continue
goto menu-inst

:cancel
echo Menu canceled. Restarting machine.
reboot
exit

I right now have on main menu file and three sub menu files. All neat and clean and easy to read. Also some code is duplicated like failed back and cancel but thats no deal for me.

Any comments or thoughts you have calling submenus like that?

Regards
Lawnmover
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Submenus through chain loading. Any drawbacks? - lawnmover - 2013-11-27 15:52



User(s) browsing this thread: 1 Guest(s)