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

    How to set menu item as default? (And some other queries)

    Scheduled Pinned Locked Moved
    General
    2
    4
    362
    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.
    • Y
      yuma
      last edited by

      I have a collection of boot utilities that derive from ISO images. And I would like that menu item to become the default instead of the boot from local drive.
      When I set the “Default Menu Item” check, the client loads DHCP them complains as if ‘choose’ command is wrong. However, when unset as default (and local-boot is default), the menu displays fine and choice work as expected.
      So what is the trick to assign it as default?

      My menu item follow:

      set	http	http://${fog-ip}/images
      set	nfs	nfs://${fog-ip}/images
      set	tftp	tftp://${fog-ip}/images
      #
      :GMENU
      menu	Good Utilities Menu
      item	--gap -- -------------------------------------
      item	--key i	hostinfo	host (I)nformation
      item	--key a	actBootDisk	(A)ctive@ Boot Disk
      item --key c	clonezilla	(C)onezilla
      item	--key f	freeDOS	(F)reeDOS 13-RC3
      item	--key h	HDAT2	(H)DAT2 CD Boot DOS Disk v7.0
      item	--key m	MiniW10	(M)ini Windows 10
      item	--key p	pMagic	(P)artedMagic 2019-03-17
      item	--key s	SPIN	(S)pinRite Drive Diagnostics 6
      item	--key r	sysresc	System (R)escue
      item --key d	redob	Re(d)o Backup & Restore
      item	--key h	shell	iPXE s(h)ell
      item --key b	reboot	re(b)oot
      item	--key l	return	reload a(l)l menus
      item	--key t	MENU	return (t)o previous menu
      choose	--default hostinfo	target && goto ${target}
      #-----------common-----------#
      :failed
      echo failed.
      echo press any key to return to the Utilities Menu ||
      prompt
      goto GMENU
      #-----------boot IMG via memdisk-----------#
      :MEMIMG
      #--eg. set img ${nfs}/memdisk/img/SpinRite.img ; goto MEMIMG--#
      initrd	${img}
      set	memargs	img ${memargs}
      chain	memdisk ${memargs} ||
      #boot || read void
      boot	|| goto failed
      #-----------load an ISO via memdisk kernel-----------#
      :KMEMISO
      #---eg. set iso ${nfs}/memdisk/iso/FD13LIVE.ISO ; set memargs iso raw ; goto KMEMISO---#
      set	memargs iso ${memargs}
      kernel	memdisk ${memargs}
      initrd	${iso}
      boot || goto	failed
      #-----------chain load an ISO via memdisk-----------#
      :CHMEMISO
      #---eg. set iso ${nfs}/memdisk/iso/FD13LIVE.ISO ; goto CHMEMISO---#
      initrd	${iso}
      set	memargs	iso ${memargs}
      chain	memdisk ${memargs} ||
      boot || goto	failed
      #-----------hostinfo-----------#
      :hostinfo
      #cpuid --ext 29 && set arch amd64 || set arch x86
      echo This computer : ||
      echo =--=--=--=--=--=--= ||
      echo Platform : ........ ${arch} ||
      echo Web Boot Root : ... ${boot-url} ||
      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 FOG Ip Address : .. ${fog-ip} ||
      echo FOG Web Root : .... ${fog-webroot} ||
      echo iPXE version : .... ${version} ||
      echo ||
      echo press any key to return to Good Utilities Menu ||
      prompt
      goto GMENU
      #-----------actBootDisk-----------#
      :actBootDisk
      set	root	${http}/iso/abd
      kernel ${nfs}/wimboot gui
      imgfetch --name bootmgr ${root}/bootmgr bootmgr
      imgfetch --name BCD ${root}/Boot/BCD BCD
      imgfetch --name boot.sdi ${root}/Boot/boot.sdi boot.sdi
      imgfetch --name boot.wim ${root}/sources/boot.wim boot.wim
      boot || read void
      goto failed
      #-----------clonezilla-----------#
      :clonezilla
      set	live	${http}/clonezilla/live
      initrd	${live}/initrd.img	||	goto	failed
      kernel	${live}/vmlinuz	boot=live config noswap nolocales edd=off nomodeset vga=788 nosplash noprompt setkmap=us locale=en_US.UTF-8 fetch=${live}/filesystem.squashfs || goto failed
      boot	||	goto failed
      goto	UMENU
      #-----------freeDOS1.3-----------#
      :freeDOS
      set	iso	${http}/memdisk/iso/FD13LIVE.ISO
      goto	CHMEMISO
      goto	failed
      #-----------HDAT2--Win98?---------#
      :HDAT2
      initrd	${http}/try/HDAT2_7.0.iso
      chain	memdisk iso ||
      goto failed
      #-----------Mini_Windows_10-----------#
      :MiniW10
      set root ${http}/iso/mw10
      kernel ${nfs}/wimboot gui
      imgfetch --name bootmgr.exe ${root}/bootmgr.exe bootmgr.exe
      initrd ${root}/efi/microsoft/boot/fonts/segmono_boot.ttf segmono_boot.ttf
      initrd ${root}/efi/microsoft/boot/fonts/segoe_slboot.ttf segoe_slboot.ttf
      initrd ${root}/efi/microsoft/boot/fonts/segoen_slboot.ttf segoen_slboot.ttf
      initrd ${root}/efi/microsoft/boot/fonts/wgl4_boot.ttf wgl4_boot.ttf
      imgfetch --name BCD ${root}/Boot/bcd BCD
      imgfetch --name boot.sdi ${root}/Boot/boot.sdi boot.sdi
      imgfetch --name boot.wim ${root}/sources/boot.wim boot.wim
      boot || goto failed
      #-----------pMagic-----------#
      :pMagic
      set root ${http}/pmagic/pxe
      kernel	${root}/bzImage64
      imgargs netboot=nfs root=/dev/nfs nfsroot=${fog-ip}:/images/pmagic/contents/pmagic boot=/boot timezone=America/Toronto
      initrd	${root}/initrd.img
      initrd	${root}/files.cgz
      initrd	${root}/fu.img
      initrd	${root}/m64.img
      boot || goto failed
      #-----------redo-----------#
      :redob
      set	path	/iso/redo
      set	live	${http}/iso/redo/live
      kernel	${http}${path}/vmlinuz
      imgargs	vmlinuz edd=off config components union=overlay username=user noswap noeject vga=normal rw rootfstype=squashfs ip=dhcp root=${http}${path} locale=en_US.UTF-8 fetch=${http}${path}/live/filesystem.squashfs boot=live
      initrd	${http}${path}/initrd
      boot	||	goto	failed
      #-----------SPINRITE-----------#
      :SPIN
      set	img	${http}/memdisk/img/SpinRite.img
      goto	MEMIMG
      #-----------sysresc-----------#
      :sysresc
      set root ${nfs}/sysresccd/boot
      kernel ${root}/vmlinuz edd=off setkmap=en copytoram archisobasedir=/sysresccd/boot ip=dhcp archiso_http_srv=${http} checksum startx
      initrd ${root}/intel_ucode.img
      initrd ${root}/amd_ucode.img
      initrd ${root}/sysresccd.img
      boot || goto failed
      #-----------reboot-----------#
      :reboot
      reboot
      #-----------shell-----------#
      :shell
      echo	Type 'exit' to get the back to the menu
      shell	||	goto	failed
      #-----------reload menu-----------#
      :return
      set	menu-timeout	0
      chain	http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac} ||
      prompt
      goto MENU
      autoboot
      

      Side question, do I need “autoboot”, what’s the significance?

      Also I should say that I also have many other ISO files that I am unable to boot. Windows-based, usually installers, are relatively easy - I have then in a separate menu item. Ask if I should display them. These only load in BIOS mode I believe.

      Most, if not all, load via http and I do not copy the files - I mount the ISO file as a loop and boot from that. The only issue is NFS says file not found… I guess the reason maybe because the NFS service loads first, then later, the FS table is processed, then later, Apache service starts. Can anyone confirm or explain the real reason and whether this is good to do?

      Please post your findings if good results.

      I am unsure what imgargs to supply, so some maybe unneeded.

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @yuma
        last edited by george1421

        @yuma Your iPXE menu is more advanced than most have done so there is not a lot of expertise in this area beyond letting FOG manage the iPXE menu.

        Are you showing the complete iPXE menu or only a fragment that gets included in the full ipxe menu?

        If its part of the main iPXE menu and being included then I wonder if you are having a conflict with the tags and values defined in the main ipxe menu? Such as menu and choose

        I’m sure you already know this, but you can look at the FOG iPXE menu by calling this URL http://<fog_server_ip>/fog/service/ipxe/boot.php?mac=00:00:00:00:00

        autoboot is not needed. If you look in the fog iPXE menu the execution should never get that far. It is in there just IF the execution gets to the end of the menu iPXE has something to do other that abend.

        Also I should say that I also have many other ISO files that I am unable to boot. Windows-based, usually installers, are relatively easy - I have then in a separate menu item. Ask if I should display them. These only load in BIOS mode I believe.

        Not every iso / OS can be pxe booted. Many can, but some LOOK for a local CDROM. This is a problem since you are pxe booting. In most cases I’ve been able to pxe boot windows as well as linux based images in UEFI mode. For bios mode as long as the iso is under 2GB you can use the memdisk utility to boot the cdrom directly. Larger than 2GB you have to explode the iso and try NFS or a CIFS share to hold the bits.

        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!

        1 Reply Last reply Reply Quote 0
        • Y
          yuma
          last edited by

          Sorry I was away - thanks for the reply.

          I will remove the “autoboot”, not needed.
          Yes I’ve used that url to see the boot.php. The listing before was only one of several menu items within my FOG configuration. So I guess that makes the bug harder to find. The complete boot menu would be too large for here. (I did find one mistake where I put ‘#’ in the middle of a command rather at start of line.) I set “fog.memtest” as default and it worked, so I definitely have a typo or syntax error in the menu item(s). I’ll closely examine the boot.php.

          Also I see the post (and replies) for booting Hiren’s ISO. I too am having trouble with that. I have followed that tutorial, but when I use tftp, it takes a very long time - eventually iPXE says it timed-out.
          Initally I used http and got it load directly from the loop-mount (no copying). Then I copied the files, like in the tutorial, and it still gave the same result. NFS also give the same result (but needs the file copied). The wimboot summary says:

          ...(Using ..., ...found ..., ...patching ...)
          Directory entry "PXE" not found
          Emulating drive 0x84
          FATAL: no bootmgr.exe
          Press a key to reboot...
          

          All seems to load fine, each line finishes with “ok”. But something must be wrong. Do you know where to look?

          george1421G 1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator @yuma
            last edited by

            @yuma said in How to set menu item as default? (And some other queries):

            but when I use tftp, it takes a very long time - eventually iPXE says it timed-out.

            Well that’s a different issue. We can switch over to http and make things go a bit faster. For the my how to boot thread, for consistency sake I use the majority of tftp. But for big things we can surely switch over to http and see better performance.

            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!

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

            158

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project