2 # Copyright (C) 2009-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/image.mk
10 JFFS2OPTS_NAND
+= --little-endian
--pagesize
=0x800 --no-cleanmarkers
--pad
12 define Image
/mkfs
/jffs2
/sub
/sub
13 $(STAGING_DIR_HOST
)/bin
/mkfs.jffs2
$(3) \
14 -e
$(patsubst %k
,%KiB
,$(1)) -o
$(KDIR
)/root.jffs2-
$(1)-$(2) -d
$(TARGET_DIR
) -v
2>&1 1>/dev
/null | awk
'/^.+$$$$/'
17 define Image
/mkfs
/jffs2
/sub
18 # Do not remov this line
19 $(call Image
/mkfs
/jffs2
/sub
/sub
,$(1),nor
,$(JFFS2OPTS
))
21 dd if
=$(KDIR
)/uImage bs
=4096k conv
=sync
; \
22 dd if
=$(KDIR
)/root.jffs2-
$(1)-nor bs
=128k conv
=sync
; \
23 ) > $(BIN_DIR
)/$(IMG_PREFIX
)-jffs2-
$(1)-nor.img
25 $(call Image
/mkfs
/jffs2
/sub
/sub
,$(1),nand
,$(JFFS2OPTS
) $(JFFS2OPTS_NAND
))
26 $(call add_jffs2_mark
,$(KDIR
)/root.jffs2-
$(1)-nand
)
27 cp
$(KDIR
)/root.jffs2-
$(1)-nand
$(BIN_DIR
)/$(IMG_PREFIX
)-jffs2-
$(1)-nand.img
31 cp
$(LINUX_DIR
)/arch
/arm
/boot
/uImage
$(KDIR
)/uImage
34 define Image
/BuildKernel
35 # do mach-id fixup here, if needed
36 cp
$(KDIR
)/uImage
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
40 $(call Image
/Build
/$(1),$(1))
43 define Image
/Build
/jffs2-128k
45 dd if
=$(KDIR
)/uImage bs
=4096k conv
=sync
; \
46 dd if
=$(KDIR
)/root.
$(1) bs
=128k conv
=sync
; \
47 ) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(1)-nor.img
49 cp
$(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1)-nand.img
52 define Image
/Build
/squashfs
53 $(call prepare_generic_squashfs
,$(KDIR
)/root.squashfs
)
55 dd if
=$(KDIR
)/uImage bs
=4096k conv
=sync
; \
56 dd if
=$(KDIR
)/root.
$(1) bs
=128k conv
=sync
; \
57 ) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).img
60 $(eval
$(call BuildImage
))