IPXE Advanced Menu or Memdisk Problem


  • Developer

    let’s try this again
    [CODE]
    set boot-url http://${fog-ip}/${fog-webroot}
    :MENU
    menu
    item --gap – City of Lewiston - Imaging and Diagnostics
    item VMware VMware - Live
    item DellDiag Dell Diagnostics
    item hostinfo Host Informaton (Your Machine Info)
    choose target && goto ${target}

    :VMware
    initrd ${boot-url}/service/ipxe/VMware/TinyCORE.iso
    chain memdisk iso raw ||
    echo failed to boot
    prompt
    goto MENU

    :DellDiag
    initrd ${boot-url}/service/ipxe/DellDiagnostics/DellDiag-7.iso
    chain memdisk iso raw ||
    echo failed to boot
    prompt
    goto MENU

    :hostinfo
    echo This computer : ||
    echo MAC address…${net0/mac} ||
    echo IP address…${ip} ||
    echo Netmask…${netmask} ||
    echo Serial…${serial} ||
    echo Asset number…${asset} ||
    echo Manufacturer…${manufacturer} ||
    echo Product…${product} ||
    echo BIOS platform…${platform} ||
    echo ||
    echo press any key to return to Menu ||
    prompt
    goto MENU
    [/CODE]


  • Developer



  • Side note I was playing around with the iso and raw options as you can see where the DellDiag option had it and the VMware one didn’t I was hoping to find the magic combination but was unsuccessful.



  • Thank you to both of you. Good education. Although using the code copied from Tom with the IP-ADDRESS filled in I have a new problem. the advanced menu doesn’t appear any more. the screen flashes and returns to the standard menu. :( Is there a walk through or instructional guide available for the current release on how to set an ISO as a boot-able option? I am guessing not or you would have sent me that way already.


  • Developer

    minor correction for tom: each line of the ipxe file is seen as a new command, so the || at the end of a line only meand ‘do this’ “or” ‘nothing’
    if ‘do this’ fails, this is a failure to execute a command, if there is a “or” ‘nothing’ then the line is a success, because it successfully does nothing.
    each line after a ||
    will be executed


  • Senior Developer

    In the advanced.php file we already have a setting that gets your systems ip and webroot.
    The start of the file is:
    [code]print “#!ipxe\n”;
    print “console\n”;
    print “set fog-ip “.$FOGCore->getSetting(‘FOG_WEB_HOST’).”\n”;
    print “set fog-webroot “.basename($FOGCore->getSetting(‘FOG_WEB_ROOT’)).”\n”;[/code]

    What does this mean? You don’t need to set the same fields unless you’re trying to point it another server. The only exception would be the boot url with:
    [code]set boot-url http://${fog-ip}/${fog-webroot}[/code]

    So your code as below:
    [code]
    set fog-server IP-ADDRESS
    set boot-url http://IP-ADDRESS/fog/

    :start-http
    menu City of Lewiston - Imaging and Diagnostics

    item VMware VMware - Live
    item DellDiag Dell Diagnostics
    item hostinfo Host Informaton (Your Machine Info)

    #item foginfo FOG system info

    choose fog-opt && goto ${fog-opt}

    :VMware
    initrd http://IP-ADDRESS/fog/service/ipxe/VMware/TinyCORE.iso raw
    kernel http://IP-ADDRESS/fog/service/ipxe/memdisk
    boot

    :DellDiag
    initrd http://IP-ADDRESS/fog/service/ipxe/DellDiagnostics/DellDiag-7.iso
    kernel http://IP-ADDRESS/fog/service/ipxe/memdisk iso raw ||
    boot

    :hostinfo
    echo This computer : ||
    echo MAC address…${net0/mac} ||
    echo IP address…${ip} ||
    echo Netmask…${netmask} ||
    echo Serial…${serial} ||
    echo Asset number…${asset} ||
    echo Manufacturer…${manufacturer} ||
    echo Product…${product} ||
    echo BIOS platform…${platform} ||
    echo ||
    echo press any key to return to Menu ||
    prompt

    goto MENU[/code] Should “work” but I don’t know where it’s failing specifically. The nice part is you probably are calling the wrong method: Memdisk should always call the type of file and method (e.g. iso raw) So I’d try this:
    [code]set boot-url http://IP-ADDRESS/fog/
    :MENU
    menu
    item --gap – City of Lewiston - Imaging and Diagnostics
    item VMware VMware - Live
    item DellDiag Dell Diagnostics
    item hostinfo Host Informaton (Your Machine Info)
    choose fog-opt target && goto ${target}
    :VMware
    initrd ${boot-url}/service/ipxe/VMware/TinyCORE.iso
    chain ${boot-url}/service/ipxe/memdisk raw iso
    boot
    :DellDiag
    initrd ${boot-url}/service/ipxe/DellDiagnostics/DellDiag-7.iso
    chain ${boot-url}/service/ipxe/memdisk iso raw
    boot
    :hostinfo
    echo This computer :
    echo MAC address…${net0/mac}
    echo IP address…${ip}
    echo Netmask…${netmask}
    echo Serial…${serial}
    echo Asset number…${asset}
    echo Manufacturer…${manufacturer}
    echo Product…${product}
    echo BIOS platform…${platform}
    echo
    echo press any key to return to Menu
    prompt && goto MENU[/code]

    Hopefully this helps. Remember that the || means OR that. So your hostinfo would only print This computer: MAC Address…${net0/mac} OR IP Address OR Netmask OR Serial only as things failed.


Log in to reply
 

351
Online

5.6k
Users

12.9k
Topics

121.2k
Posts