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

Sub-Menu within Fog Advanced Menu

Scheduled Pinned Locked Moved
Tutorials
3
4
4.0k
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.
  • R
    RipAU
    last edited by May 5, 2016, 12:44 AM

    I’m not sure if this has been posted before but I have found it quite useful.

    Pretty much this is the contents of Fog Configuration --> iPXE Boot Menu --> Advanced Configuration Options.

    :start
    
    ###################### Advanced FOG Main Menu ######################
    
    menu iPXE Advanced boot Menu for FOG
    item --gap --					=================  Live Operating Systems  =================
    item
    item --key f fedora22 			Boot Live Fedora 22 (F)
    item --key s sysrescue			Boot SysRescue CD (S)
    item --key i sysrescue-intel		Boot SysRescue Cd Intel (I)
    item
    item --gap --					====================  Tools & Utilities  ===================
    item
    item --key t menu-tools			Boot Live Recovery & Testing Tools (T)
    item --key d menu-diag			Diagnostics Menu (D)
    item
    item --gap --             		====================  Advanced Options  ====================
    item
    item --key c config       		Configure settings
    item shell               		Drop to iPXE shell
    item reboot               		Reboot computer
    item --key x exit         		Exit iPXE and continue BIOS boot
    item return						Return to Main FOG Menu
    choose --timeout ${menu-timeout} --default ${menu-default} selected
    set menu-timeout 0
    set submenu-timeout 0
    set menu-default return
    goto ${selected}
    
    
    :fedora22
    initrd http://${fog-ip}/${fog-webroot}/boot/fedora22/initrd0.img
    chain http://${fog-ip}/${fog-webroot}/boot/fedora22/vmlinuz0 initrd=initrd0.img root=live:http://${fog-ip}/${fog-webroot}/boot/fedora22/squashfs.img rootflags="loop" rootfstype=auto ro rd.live.image quiet rhgb rd.luks=0 rd.md=0 rd.dm=0
    goto start
    
    :sysrescue
    echo Starting Sys RescueCD (32bit) with default options
    initrd http://${fog-ip}/${fog-webroot}/boot/sysrescue/initram.igz
    chain http://${fog-ip}/${fog-webroot}/boot/sysrescue/rescue.32 cdroot docache dodhcp setkmap=us netboot=http://${fog-ip}/${fog-webroot}/boot/sysrescue/sysrcd.dat
    prompt
    goto start
    
    :sysrescue-intel
    echo Starting Sys RescueCD (32bit) with default options
    initrd http://${fog-ip}/${fog-webroot}/boot/sysrescue/initram.igz
    chain http://${fog-ip}/${fog-webroot}/boot/sysrescue/rescue-intel.32 cdroot docache dodhcp setkmap=us netboot=http://${fog-ip}/${fog-webroot}/boot/sysrescue/sysrcd.dat
    prompt
    goto start
    
    :reboot
    reboot
    
    :shell
    echo Type 'exit' to get the back to the menu
    shell
    set menu-timeout 0
    goto start
    
    :exit
    exit
    
    :config
    config
    goto start
    
    :return
    chain http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac}&arch=${arch} ||
    prompt
    goto start
    
    ###################### Tools & Utilities Menu ######################
    
    :menu-tools
    menu Tools & Utilities
    item --gap --				========================  Utilities  =======================
    item
    item --key g gparted		Gparted Live
    item --key d dban	  	Darik's Boot and Nuke
    item
    item --key 0x08 back Back to top menu...
    iseq ${menu-default} menu-tools && goto menu-diag-timed ||
    choose selected && goto ${selected} || goto start
    :menu-diag-timed
    choose --timeout ${submenu-timeout} --default gparted selected && goto ${selected} || goto start
    
    :gparted
    kernel http://${fog-ip}/${fog-webroot}/boot/gparted/vmlinuz
    initrd http://${fog-ip}/${fog-webroot}/boot/gparted/initrd.img
    imgargs vmlinuz boot=live config components union=overlay username=user noswap noeject ip= vga=788 fetch=http://${fog-ip}/${fog-webroot}/boot/gparted/filesystem.squashfs
    boot || goto start
    
    :dban
    initrd http://${fog-ip}/${fog-webroot}/boot/dban-2.3.0_i586.iso
    chain memdisk iso raw ||
    goto start
    
    
    
    ###################### DIAGNOSTICS MENU #############################
    
    :menu-diag
    menu Diagnostic tools
    item --gap --				===============  Diagnostics  =============
    item
    item hdt           			Hardware Detection Tool
    item breakin      			Breakin 3.71
    item seatools				Seagate Tools
    item
    item --key 0x08 back Back to top menu...
    iseq ${menu-default} menu-diag && goto menu-diag-timed ||
    choose selected && goto ${selected} || goto start
    :menu-diag-timed
    choose --timeout ${submenu-timeout} --default hdt selected && goto ${selected} || goto start
    
    :hdt
    initrd http://${fog-ip}/${fog-webroot}/boot/hdt-0.5.2.img
    chain memdisk
    goto start
    
    :breakin
    initrd http://${fog-ip}/${fog-webroot}/boot/breakin-4.26.iso
    chain memdisk iso raw ||
    goto start
    
    :seatools
    sanboot http://${fog-ip}/${fog-webroot}/boot/seatools.iso
    goto start
    
    

    This allows you to have several sub menus inside of the advanced Fog Menu, so you can break things down into sections.
    Not all of the options maybe be 100% correct but they work for me so far 🙂

    I based it from the iPXE documentation and https://gist.github.com/robinsmidsrod/2234639

    Hopefully it helps a few people out.

    W 1 Reply Last reply May 5, 2016, 3:19 AM Reply Quote 2
    • W
      Wayne Workman @RipAU
      last edited by May 5, 2016, 3:19 AM

      @RipAU This is quite the list. I think I’ve come across it once before… pretty vague though.

      Can you elaborate on what it takes to get one of these entries working for myself and future readers? We already have ways and methods, sure. But I’d like to know how you are doing it.

      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!
      Daily Clean Installation Results:
      https://fogtesting.fogproject.us/
      FOG Reporting:
      https://fog-external-reporting-results.fogproject.us/

      1 Reply Last reply Reply Quote 0
      • R
        RipAU
        last edited by May 5, 2016, 5:29 AM

        No worries.
        Just FYI I can’t get the sub-menu function in iPXE working in the iPXE New Menu Entry section on Fog, So far I only having it working in the Fog Advanced Menu, I am assuming this is to due to system variables that fog passes to the menu before the script is run.

        Pretty much all I did was follow on the advanced menus and examples from https://gist.github.com/robinsmidsrod/2234639
        I did simplify this on mine just so I can follow it easier as I’m no expert in iPXE.

        The easiest way to follow this is the copy and paste the iPXE script into a text document and read through it.
        My example is broken down into three menus the default menu that pops up first and two others sub menus that don’t show up until you select them. I have also included the option to hit a key and jump straight to the corresponding menu item. e.g T for tools, D for Diagnostics menu etc.

        After editing the ipxe script in notepad or metapad. Copy and paste the iPXE script into the Advanced Configuration Options (Fog Configuration --> iPXE Boot Menu). I generally have the login required to password protect the menu because of a few destructive tools, this can be done by ticking the box for Advanced Menu Login under the section --> Fog Configuration --> iPXE Boot Menu.

        I hope I am making sense as I’m not exactly the best at typing out documentation.
        Is this what you were after?

        Would be quite handy to have some other example of good Fog Menu configurations up on the Wiki as well, as I love reading through other examples on what works and what doesn’t 🙂

        Cheers,

        Q 1 Reply Last reply May 5, 2016, 7:23 AM Reply Quote 1
        • Q
          Quazz Moderator @RipAU
          last edited by May 5, 2016, 7:23 AM

          @RipAU You can set those variables manually by for example creating something like:

          :variables
          set fog-ip youriphere
          set fog-webroot /var/www/html
          :start
          
          1 Reply Last reply Reply Quote 1
          • 1 / 1
          1 / 1
          • First post
            3/4
            Last post

          192

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project