Add custom image format

I am new to the openwrt build system. I am trying to add a new image format to a device, I didn't find any documentation on that.

Could someone point me to the right starting point?

I have to concat preloader + kernel + rootfs.


It will depend on your target, but for most, it is in image/

For example, from target/linux/ath79/image/

define Device/adtran_bsap1880
  ATH_SOC := ar7161
  DEVICE_VENDOR := Adtran/Bluesocket
  DEVICE_PACKAGES += -swconfig -uboot-envtools fconfig
  KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
  KERNEL_INITRAMFS := kernel-bin | append-dtb
  IMAGE_SIZE := 11200k
  IMAGES += kernel.bin rootfs.bin
  IMAGE/kernel.bin := append-kernel
  IMAGE/rootfs.bin := append-rootfs | pad-rootfs
  IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata

The "functions" are generally defined in include/

The pipe character | is effectively a separator, not a shell pipe.