build: image: add UBIFS kernel packer
authorRobert Marko <robimarko@gmail.com>
Sun, 18 Apr 2021 17:05:47 +0000 (19:05 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 28 Nov 2021 16:17:22 +0000 (17:17 +0100)
This allows packing the kernel into UBIFS like newer
MikroTik NAND devices require.

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

index 91865e1e7eb1c09b1b1b2bcbfc262f5571f1e144..23c7bd6133dfceb173693720b81e6fd09a8fb6c4 100644 (file)
@@ -27,6 +27,15 @@ define Build/append-kernel
        dd if=$(IMAGE_KERNEL) >> $@
 endef
 
+define Build/package-kernel-ubifs
+       mkdir $@.kernelubifs
+       cp $@ $@.kernelubifs/kernel
+       $(STAGING_DIR_HOST)/bin/mkfs.ubifs \
+               $(KERNEL_UBIFS_OPTS) \
+               -r $@.kernelubifs $@
+       rm -r $@.kernelubifs
+endef
+
 define Build/append-image
        dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@
 endef