build: image: add command to ubinize the kernel image
authorRobert Marko <robimarko@gmail.com>
Mon, 20 Sep 2021 10:19:37 +0000 (12:19 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 28 Nov 2021 16:17:22 +0000 (17:17 +0100)
Newer NAND devices from MikroTik like the hAP ac3
require the kernel to be packed into UBIFS and then
ubinized.

So, since the ubinize-image.sh script can now ubinize
kernel only as well lets add a command for it.

This now allows calling ubinize-kernel in the kernel
packaging at then end.

Signed-off-by: Robert Marko <robimarko@gmail.com>
include/image-commands.mk

index 4b5ff36ebeebfb89cc57836780b5876f30fe6c1c..f0557936c9d7281199bb924a1301ba04f81cc470 100644 (file)
@@ -122,6 +122,18 @@ define Build/append-ubi
        rm $@.tmp
 endef
 
+define Build/ubinize-kernel
+       cp $@ $@.tmp
+       sh $(TOPDIR)/scripts/ubinize-image.sh \
+               --kernel $@.tmp \
+               $@ \
+               -p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
+               $(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
+               $(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
+               $(UBINIZE_OPTS)
+       rm $@.tmp
+endef
+
 define Build/append-uboot
        dd if=$(UBOOT_PATH) >> $@
 endef