1
1
openwrt/target/linux/x86/image
Keno Fischer c7e8cffcb2
x86: add onie-installer image type
The current documentation for using OpenWRT on Mellanox Spectrum
switches (https://openwrt.org/toh/mellanox/spectrum) suggests
reflashing the entire harddrive from the recovery USB. This is not
the most friendly way to install a new OS on these switches. From
factory, they come with ONIE (Open Network Install Environment),
which is a linux-based preboot environment for fetching an OS
image from the network and installing it on disk. The installer
is a self-executing bash script that executes inside the ONIE
environment. The installer is expected to preserve the ONIE partition
for use as recovery environement. To be a better citizen on
these platforms, it would be preferrable to provide OpenWRT as
an ONIE-compatible installer.

This PR adds an ONIE_INSTALLER_IMAGES build option that produces
an ONIE compatible .bin. The generated .bin follows the ONIE demo
installer pattern [1]: it creates a new GPT partition
labelled OPENWRT-ROOT on the ONIE install device, formats ext4, extracts
the OpenWrt rootfs and kernel into it, installs GRUB into the existing
UEFI ESP under bootloader-id "OpenWrt", and adds a NVRAM boot entry via
efibootmgr.  ONIE-BOOT is preserved so ONIE rescue remains available.

Tested with the config at [2] on a Mellanox Spectrum SN3800 to produce
a booting OpenWRT install.

[1] https://github.com/opencomputeproject/onie/demo/installer/grub-arch/install.sh
[2] https://gist.github.com/Keno/abc8c5b72645e73fadd1ff0d9616b23d

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Keno Fischer <keno@juliahub.com>
Link: https://github.com/openwrt/openwrt/pull/23062
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-23 17:23:53 +02:00
..
64.mk x86: Add kmod-drm-i915 as default package 2025-01-30 13:08:17 +01:00
generic.mk x86: Add kmod-drm-i915 as default package 2025-01-30 13:08:17 +01:00
geode.mk x86: geode: fix package nameing kmod-crypto-ebc does not exist 2022-02-26 13:36:30 +01:00
grub-efi.cfg x86: grub2: search for the "kernel" filesystem on all disks 2022-02-24 20:45:12 +01:00
grub-iso.cfg x86: generate EFI platform bootable images 2020-03-31 16:20:47 +02:00
grub-pc.cfg x86: switch image generation to new code 2020-03-21 10:36:00 +00:00
legacy.mk x86: Add kmod-drm-i915 as default package 2025-01-30 13:08:17 +01:00
Makefile x86: add onie-installer image type 2026-05-23 17:23:53 +02:00
onie-install.sh.in x86: add onie-installer image type 2026-05-23 17:23:53 +02:00