1 include $(TOPDIR
)/rules.mk
3 KDIR
:=$(BUILD_DIR
)/linux-
$(KERNEL
)-$(BOARD
)
5 ifneq ($(CONFIG_BIG_ENDIAN
),y
)
6 JFFS2OPTS
:= --pad
--little-endian
--squash
9 JFFS2OPTS
:= --pad
--big-endian
--squash
13 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),y
)
14 ifeq ($(CONFIG_TARGET_ROOTFS_JFFS2
),y
)
15 define Image
/mkfs
/jffs2
16 rm -rf
$(BUILD_DIR
)/root
/jffs
18 $(STAGING_DIR
)/bin
/mkfs.jffs2
$(JFFS2OPTS
) -e
0x10000 -o
$(KDIR
)/root.jffs2-64k
-d
$(BUILD_DIR
)/root
19 $(STAGING_DIR
)/bin
/mkfs.jffs2
$(JFFS2OPTS
) -e
0x20000 -o
$(KDIR
)/root.jffs2-128k
-d
$(BUILD_DIR
)/root
21 $(call Image
/Build
,jffs2-64k
)
22 $(call Image
/Build
,jffs2-128k
)
26 ifeq ($(CONFIG_TARGET_ROOTFS_SQUASHFS
),y
)
27 define Image
/mkfs
/squashfs
28 @mkdir
-p
$(BUILD_DIR
)/root
/jffs
29 $(STAGING_DIR
)/bin
/mksquashfs-lzma
$(BUILD_DIR
)/root
$(KDIR
)/root.squashfs
-nopad
-noappend
-root-owned
$(SQUASHFS_OPTS
)
30 $(call Image
/Build
,squashfs
)
34 ifeq ($(CONFIG_TARGET_ROOTFS_TGZ
),y
)
36 tar -zcf
$(BIN_DIR
)/openwrt-rootfs.tgz
--owner
=root
--group
=root
-C
$(BUILD_DIR
)/root
/ .
41 define Image
/mkfs
/prepare
/default
42 find
$(BUILD_DIR
)/root
-type f
-not
-perm
+0100 | xargs chmod
0644
43 find
$(BUILD_DIR
)/root
-type f
-perm
+0100 | xargs chmod
0755
44 find
$(BUILD_DIR
)/root
-type d | xargs chmod
0755
45 mkdir
-p
$(BUILD_DIR
)/root
/tmp
46 chmod
0777 $(BUILD_DIR
)/root
/tmp
49 define Image
/mkfs
/prepare
50 $(call Image
/mkfs
/prepare
/default
)
59 $(call Image
/mkfs
/prepare
)
60 $(call Image
/BuildKernel
)
61 $(call Image
/mkfs
/jffs2
)
62 $(call Image
/mkfs
/squashfs
)
63 $(call Image
/mkfs
/tgz
)
75 compile
: compile-targets
76 install: compile install-targets