How do I build an ITB image with the Image Builder?

Hello,

I'm experimenting with the Netgear RBR40 and I would like to build a custom ITB image with the Image Builder so I can load OpenWRT into memory and boot without overwriting the eMMC. ITB blobs are available for my device in the firmware selector and they function as expected, but I couldn't find any documentation on how to create my own with custom packages.

Can anyone point me in the right direction?

Thanks,
--tyami94

edit: accidentally said image builder instead of firmware selector

You can use the firmware selector. Click on the “customize installed packages” option and you can add/remove packages based on your needs.

Thanks for the quick response!

This did not work, it only gave me factory and sysupgrade images. I explicitly need a FIT blob that I can load straight into RAM and have uboot know what to do with it, and I'd prefer to build it locally if possible. Can this be done?

Have you tried the image builder (locally)?

Yes, that's what I'm trying to use. I think my question might've been slightly misunderstood. I can generate factory and sysupgrade images, but those are not what I need.

u-boot has no idea what to do with the factory image because it's not a proper FIT blob, and the sysupgrade image is just a tarball.

I'm attached to the device's UART and I've got a u-boot shell. I need to be able to generate an ITB/FIT blob (unsure of correct term) with custom packages/uci-defaults that I can just dump into the RAM with tftpboot and load with bootm so I don't have to tamper with the device's flash memory.

The firmware selector has minimal FIT blobs under the "Kernel" button (openwrt-25.12.2-ipq40xx-generic-netgear_rbr40-initramfs-zImage.itb) and I was able to load and use them, but I need to be able to make a custom one. The firmware selector does not generate one when I customize the image, nor does the image builder.

The process by which these are generated doesn't seem to be documented anywhere, but the release system seems to automatically generate them for every device for each new version of OpenWRT. Is there anything public that I can look at to figure out how these are generated when new OpenWRT release images are cut?

The imagebuilders by design do not create initramfs images, just factory and sysupgrade images. You'll need to use the full buildroot to create an initramfs image.

Your specific device's definition is here, but you need to chase back up a bunch of defines to find where it gets the FitzImage generated.

Ah, thanks! That seems quite intimidating, I was hoping there'd be a more turn-key way of generating them.

How does the release team generate them at scale? Is there any code available so I could see a working implementation? I have no experience with buildroot or the OpenWRT build system (beyond a topical level), so I don't know where to start here.

Basically the buildbots just generate an appropriate .config for the target then do make...

It's not too bad if you've got a Linux box, do all this as your normal user, not root as that will get you into trouble very quickly.

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git checkout main
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make download

and you're ready to build, but the target and device haven't been specified, plus the build artifacts only contain the default packages, so

make menuconfig

and start poking around. Set your target and device right at the top.

To find packages use menuconfig's search function. Say, to find the tcpdump package so you can include it in your custom images, type /tcpdump and you'll get a list of candidates. The list usually shows a number next to the result in the tui, type that number and it jumps right to the entry for that item.

Run make help or make <tab><tab> to show various commands available, just make world will compile everything you've configured above.

There's a bunch of stuff in the wiki, here are a couple to start:
https://openwrt.org/docs/guide-developer/toolchain/buildsystem_essentials
https://openwrt.org/docs/guide-developer/feeds