• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    [Request] Adding another submenu to iPXE

    Scheduled Pinned Locked Moved
    Tutorials
    3
    7
    5.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      Quazz Moderator
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by Sebastian Roth

        @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:
        0_1456513692362_sec_adv_menu.png

        And here is the result:
        0_1456513865461_sec_adv_menu2.png

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        Q 1 Reply Last reply Reply Quote 0
        • Q
          Quazz Moderator @Sebastian Roth
          last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by

            @Quazz Working perfectly for me (just tested again). I am using an example from here as a submenu. Can step into both of my activated advanced menus and get back to the main menu again and again.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            Q 1 Reply Last reply Reply Quote 0
            • Q
              Quazz Moderator @Sebastian Roth
              last edited by Quazz

              @Sebastian-Roth I just tested and all I get is an underscore a 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. 😄

              Tom ElliottT 1 Reply Last reply Reply Quote 0
              • Tom ElliottT
                Tom Elliott @Quazz
                last edited by Tom Elliott

                @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

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                Q 1 Reply Last reply Reply Quote 1
                • Q
                  Quazz Moderator @Tom Elliott
                  last edited by

                  @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!

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post

                  240

                  Online

                  12.0k

                  Users

                  17.3k

                  Topics

                  155.2k

                  Posts
                  Copyright © 2012-2024 FOG Project