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
commit46f6626052e9a4da474db530f41508ef41915767 (patch)
tree3bdf1db8ebc1eeb7e2f5b067c75089d6758cdcf8 /include
parent141793c96cb9fb39f8848961bf0738976d9805ad (diff)
downloadupstream-46f6626052e9a4da474db530f41508ef41915767.tar.gz
upstream-46f6626052e9a4da474db530f41508ef41915767.tar.bz2
upstream-46f6626052e9a4da474db530f41508ef41915767.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> SVN-Revision: 47404
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 $^ $@