diff mbox

[OpenWrt-Devel,02/10] image: add a build step for building and appending an ubinized rootfs

Message ID 1440155859-910-3-git-send-email-jogo@openwrt.org
State Accepted
Headers show

Commit Message

Jonas Gorski Aug. 21, 2015, 11:17 a.m. UTC
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 include/image.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/include/image.mk b/include/image.mk
index 73fc805..fb89ed1 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -345,6 +345,16 @@  define Build/append-rootfs
 	dd if=$(word 2,$^) $(if $(1),bs=$(1) conv=sync) >> $@
 endef
 
+define Build/append-ubi
+	sh $(TOPDIR)/scripts/ubinize-image.sh \
+		$(if $(KERNEL_IN_UBI),--kernel $(word 1,$^)) \
+		$(word 2,$^) \
+		$@.tmp \
+		-p $(BLOCKSIZE) -m $(PAGESIZE) -E 5
+	cat $@.tmp >> $@
+	rm $@.tmp
+endef
+
 define Build/pad-to
 	dd if=$@ of=$@.new bs=$(1) conv=sync
 	mv $@.new $@