Build iPXE from source


  • Senior Developer

    This document just proves as a method to help with building your own undionly.kpxe and/or snponly.kpxe file at it’s current state.

    I will try to keep this updated, but it will probably be lost in the mix later on.

    There are no guarantee’s that this will work for you, but it is assumed that you have the proper packages installed to build the system. There is plenty of documentation on what’s needed and google will be your friend in this regard as well.

    1.) Download the source from iPXE’s git repository:
    [code]git clone git://git.ipxe.org/ipxe.git[/code]

    2.) Change to the ipxe src directory
    [code]cd ipxe/src[/code]

    3.) Edit the files to allow for Console, bzImage, nfs, https, and image_png
    [code]vi config/general.h[/code]

    Change the appropriate lines so they appear as such: [B]THIS IS FOR UNDIONLY.KPXE[/B]
    [code]#define PXE_STACK
    #define PXE_MENU
    #define DOWNLOAD_PROTO_HTTPS
    #define DOWNLOAD_PROTO_NFS
    #define IMAGE_PXE
    #define IMAGE_BZIMAGE
    #define IMAGE_PNG
    #define AUTOBOOT_CMD
    #define NVO_CMD
    #define CONFIG_CMD
    #define IFMGMT_CMD
    #define IWMGMT_CMD
    #define FCMGMT_CMD
    #define ROUTE_CMD
    #define IMAGE_CMD
    #define DHCP_CMD
    #define SANBOOT_CMD
    #define MENU_CMD
    #define LOGIN_CMD
    #define SYNC_CMD
    #define NSLOOKUP_CMD
    #define TIME_CMD
    #define DIGEST_CMD
    #define LOTEST_CMD
    #define VLAN_CMD
    #define PXE_CMD
    #define REBOOT_CMD
    #define POWEROFF_CMD
    #define IMAGE_TRUST_CMD
    #define PCI_CMD
    #define PARAM_CMD
    #define NEIGHBOUR_CMD
    #define PING_CMD
    #define CONSOLE_CMD
    #define IPSTAT_CMD[/code]

    4.) Edit the file to allow for vesafb (display’s picture behind menu).
    [code]vi config/console.h[/code]

    Change the appropriate lines so they appear as such: [B]THIS IS FOR THE UNDIONLY.KPXE FILE[/B]
    [code]#define CONSOLE_VESAFB[/code]

    5.) Make the embed script:
    [code]cat << EOF > ipxescriptfile
    #!ipxe
    :retry
    dhcp || goto retry
    chain default.ipxe || exit
    EOF[/code]

    6.) Build the undionly file.
    [code]make bin/undionly.kpxe EMBED=ipxescriptfile[/code]

    Once completed with the build, you have created the undionly.kpxe file the same as I have done for FOG 0.33.

    Copy the ipxe/src/bin/undionly.kpxe file to your tftpboot folder on your fog server and you’ll be using it. It’s that simple. For the snponly.kpxe follow these steps.

    1.) Edit the config/general.h file so the appropriate lines read:
    [code]//#define PXE_STACK
    //#define PXE_MENU
    #define DOWNLOAD_PROTO_HTTPS
    #define DOWNLOAD_PROTO_NFS
    //#define IMAGE_PXE
    //#define IMAGE_BZIMAGE
    #define IMAGE_EFI
    #define IMAGE_PNG
    #define AUTOBOOT_CMD
    #define NVO_CMD
    #define CONFIG_CMD
    #define IFMGMT_CMD
    #define IWMGMT_CMD
    #define FCMGMT_CMD
    #define ROUTE_CMD
    #define IMAGE_CMD
    #define DHCP_CMD
    #define SANBOOT_CMD
    #define MENU_CMD
    #define LOGIN_CMD
    #define SYNC_CMD
    #define NSLOOKUP_CMD
    #define TIME_CMD
    #define DIGEST_CMD
    #define LOTEST_CMD
    #define VLAN_CMD
    //#define PXE_CMD
    #define REBOOT_CMD
    #define POWEROFF_CMD
    #define IMAGE_TRUST_CMD
    #define PCI_CMD
    #define PARAM_CMD
    #define NEIGHBOUR_CMD
    #define PING_CMD
    #define CONSOLE_CMD
    #define IPSTAT_CMD[/code]

    2.) Edit the config/console.h file so the vesafb is commented as such:
    [code]//#define CONSOLE_VESAFB[/code]

    3.) Make the snponly.efi
    [code]make bin-x86_64-efi/snponly.efi EMBED=ipxescriptfile[/code]

    Then you’ve created the efi file. While it isn’t working with menu and such yet, hopefully we’ll achieve this in the near future.

    Hopefully this helps everybody.


  • Developer

    For Debian/Ubuntu:
    [CODE] sudo apt-get install binutils-dev[/CODE]

    [B]Would you please edit the post and remove the “on RH” in the code box… I am sure a lot of people don’t understand that this is not part of the command![/B]


  • Moderator

    For Fedora 21, this is required:
    [CODE]yum install binutils-devel[/CODE]
    Reference:
    [url]http://forum.ipxe.org/showthread.php?tid=7508[/url]


  • Moderator

    This post is deleted!

Log in to reply
 

447
Online

38998
Users

10717
Topics

101751
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.