ubi-utils/Makefile |
| 1 | # |
| 2 | # Copyright (C) 2009 Qi Hardware Inc. |
| 3 | # Author: Xiangfu Liu <xiangfu@qi-hardware.com> |
| 4 | # |
| 5 | # This is free software, licensed under the GNU General Public License v3. |
| 6 | # See /LICENSE for more information. |
| 7 | # |
| 8 | |
| 9 | include $(TOPDIR)/rules.mk |
| 10 | |
| 11 | PKG_NAME:=ubi-utils |
| 12 | PKG_VERSION:=1.2.0 |
| 13 | PKG_REV:=600337e7c81e812d34460b413c5b044f454bc49d |
| 14 | PKG_RELEASE:=1 |
| 15 | |
| 16 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) |
| 17 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 |
| 18 | PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git |
| 19 | PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) |
| 20 | PKG_SOURCE_VERSION:=$(PKG_REV) |
| 21 | |
| 22 | include $(INCLUDE_DIR)/package.mk |
| 23 | |
| 24 | define Package/ubi-utils |
| 25 | TITLE:=ubi-utils |
| 26 | SECTION:=utils |
| 27 | CATEGORY:=Utilities |
| 28 | URL:=http://www.linux-mtd.infradead.org/doc/ubi.html |
| 29 | endef |
| 30 | |
| 31 | define Package/ubi-utils/description |
| 32 | UBI (Latin: "where?") stands for "Unsorted Block Images". It is a volume management system for raw flash devices which manages multiple logical volumes on a single physical flash device and spreads the I/O load (i.e, wear-leveling) across whole flash chip. |
| 33 | endef |
| 34 | |
| 35 | define Build/Compile |
| 36 | (cd $(PKG_BUILD_DIR)/$(PKG_NAME); \ |
| 37 | $(MAKE) CC="$(TARGET_CROSS)gcc" \ |
| 38 | ARCH="$(ARCH)"; \ |
| 39 | $(MAKE) CC="$(TARGET_CROSS)gcc" \ |
| 40 | ARCH="$(ARCH)" \ |
| 41 | DESTDIR="$(PKG_INSTALL_DIR)" \ |
| 42 | SBINDIR="/usr/bin/" \ |
| 43 | install \ |
| 44 | ) |
| 45 | endef |
| 46 | |
| 47 | define Package/ubi-utils/install |
| 48 | $(INSTALL_DIR) $(1)/usr/bin |
| 49 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mtdinfo $(1)/usr/bin/ |
| 50 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubinfo $(1)/usr/bin/ |
| 51 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubimkvol $(1)/usr/bin/ |
| 52 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubirmvol $(1)/usr/bin/ |
| 53 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubinize $(1)/usr/bin/ |
| 54 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubidetach $(1)/usr/bin/ |
| 55 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubicrc32 $(1)/usr/bin/ |
| 56 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubiformat $(1)/usr/bin/ |
| 57 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubiupdatevol $(1)/usr/bin/ |
| 58 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubirsvol $(1)/usr/bin/ |
| 59 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubiattach $(1)/usr/bin/ |
| 60 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ubirename $(1)/usr/bin/ |
| 61 | endef |
| 62 | |
| 63 | $(eval $(call BuildPackage,ubi-utils)) |