]>
Commit | Line | Data |
---|---|---|
27bc59d4 EA |
1 | ############################################################# |
2 | # | |
dda90723 | 3 | # Build the jffs2 root filesystem image |
27bc59d4 EA |
4 | # |
5 | ############################################################# | |
6 | ||
4b72854d | 7 | JFFS2_OPTS := -e $(BR2_TARGET_ROOTFS_JFFS2_EBSIZE) |
536e98ef | 8 | SUMTOOL_OPTS := $(JFFS2_OPTS) |
27bc59d4 | 9 | |
4b72854d | 10 | ifeq ($(BR2_TARGET_ROOTFS_JFFS2_PAD),y) |
dda90723 | 11 | ifneq ($(strip $(BR2_TARGET_ROOTFS_JFFS2_PADSIZE)),0x0) |
ddcaf144 PK |
12 | JFFS2_OPTS += --pad=$(strip $(BR2_TARGET_ROOTFS_JFFS2_PADSIZE)) |
13 | else | |
14 | JFFS2_OPTS += -p | |
dda90723 | 15 | endif |
72a85109 | 16 | SUMTOOL_OPTS += -p |
dda90723 | 17 | endif |
27bc59d4 | 18 | |
28f46894 | 19 | ifeq ($(BR2_TARGET_ROOTFS_JFFS2_LE),y) |
dda90723 | 20 | JFFS2_OPTS += -l |
72a85109 | 21 | SUMTOOL_OPTS += -l |
dda90723 | 22 | endif |
27bc59d4 | 23 | |
28f46894 | 24 | ifeq ($(BR2_TARGET_ROOTFS_JFFS2_BE),y) |
dda90723 | 25 | JFFS2_OPTS += -b |
536e98ef | 26 | SUMTOOL_OPTS += -b |
dda90723 | 27 | endif |
27bc59d4 | 28 | |
28f46894 BRF |
29 | JFFS2_OPTS += -s $(BR2_TARGET_ROOTFS_JFFS2_PAGESIZE) |
30 | ifeq ($(BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER),y) | |
31 | JFFS2_OPTS += -n | |
536e98ef | 32 | SUMTOOL_OPTS += -n |
28f46894 | 33 | endif |
28f46894 | 34 | |
79c213fb | 35 | JFFS2_TARGET := $(call qstrip,$(BR2_TARGET_ROOTFS_JFFS2_OUTPUT)) |
8a00a1ac | 36 | ifneq ($(TARGET_DEVICE_TABLE),) |
d93b209d | 37 | JFFS2_OPTS += -D $(TARGET_DEVICE_TABLE) |
dda90723 EA |
38 | endif |
39 | ||
27bc59d4 | 40 | |
27bc59d4 | 41 | # |
674d61d8 | 42 | # mtd-host is a dependency which builds a local copy of mkfs.jffs2 if it is needed. |
dda90723 EA |
43 | # the actual build is done from package/mtd/mtd.mk and it sets the |
44 | # value of MKFS_JFFS2 to either the previously installed copy or the one | |
45 | # just built. | |
27bc59d4 | 46 | # |
16b1d2a7 | 47 | $(JFFS2_TARGET): host-fakeroot host-mtd makedevs |
d1345f06 | 48 | # Use fakeroot to pretend all target binaries are owned by root |
397fe5cc TP |
49 | rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) |
50 | touch $(BUILD_DIR)/.fakeroot.00000 | |
51 | cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) | |
52 | echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) | |
0091f181 | 53 | ifneq ($(TARGET_DEVICE_TABLE),) |
d1345f06 | 54 | # Use fakeroot to pretend to create all needed device nodes |
7737b360 | 55 | echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \ |
397fe5cc | 56 | >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) |
0091f181 | 57 | endif |
d1345f06 | 58 | # Use fakeroot so mkfs.jffs2 believes the previous fakery |
536e98ef HM |
59 | ifneq ($(BR2_TARGET_ROOTFS_JFFS2_SUMMARY),) |
60 | echo "$(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $(JFFS2_TARGET).nosummary && " \ | |
61 | "$(SUMTOOL) $(SUMTOOL_OPTS) -i $(JFFS2_TARGET).nosummary -o $(JFFS2_TARGET) && " \ | |
62 | "rm $(JFFS2_TARGET).nosummary" \ | |
397fe5cc | 63 | >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) |
536e98ef | 64 | else |
412ca2a4 | 65 | echo "$(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $(JFFS2_TARGET)" \ |
397fe5cc | 66 | >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) |
536e98ef | 67 | endif |
397fe5cc TP |
68 | chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) |
69 | $(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) | |
70 | -@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET)) | |
dda90723 | 71 | @ls -l $(JFFS2_TARGET) |
48b3e0c9 BRF |
72 | ifeq ($(BR2_JFFS2_TARGET_SREC),y) |
73 | $(TARGET_CROSS)objcopy -I binary -O srec --adjust-vma 0xa1000000 $(JFFS2_TARGET) $(JFFS2_TARGET).srec | |
74 | @ls -l $(JFFS2_TARGET).srec | |
75 | endif | |
dda90723 | 76 | |
dda90723 | 77 | jffs2root: $(JFFS2_TARGET) |
27bc59d4 | 78 | |
d06645d8 EA |
79 | ############################################################# |
80 | # | |
81 | # Toplevel Makefile options | |
82 | # | |
83 | ############################################################# | |
4b72854d | 84 | ifeq ($(BR2_TARGET_ROOTFS_JFFS2),y) |
d06645d8 EA |
85 | TARGETS+=jffs2root |
86 | endif |