blob: 046572e83b415ba8fee597c19881bae8313f3bdc [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
2# Copyright (C) 2009-2014 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=mtd-utils
11PKG_VERSION:=2.2.1
12PKG_RELEASE:=1
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15PKG_SOURCE_URL:=https://infraroot.at/pub/mtd/
16PKG_HASH:=f7ae20b2eb79ee83441468f0b99d897024cd96ff853eea59106fb1952065c803
17
18PKG_INSTALL:=1
19
20PKG_FLAGS:=nonshared
21PKG_BUILD_FLAGS:=gc-sections
22
23PKG_BUILD_DEPENDS:=util-linux
24
25PKG_LICENSE:=GPLv2
26PKG_LICENSE_FILES:=
27PKG_CPE_ID:=cpe:/a:mtd-utils_project:mtd-utils
28
29PKG_MAINTAINER:=John Crispin <john@phrozen.org>
30
31include $(INCLUDE_DIR)/package.mk
32
33define Package/mtd-utils/Default
34 SECTION:=utils
35 CATEGORY:=Utilities
36 URL:=http://www.linux-mtd.infradead.org/
37 DEPENDS:=@NAND_SUPPORT
38endef
39
40define Package/ubi-utils
41 $(call Package/mtd-utils/Default)
42 TITLE:=Utilities for ubi info/debug
43endef
44
45define Package/ubi-utils/description
46 Utilities for manipulating memory technology devices.
47endef
48
49define Package/nand-utils
50 $(call Package/mtd-utils/Default)
51 TITLE:=Utilities for nand flash erase/read/write/test
52endef
53
54define Package/nand-utils/description
55 Utilities for NAND devices.
56endef
57
58MAKE_FLAGS += LDLIBS+="$(LIBGCC_S)"
59
60CONFIGURE_ARGS += \
61 --enable-tests \
62 --without-crypto \
63 --without-xattr \
64 --without-zstd \
65 --without-lzo \
66 --without-zlib
67
68define Package/ubi-utils/install
69 $(INSTALL_DIR) $(1)/usr/sbin
70 $(INSTALL_BIN) \
71 $(PKG_INSTALL_DIR)/usr/sbin/{ubiattach,ubicrc32,ubiblock,ubidetach,ubiformat,ubimkvol} $(1)/usr/sbin/
72 $(INSTALL_BIN) \
73 $(PKG_INSTALL_DIR)/usr/sbin/{ubinfo,ubinize,ubirename,ubirmvol,ubirsvol,ubiupdatevol} $(1)/usr/sbin/
74endef
75
76define Package/nand-utils/install
77 $(INSTALL_DIR) $(1)/usr/sbin
78 $(INSTALL_BIN) \
79 $(PKG_INSTALL_DIR)/usr/sbin/{flash_erase,nanddump,nandwrite,nandtest,mtdinfo} \
80 $(PKG_INSTALL_DIR)/usr/lib/mtd-utils/nandbiterrs $(1)/usr/sbin/
81endef
82
83$(eval $(call BuildPackage,ubi-utils))
84$(eval $(call BuildPackage,nand-utils))