[Request] Adding another submenu to iPXE
-
I’m pretty sure this is possible, I’m just not sure how to go about it. I’ve messed around with it a bit, but it never ended up working the way I wanted. I tried to more or less copy the current method for advanced.php, but for an as of yet unknown reason it would always claim it could not find the files/directory (after loading the newly created php file that is). I made it so it would read the contents of a static file stored in the same location, which worked well (it would display information as advanced.php would when opened in browser), so I’m fairly certain that part is fine.
I googled quite a bit on this, but most of the stuff either creates a giant menu in plain text with submenus integrated or they create a php file for every single item for their menus which I find rather cumbersome and unwieldy.
I don’t know a lot about php unfortunately and I know FOG calls upon data from mysql sometimes rather than text files or what not, but I figured it would be easier and less likely to mess anything up to do it this way.
I feel like I’m close, but missing something, any help would be appreciated, thanks.
-
@Quazz I am not exactly sure if I understand correctly what you are trying to achieve. From the subject of this post it sounds like you only want to have another submenu. This is possible without playing with the PHP files in FOG trunk - which you are using if I remember correctly?!
To activate the advanced menu you go to FOG configuration -> iPXE Menu Configuration -> fog.advanced and set “Menu Show with” to “Registered Hosts” (for example). As well you need to define the submenu in the field “Parameters”. From what I read between the lines you’ve already done this. I am just pointing those steps out in case you are doing it a different way.
To get another submenu you need to create a new menu entry (FOG configuration -> iPXE New Menu Entry). Here is a screenshot of a second menu I just created on my server:
And here is the result:
-
@Sebastian-Roth I do indeed have advanced activated and have it in use for certain things.
As for the new submenu, it’s interesting that you would say this, since this is what I tried originally. In fact, the way I tested it was to copy what I had for the advanced menu (which works perfectly) into a new item. However, this never seemed to work for me. It would either just be a blank white screen or return me to main menu.
Could you verify that this method works? Because if so, I will attempt this again first thing monday morning. If it turns out that it does in fact work I have half a mind to wipe the current server and install from scratch since it wouldn’t be the only issue I’m having with it that doesn’t seem to want to go away.
-
-
@Sebastian-Roth I just tested and all I get is an
underscorea solid rectangle (kind of like it selected empty space), it doesn’t load the menu.Just tried a different menu in a new item and that one did work, so I guess there’s something wrong with my new menu.
:MENU menu colour --rgb 0xff0000 0 || cpair --foreground 1 1 || cpair --foreground 0 3 || cpair --foreground 4 4 || item --gap -- ------------------------------------- item fog.local Boot from hard disk item winvista Microsoft Windows Vista Nederlands item win7eng Microsoft Windows 7 English item win7nl Microsoft Windows 7 Nederlands item win7fr Microsoft Windows 7 Francais item win81h Microsoft Windows 8.1 Home item win81p Microsoft Windows 8.1 Pro item win10h Microsoft Windows 10 Home item win10p Microsoft Windows 10 Pro item fog.return Return to previous menu choose --default fog.local --timeout 5000000 target && goto ${target} :fog.local sanboot --no-describe --drive 0x80 || goto MENU :winvista set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WINVISTA/winpe64.iso chain memdisk iso raw :win7eng set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN7ENG/winpe64.iso chain memdisk iso raw :win7nl set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN7NL/winpe.iso chain memdisk iso raw :win7fr set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN7FR/winpe64.iso chain memdisk iso raw :win81h set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN81HOME/winpe64.iso chain memdisk iso raw :win81p set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN81PRO/winpe64.iso chain memdisk iso raw :win10h set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN10HOME/winpe64.iso chain memdisk iso raw :win10p set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN10PRO/winpe64.iso chain memdisk iso raw :fog.return chain http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac} || prompt goto MENU
That’s the menu that’s tripping up, I can’t seem to find any mistakes in it that would cause it to fail though.
edit: Found the mistake. Apparentally something went wrong in my copy paste which cause ipxe to think it was loading a menu within a menu simultaniously.
Thanks for the assistance, I guess this thread is kind of pointless now.
-
@Quazz On your “choose” line, don’t have it as a separate menu.
Change your menu, maybe to:
:MENU menu colour --rgb 0xff0000 0 || cpair --foreground 1 1 || cpair --foreground 0 3 || cpair --foreground 4 4 || item --gap -- ------------------------------------- item fog.local Boot from hard disk item winvista Microsoft Windows Vista Nederlands item win7eng Microsoft Windows 7 English item win7nl Microsoft Windows 7 Nederlands item win7fr Microsoft Windows 7 Francais item win81h Microsoft Windows 8.1 Home item win81p Microsoft Windows 8.1 Pro item win10h Microsoft Windows 10 Home item win10p Microsoft Windows 10 Pro item fog.return Return to previous choose --default fog.local --timeout 5000000 target && goto ${target} :fog.local sanboot --no-describe --drive 0x80 || goto MENU :winvista set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WINVISTA/winpe64.iso chain memdisk iso raw :win7eng set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN7ENG/winpe64.iso chain memdisk iso raw :win7nl set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN7NL/winpe.iso chain memdisk iso raw :win7fr set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN7FR/winpe64.iso chain memdisk iso raw :win81h set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN81HOME/winpe64.iso chain memdisk iso raw :win81p set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN81PRO/winpe64.iso chain memdisk iso raw :win10h set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN10HOME/winpe64.iso chain memdisk iso raw :win10p set winpe-url http://192.168.1.155/0-WINPE/ initrd ${winpe-url}/WIN10PRO/winpe64.iso chain memdisk iso raw :fog.return chain http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac} || prompt goto MENU
-
@Tom-Elliott Yes, that was exactly what was wrong, it was actually part of the description of the fog.return item, but during copy paste it jumped to the next line apparentally causing my problems!