Skip to content

Latest commit

 

History

History
124 lines (90 loc) · 3.69 KB

File metadata and controls

124 lines (90 loc) · 3.69 KB

IPXE image-building tools

This directory contains tools for building customized iPXE images for network booting OpenShift nodes in HotStack scenarios.

Download Pre-built Images (Recommended)

Pre-built iPXE images are available from GitHub releases:

# Download BIOS boot image
curl -L -O https://github.com/openstack-k8s-operators/hotstack/releases/download/latest-ipxe/ipxe-bios-latest.img

# Download UEFI boot image
curl -L -O https://github.com/openstack-k8s-operators/hotstack/releases/download/latest-ipxe/ipxe-efi-latest.img

For specific versions, see the releases page.

Uploading the iPXE Images to Glance

  1. Upload the USB boot image for OCP nodes:

    Use ipxe-boot-usb.raw if built locally, or ipxe-bios-latest.img if downloaded.

    openstack image create --disk-format=raw --file ipxe-bios-latest.img ipxe-boot-usb \
      --property os_shutdown_timeout=5 \
      --public
  2. Upload images for sushy-emulator rescue mode net-boot:

    UEFI boot image (use efi.img if built locally, or ipxe-efi-latest.img if downloaded from GitHub):

    openstack image create --disk-format=raw --file ipxe-efi-latest.img ipxe-rescue-uefi \
      --property os_shutdown_timeout=5 \
      --property hw_firmware_type=uefi \
      --property hw_machine_type=q35 \
      --property hw_rescue_device=cdrom \
      --property hw_rescue_bus=usb \
      --public

    BIOS boot image (use ipxe-boot-usb.raw if built locally, or ipxe-bios-latest.img if downloaded):

    openstack image create --disk-format=raw --file ipxe-bios-latest.img ipxe-rescue-bios \
      --property os_shutdown_timeout=5 \
      --property hw_rescue_device=cdrom \
      --property hw_rescue_bus=usb \
      --public

Building Images Locally

The following sections describe how to build iPXE images locally using the included Makefile. The Makefile automates the process of building customized iPXE images for different use cases, such as booting from USB, ISO, or EFI. It allows for custom configuration of iPXE by embedding a custom script (script.ipxe) and copying local configuration headers from ipxe-config/ into the iPXE source directory.

Build dependencies

To build the iPXE images, you need to install the following dependencies:

  • gcc - For compiling iPXE
  • make - Build system
  • perl - Required by iPXE build scripts
  • git - To clone the iPXE repository
  • guestfs-tools (provides virt-make-fs) - For creating the EFI FAT filesystem image

On Fedora/RHEL/CentOS:

sudo dnf install -y gcc make perl git guestfs-tools

On Ubuntu/Debian:

sudo apt-get install -y gcc make perl git libguestfs-tools

Variables

  • IPXE_SRCDIR: The directory containing the iPXE source code.
  • IPXE_USB, IPXE_EFI: The specific iPXE images to use as the boot image for USB and EFI formats.
  • ipxe_usb_path, ipxe_efi_path: The paths to the iPXE images in the source directory.

Targets

  • all: The default target that builds both image formats (efi.img and ipxe-boot-usb.raw).
  • efi.img: Creates an EFI image by copying the iPXE EFI binary to a FAT filesystem and creating a raw image.
  • ipxe-boot-usb.raw: Simply copies the iPXE USB image to a raw file.
  • clean: Removes all generated files and the iPXE source code directory.

Examples

Building the iPXE Images

  1. Build all iPXE images:

    make
  2. To build a specific image, use:

    make efi.img
    make ipxe-boot-usb.raw