build: add mkrasimage

The current make-ras.sh image generation script for the ZyXEL NBG6617
has portability issues with bash. Because of this, factory images are
currently not built correctly by the OpenWRT buildbots.

This commit replaces the make-ras.sh by C-written mkrasimage.

The new mkrasimage is also compatible with other ZyXEL devices using
the ras image-format.
This is not tested with the NBG6616 but it correctly builds the
header for ZyXEL factory image.

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer
2018-08-22 17:30:44 +02:00
committed by John Crispin
parent 8132e06247
commit 8e9a59a6b9
7 changed files with 480 additions and 208 deletions

View File

@@ -49,17 +49,17 @@ define Build/eva-image
mv $@.new $@
endef
define Build/make-ras
define Build/zyxel-ras-image
let \
newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
$(TOPDIR)/scripts/make-ras.sh \
--board $(RAS_BOARD) \
--version $(RAS_VERSION) \
--kernel $(call param_get_default,kernel,$(1),$(IMAGE_KERNEL)) \
--rootfs $@ \
--rootfssize $$newsize \
$@.new
@mv $@.new $@
$(STAGING_DIR_HOST)/bin/mkrasimage \
-b $(RAS_BOARD) \
-v $(RAS_VERSION) \
-r $@ \
-s $$newsize \
-o $@.new \
$(if $(findstring separate-kernel,$(word 1,$(1))),-k $(IMAGE_KERNEL)) \
&& mv $@.new $@
endef
define Build/mkbuffaloimg