1 KDIR
:=$(BUILD_DIR
)/linux-
$(KERNEL
)-$(BOARD
)
3 ifneq ($(CONFIG_BIG_ENDIAN
),y
)
4 JFFS2OPTS
:= --pad
--little-endian
--squash
7 JFFS2OPTS
:= --pad
--big-endian
--squash
11 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),y
)
12 ifeq ($(CONFIG_TARGET_ROOTFS_JFFS2
),y
)
13 define Image
/mkfs
/jffs2
14 rm -rf
$(BUILD_DIR
)/root
/jffs
16 $(STAGING_DIR
)/bin
/mkfs.jffs2
$(JFFS2OPTS
) -e
0x10000 -o
$(KDIR
)/root.jffs2-64k
-d
$(BUILD_DIR
)/root
17 $(STAGING_DIR
)/bin
/mkfs.jffs2
$(JFFS2OPTS
) -e
0x20000 -o
$(KDIR
)/root.jffs2-128k
-d
$(BUILD_DIR
)/root
19 # add End-of-Filesystem markers
20 echo
-ne
'\xde\xad\xc0\xde' >> $(KDIR
)/root.jffs2-64k
21 echo
-ne
'\xde\xad\xc0\xde' >> $(KDIR
)/root.jffs2-128k
23 $(call Image
/Build
,jffs2-64k
)
24 $(call Image
/Build
,jffs2-128k
)
28 ifeq ($(CONFIG_TARGET_ROOTFS_SQUASHFS
),y
)
29 define Image
/mkfs
/squashfs
30 @mkdir
-p
$(BUILD_DIR
)/root
/jffs
31 $(STAGING_DIR
)/bin
/mksquashfs-lzma
$(BUILD_DIR
)/root
$(KDIR
)/root.squashfs
-nopad
-noappend
-root-owned
$(SQUASHFS_OPTS
)
32 $(call Image
/Build
,squashfs
)
36 ifeq ($(CONFIG_TARGET_ROOTFS_TGZ
),y
)
38 tar -zcf
$(BIN_DIR
)/openwrt-rootfs.tgz
--owner
=root
--group
=root
-C
$(BUILD_DIR
)/root
/ .
43 define Image
/mkfs
/prepare
/default
44 find
$(BUILD_DIR
)/root
-type f
-not
-perm
+0100 | xargs chmod
0644
45 find
$(BUILD_DIR
)/root
-type f
-perm
+0100 | xargs chmod
0755
46 find
$(BUILD_DIR
)/root
-type d | xargs chmod
0755
47 mkdir
-p
$(BUILD_DIR
)/root
/tmp
48 chmod
0777 $(BUILD_DIR
)/root
/tmp
51 define Image
/mkfs
/prepare
52 $(call Image
/mkfs
/prepare
/default
)
61 $(call Image
/mkfs
/prepare
)
62 $(call Image
/BuildKernel
)
63 $(call Image
/mkfs
/jffs2
)
64 $(call Image
/mkfs
/squashfs
)
65 $(call Image
/mkfs
/tgz
)
77 compile
: compile-targets
78 install: compile install-targets