aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-11-07 12:51:31 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-11-07 12:51:31 +0000
commit005e2d4e5ce338350bc538d8b8ffc5d6c7d0cd22 (patch)
tree29e08fc139fc9381e2711d478c4a9c10bbc83bb4 /include
parent142a5d2615748e9fe9ced29ba3f7074ff7ebae60 (diff)
downloadmaster-187ad058-005e2d4e5ce338350bc538d8b8ffc5d6c7d0cd22.tar.gz
master-187ad058-005e2d4e5ce338350bc538d8b8ffc5d6c7d0cd22.tar.bz2
master-187ad058-005e2d4e5ce338350bc538d8b8ffc5d6c7d0cd22.zip
include/image.mk: Introduce generic option to wrap kernel into JFFS2
Some devices require the kernel to be in a JFFS2 file system. Make the support for this more generic so that it can be used by other devices. Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47404 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include')
-rw-r--r--include/image.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/image.mk b/include/image.mk
index 5cd0d2302b..a6ea8e5452 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -347,6 +347,21 @@ define Build/gzip
@mv $@.new $@
endef
+define Build/jffs2
+ rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \
+ mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \
+ cp $@ $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$(1) && \
+ $(STAGING_DIR_HOST)/bin/mkfs.jffs2 --pad \
+ $(if $(CONFIG_BIG_ENDIAN),--big-endian,--little-endian) \
+ --squash-uids -v -e $(patsubst %k,%KiB,$(BLOCKSIZE)) \
+ -o $@.new \
+ -d $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 \
+ 2>&1 1>/dev/null | awk '/^.+$$$$/' && \
+ $(STAGING_DIR_HOST)/bin/padjffs2 $@.new -J $(patsubst %k,,$(BLOCKSIZE))
+ -rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/
+ @mv $@.new $@
+endef
+
define Build/kernel-bin
rm -f $@
cp $^ $@