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