Add custom image format

Hello,
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.

Thanks
lal12

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

For example, from target/linux/ath79/image/generic.mk

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
endef

The "functions" are generally defined in include/image-commands.mk

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