add 0xdeadc0de to the jffs2 filesystem images
[openwrt.git] / include / image.mk
1 include $(TOPDIR)/rules.mk
2
3 KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
4
5 ifneq ($(CONFIG_BIG_ENDIAN),y)
6 JFFS2OPTS := --pad --little-endian --squash
7 SQUASHFS_OPTS := -le
8 else
9 JFFS2OPTS := --pad --big-endian --squash
10 SQUASHFS_OPTS := -be
11 endif
12
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
17
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
20
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
24
25 $(call Image/Build,jffs2-64k)
26 $(call Image/Build,jffs2-128k)
27 endef
28 endif
29
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)
35 endef
36 endif
37
38 ifeq ($(CONFIG_TARGET_ROOTFS_TGZ),y)
39 define Image/mkfs/tgz
40 tar -zcf $(BIN_DIR)/openwrt-rootfs.tgz --owner=root --group=root -C $(BUILD_DIR)/root/ .
41 endef
42 endif
43 endif
44
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
51 endef
52
53 define Image/mkfs/prepare
54 $(call Image/mkfs/prepare/default)
55 endef
56
57 define BuildImage
58 compile:
59 $(call Build/Compile)
60
61 install:
62 $(call Image/Prepare)
63 $(call Image/mkfs/prepare)
64 $(call Image/BuildKernel)
65 $(call Image/mkfs/jffs2)
66 $(call Image/mkfs/squashfs)
67 $(call Image/mkfs/tgz)
68
69 clean:
70 $(call Build/Clean)
71 endef
72
73 compile-targets:
74 install-targets:
75 clean-targets:
76
77 source:
78 prepare:
79 compile: compile-targets
80 install: compile install-targets
81 clean: clean-targets
This page took 0.054616 seconds and 5 git commands to generate.