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

    How to update Memtest86+ to 6.20

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    2
    6
    1.1k
    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.
    • N
      NX06
      last edited by

      Hello,

      I’d like to update the version of memtest 86+ that comes preinstalled with fog and still be able to schedule memtest as a task from the Web GUI.
      The currently newest version is 6.20 and supports UEFI PXE Boot.
      fog version 1.5.10

      I tried replacing the memtest.efi-file in /fogproject/packages/web/service/ipxe with the newer one (memtest64.efi) and editing the memtest kernel name in the general fog settings.

      But this leads to ‘Exec formatting Errors’ in iPXE.
      What are the config-Files that might have to be edited and which files need to be placed where on the (freshly installed) fog-server?

      BR
      Chris

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

        @NX06 I have not tried this update before so this will mostly be an educated guess to get you started. Note that you should not need to hack any FOG programming to make this newer version of memtest work.

        Note1: Understand the version of memtest86 that ships with FOG only works with BIOS based computers. For UEFI computers you will need a uefi compatible kernel.

        The FOG iPXE menu is created by the boot.php program. If you want to view the contents of the FOG iPXE menu just key in the following url into a brower. http://<fog_server_ip>/fog/service/ipxe/boot.php Looking at the programming code you will see this section that creates the menu on the screen.

        item fog.local Boot from hard disk
        >> item fog.memtest Run Memtest86+
        item fog.reginput Perform Full Host Registration and Inventory
        item fog.reg Quick Registration and Inventory
        item fog.deployimage Deploy Image
        item fog.multijoin Join Multicast Session
        item fog.sysinfo Client System Information (Compatibility)
        choose --default fog.local --timeout 3000 target && goto ${target}
        :fog.local
        sanboot --no-describe --drive 0x80 || goto MENU
        >> :fog.memtest
        >> kernel memdisk initrd=memtest.bin iso raw
        >> initrd memtest.bin
        >> boot || goto MENU
        

        I’ve highlighted the section of the code that is most important to you with the >> symbols.

        You see when you select the Run Memtest86+ menu item it runs the commands

        kernel memdisk initrd=memtest.bin iso raw
        initrd memtest.bin
        

        So the Kernel loaded will be memdisk which will intern load and run memtest.bin.

        Note2: When you update the FOG settings General Settings->MEMTEST KERNEL its changing the iso image that will be loaded by the bios program memdisk. This is why with your configuration is failing. You are trying to chain to a uefi program (memtest64.efi) from a bios program (saying it using simple words).

        So how should you fix this? Simply by creating a new FOG iPXE menu to replace the FOG supplied Run Memtest86+ Your new FOG iPXE menu will be a bit smarter than the FOG supplied menu in that (if this works) when you pxe boot a bios based computer the legacy bios memtest will be used and when you pxe boot a uefi computer the uefi memtest will be used.

        iPXE is actually a programming language that creates and runs the FOG iPXE menu. Knowing this will will try to create a script that will call the bios files for a bios computer and uefi files for a uefi based computer.

          if  iseq ${platform} efi {
            kernel memtest64.efi
            boot || goto MENU
          }
          else {
            kernel memdisk initrd=memtest.bin iso raw
            initrd memtest.bin
            boot || goto MENU
          }
        

        Note3; I have not tested this to see if this script will work. I just glued bits of code together into a logical script.

        We test to see if the pxe booting platform is uefi or bios. If its uefi then we load your new memtest64 uefi file and boot it. If its bios then we call the FOG supplied commands.

        ref: https://ipxe.org/cfg/platform

        Now you have that script go into FOG Settings-> New iPXE menu.

        Set the following fields
        Menu Item: util.memtest64
        Description: Run Memtest64+
        Parameters:
        if iseq ${platform} efi {
        kernel memtest64.efi
        boot || goto MENU
        }
        else {
        kernel memdisk initrd=memtest.bin iso raw
        initrd memtest.bin
        boot || goto MENU
        }
        Menu Show with: All Hosts

        ref: https://forums.fogproject.org/topic/10944/using-fog-to-pxe-boot-into-your-favorite-installer-images

        Now pxe boot a uefi based computer and check to see if the new memtest program boots, then confirm that a bios based computer works.

        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!

        N 1 Reply Last reply Reply Quote 0
        • N
          NX06
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • N
            NX06 @george1421
            last edited by

            @george1421 Thank you for your writeup. That information helps a lot.
            Tough it seems that the if-clause is not supported in that context, or that the syntax is off.

            After selecting the memtest64 option in the iPXE-Menu i got an error message of: “if: command not found”
            Without the if-clause using only the efi instructions this solution worked flawlessly. Thank you for your help in that.

            Should this Parameters section in theory support these kinds of flow control?
            Or is it expected/safer to call an additional script with the menu item to let that script then work through the logic?

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

              @NX06 Well researching this a bit more it seems like the if/then/else command is a bit more primitive than in my example.

              Lets change this:

                if  iseq ${platform} efi {
                  kernel memtest64.efi
                  boot || goto MENU
                }
                else {
                  kernel memdisk initrd=memtest.bin iso raw
                  initrd memtest.bin
                  boot || goto MENU
                }
              

              Into this

              goto mem-${platform}
              
              :mem-efi
                  kernel memtest64.efi
                  boot || goto MENU
                  goto mem-exit
              
              :mem-pcbios
                  kernel memdisk initrd=memtest.bin iso raw
                  initrd memtest.bin
                  boot || goto MENU
                  goto mem-exit
              
              :mem-exit
                  goto MENU
              
              

              If everything works correctly it should never get to the :mem-exit location tag.

              As I said I never tested it only glued 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!

              N 1 Reply Last reply Reply Quote 0
              • N
                NX06 @george1421
                last edited by

                @george1421

                Just tested it and it works correctly.
                Thank you for your effort.

                For other beginners with iPXE like me:
                This is the relevant documentation for the flow control.
                https://ipxe.org/scripting
                With examples at
                https://ipxe.org/examples

                1 Reply Last reply Reply Quote 0
                • [[undefined-on, george1421G george1421, ]]
                • george1421G george1421 referenced this topic on
                • 1 / 1
                • First post
                  Last post

                258

                Online

                12.0k

                Users

                17.3k

                Topics

                155.2k

                Posts
                Copyright © 2012-2024 FOG Project