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 # add End-of-Filesystem markers
22 echo
-ne
'\xde\xad\xc0\xde' >> $(KDIR
)/root.jffs2-64k
23 echo
-ne
'\xde\xad\xc0\xde' >> $(KDIR
)/root.jffs2-128k
25 $(call Image
/Build
,jffs2-64k
)
26 $(call Image
/Build
,jffs2-128k
)
30 ifeq ($(CONFIG_TARGET_ROOTFS_SQUASHFS
),y
)
31 define Image
/mkfs
/squashfs
32 @mkdir
-p
$(BUILD_DIR
)/root
/jffs
33 $(STAGING_DIR
)/bin
/mksquashfs-lzma
$(BUILD_DIR
)/root
$(KDIR
)/root.squashfs
-nopad
-noappend
-root-owned
$(SQUASHFS_OPTS
)
34 $(call Image
/Build
,squashfs
)
38 ifeq ($(CONFIG_TARGET_ROOTFS_TGZ
),y
)
40 tar -zcf
$(BIN_DIR
)/openwrt-rootfs.tgz
--owner
=root
--group
=root
-C
$(BUILD_DIR
)/root
/ .
45 define Image
/mkfs
/prepare
/default
46 find
$(BUILD_DIR
)/root
-type f
-not
-perm
+0100 | xargs chmod
0644
47 find
$(BUILD_DIR
)/root
-type f
-perm
+0100 | xargs chmod
0755
48 find
$(BUILD_DIR
)/root
-type d | xargs chmod
0755
49 mkdir
-p
$(BUILD_DIR
)/root
/tmp
50 chmod
0777 $(BUILD_DIR
)/root
/tmp
53 define Image
/mkfs
/prepare
54 $(call Image
/mkfs
/prepare
/default
)
63 $(call Image
/mkfs
/prepare
)
64 $(call Image
/BuildKernel
)
65 $(call Image
/mkfs
/jffs2
)
66 $(call Image
/mkfs
/squashfs
)
67 $(call Image
/mkfs
/tgz
)
79 compile
: compile-targets
80 install: compile install-targets