1 ################################################################################
5 ################################################################################
8 MTD_SOURCE
= mtd-utils-
$(MTD_VERSION
).
tar.bz2
9 MTD_SITE
= ftp
://ftp.infradead.org
/pub
/mtd-utils
11 MTD_LICENSE_FILES
= COPYING
13 MTD_INSTALL_STAGING
= YES
15 ifeq ($(BR2_PACKAGE_MTD_MKFSJFFS2
),y
)
16 MTD_DEPENDENCIES
= zlib lzo
19 ifeq ($(BR2_PACKAGE_MTD_MKFSUBIFS
),y
)
20 MTD_DEPENDENCIES
+= util-linux zlib lzo host-pkgconf
21 define MTD_ADD_MISSING_LINTL
22 $(SED
) "/^LDLIBS_mkfs\.ubifs/ s%$$% `$(PKG_CONFIG_HOST_BINARY) --libs uuid`%" \
25 MTD_POST_PATCH_HOOKS
+= MTD_ADD_MISSING_LINTL
28 ifeq ($(BR2_PACKAGE_BUSYBOX
),y
)
29 MTD_DEPENDENCIES
+= busybox
32 # If extended attributes are required, the acl package must
33 # also be enabled which will also include the attr package.
34 ifeq ($(BR2_PACKAGE_ACL
),y
)
35 MTD_DEPENDENCIES
+= acl
36 MTD_MAKE_OPTS
+= WITHOUT_XATTR
=0
38 MTD_MAKE_OPTS
+= WITHOUT_XATTR
=1
41 HOST_MTD_DEPENDENCIES
= host-zlib host-lzo host-e2fsprogs
43 define HOST_MTD_BUILD_CMDS
44 $(HOST_CONFIGURE_OPTS
) $(MAKE1
) \
45 CROSS
= BUILDDIR
=$(@D
) WITHOUT_XATTR
=1 -C
$(@D
)
48 define HOST_MTD_INSTALL_CMDS
49 $(MAKE1
) BUILDDIR
=$(@D
) DESTDIR
=$(HOST_DIR
) -C
$(@D
) install
52 MKFS_JFFS2
= $(HOST_DIR
)/usr
/sbin
/mkfs.jffs2
53 SUMTOOL
= $(HOST_DIR
)/usr
/sbin
/sumtool
55 MTD_STAGING_y
= lib
/libmtd.a ubi-utils
/libubi.a
56 MTD_TARGETS_
$(BR2_PACKAGE_MTD_DOCFDISK
) += docfdisk
57 MTD_TARGETS_
$(BR2_PACKAGE_MTD_DOC_LOADBIOS
) += doc_loadbios
58 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FLASHCP
) += flashcp
59 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FLASH_ERASE
) += flash_erase
60 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FLASH_LOCK
) += flash_lock
61 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FLASH_OTP_DUMP
) += flash_otp_dump
62 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FLASH_OTP_INFO
) += flash_otp_info
63 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FLASH_OTP_LOCK
) += flash_otp_lock
64 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FLASH_OTP_WRITE
) += flash_otp_write
65 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FLASH_UNLOCK
) += flash_unlock
66 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FTL_CHECK
) += ftl_check
67 MTD_TARGETS_
$(BR2_PACKAGE_MTD_FTL_FORMAT
) += ftl_format
68 MTD_TARGETS_
$(BR2_PACKAGE_MTD_JFFS2DUMP
) += jffs2dump
69 MTD_TARGETS_
$(BR2_PACKAGE_MTD_MKFSJFFS2
) += mkfs.jffs2
70 MTD_TARGETS_
$(BR2_PACKAGE_MTD_MTD_DEBUG
) += mtd_debug
71 MTD_TARGETS_
$(BR2_PACKAGE_MTD_MTDPART
) += mtdpart
72 MTD_TARGETS_
$(BR2_PACKAGE_MTD_NANDDUMP
) += nanddump
73 MTD_TARGETS_
$(BR2_PACKAGE_MTD_NANDTEST
) += nandtest
74 MTD_TARGETS_
$(BR2_PACKAGE_MTD_NANDWRITE
) += nandwrite
75 MTD_TARGETS_
$(BR2_PACKAGE_MTD_NFTLDUMP
) += nftldump
76 MTD_TARGETS_
$(BR2_PACKAGE_MTD_NFTL_FORMAT
) += nftl_format
77 MTD_TARGETS_
$(BR2_PACKAGE_MTD_RECV_IMAGE
) += recv_image
78 MTD_TARGETS_
$(BR2_PACKAGE_MTD_RFDDUMP
) += rfddump
79 MTD_TARGETS_
$(BR2_PACKAGE_MTD_RFDFORMAT
) += rfdformat
80 MTD_TARGETS_
$(BR2_PACKAGE_MTD_SERVE_IMAGE
) += serve_image
81 MTD_TARGETS_
$(BR2_PACKAGE_MTD_SUMTOOL
) += sumtool
83 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_MTDINFO
) += mtdinfo
84 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBIATTACH
) += ubiattach
85 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBICRC32
) += ubicrc32
86 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBIDETACH
) += ubidetach
87 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBIFORMAT
) += ubiformat
88 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBIMKVOL
) += ubimkvol
89 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBINFO
) += ubinfo
90 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBINIZE
) += ubinize
91 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBIRENAME
) += ubirename
92 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBIRMVOL
) += ubirmvol
93 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBIRSVOL
) += ubirsvol
94 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBIUPDATEVOL
) += ubiupdatevol
95 MTD_TARGETS_UBI_
$(BR2_PACKAGE_MTD_UBIBLOCK
) += ubiblock
97 MTD_TARGETS_y
+= $(addprefix ubi-utils
/,$(MTD_TARGETS_UBI_y
))
98 MTD_TARGETS_
$(BR2_PACKAGE_MTD_MKFSUBIFS
) += mkfs.ubifs
/mkfs.ubifs
100 ifeq ($(BR2_PACKAGE_MTD_INTEGCK
),y
)
101 define MTD_BUILD_INTEGCK
102 $(TARGET_CONFIGURE_OPTS
) $(MAKE1
) CROSS
=$(TARGET_CROSS
) \
103 BUILDDIR
=$(@D
) $(MTD_MAKE_OPTS
) -C
$(@D
)/tests
/fs-tests
all
105 define MTD_INSTALL_INTEGCK
106 $(INSTALL
) -D
-m
755 $(@D
)/tests
/fs-tests
/integrity
/integck
$(TARGET_DIR
)/usr
/sbin
/integck
110 define MTD_BUILD_CMDS
111 $(TARGET_CONFIGURE_OPTS
) $(MAKE1
) CROSS
=$(TARGET_CROSS
) \
112 BUILDDIR
=$(@D
) $(MTD_MAKE_OPTS
) -C
$(@D
) \
113 $(addprefix $(@D
)/,$(MTD_TARGETS_y
)) \
114 $(addprefix $(@D
)/,$(MTD_STAGING_y
))
118 define MTD_INSTALL_STAGING_CMDS
119 $(INSTALL
) -D
-m
0755 $(@D
)/lib
/libmtd.a
$(STAGING_DIR
)/usr
/lib
/libmtd.a
120 $(INSTALL
) -D
-m
0755 $(@D
)/ubi-utils
/libubi.a
$(STAGING_DIR
)/usr
/lib
/libubi.a
121 $(INSTALL
) -D
-m
0644 $(@D
)/include/libmtd.h
$(STAGING_DIR
)/usr
/include/mtd
/libmtd.h
122 $(INSTALL
) -D
-m
0644 $(@D
)/ubi-utils
/include/libubi.h
$(STAGING_DIR
)/usr
/include/mtd
/libubi.h
123 $(INSTALL
) -D
-m
0644 $(@D
)/include/mtd
/ubi-media.h
$(STAGING_DIR
)/usr
/include/mtd
/ubi-media.h
126 define MTD_INSTALL_TARGET_CMDS
127 for f in
$(MTD_TARGETS_y
) ; do \
128 $(INSTALL
) -D
-m
0755 $(@D
)/$$f $(TARGET_DIR
)/usr
/sbin
/$${f
##*/} ; \
130 $(MTD_INSTALL_INTEGCK
)
133 $(eval
$(generic-package
))
134 $(eval
$(host-generic-package
))