]> Git Repo - buildroot-mgba.git/blame - target/jffs2/jffs2root.mk
ext2: convert to ROOTFS_TARGET infrastructure
[buildroot-mgba.git] / target / jffs2 / jffs2root.mk
CommitLineData
27bc59d4
EA
1#############################################################
2#
dda90723 3# Build the jffs2 root filesystem image
27bc59d4
EA
4#
5#############################################################
6
4b72854d 7JFFS2_OPTS := -e $(BR2_TARGET_ROOTFS_JFFS2_EBSIZE)
536e98ef 8SUMTOOL_OPTS := $(JFFS2_OPTS)
27bc59d4 9
4b72854d 10ifeq ($(BR2_TARGET_ROOTFS_JFFS2_PAD),y)
dda90723 11ifneq ($(strip $(BR2_TARGET_ROOTFS_JFFS2_PADSIZE)),0x0)
ddcaf144
PK
12JFFS2_OPTS += --pad=$(strip $(BR2_TARGET_ROOTFS_JFFS2_PADSIZE))
13else
14JFFS2_OPTS += -p
dda90723 15endif
72a85109 16SUMTOOL_OPTS += -p
dda90723 17endif
27bc59d4 18
28f46894 19ifeq ($(BR2_TARGET_ROOTFS_JFFS2_LE),y)
dda90723 20JFFS2_OPTS += -l
72a85109 21SUMTOOL_OPTS += -l
dda90723 22endif
27bc59d4 23
28f46894 24ifeq ($(BR2_TARGET_ROOTFS_JFFS2_BE),y)
dda90723 25JFFS2_OPTS += -b
536e98ef 26SUMTOOL_OPTS += -b
dda90723 27endif
27bc59d4 28
28f46894
BRF
29JFFS2_OPTS += -s $(BR2_TARGET_ROOTFS_JFFS2_PAGESIZE)
30ifeq ($(BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER),y)
31JFFS2_OPTS += -n
536e98ef 32SUMTOOL_OPTS += -n
28f46894 33endif
28f46894 34
79c213fb 35JFFS2_TARGET := $(call qstrip,$(BR2_TARGET_ROOTFS_JFFS2_OUTPUT))
8a00a1ac 36ifneq ($(TARGET_DEVICE_TABLE),)
d93b209d 37JFFS2_OPTS += -D $(TARGET_DEVICE_TABLE)
dda90723
EA
38endif
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 53ifneq ($(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 57endif
d1345f06 58 # Use fakeroot so mkfs.jffs2 believes the previous fakery
536e98ef
HM
59ifneq ($(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 64else
412ca2a4 65 echo "$(MKFS_JFFS2) $(JFFS2_OPTS) -d $(TARGET_DIR) -o $(JFFS2_TARGET)" \
397fe5cc 66 >> $(BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))
536e98ef 67endif
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
72ifeq ($(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
75endif
dda90723 76
dda90723 77jffs2root: $(JFFS2_TARGET)
27bc59d4 78
d06645d8
EA
79#############################################################
80#
81# Toplevel Makefile options
82#
83#############################################################
4b72854d 84ifeq ($(BR2_TARGET_ROOTFS_JFFS2),y)
d06645d8
EA
85TARGETS+=jffs2root
86endif
This page took 0.167508 seconds and 4 git commands to generate.