2 # Copyright (C) 2006-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
10 PKG_NAME:=uboot-envtools
15 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
17 http://mirror2.openwrt.org/sources \
18 ftp://ftp.denx.de/pub/u-boot
20 PKG_MD5SUM:=36d4bad687edcafa396fee607e505d4e
22 PKG_BUILD_DIR:=$(BUILD_DIR)/u-boot-$(PKG_VERSION)
24 PKG_BUILD_DEPENDS:=+fstools
26 include $(INCLUDE_DIR)/package.mk
28 define Package/uboot-envtools
31 TITLE:=read/modify U-Boot bootloader environment
32 URL:=http://www.denx.de/wiki/U-Boot
35 define Package/uboot-envtools/description
36 This package includes tools to read and modify U-Boot bootloader environment.
39 define Package/uboot-envtools/config
40 source "$(SOURCE)/Config.in"
43 define Build/Configure
44 touch $(PKG_BUILD_DIR)/include/config.mk
45 touch $(PKG_BUILD_DIR)/include/config.h
48 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
51 $(MAKE) -C $(PKG_BUILD_DIR) \
52 CROSS_COMPILE="$(TARGET_CROSS)" \
53 TARGET_CFLAGS="$(TARGET_CFLAGS)" \
54 UBI="$(CONFIG_UBOOT_ENVTOOLS_UBI)" \
58 define Package/uboot-envtools/conffiles
63 define Package/uboot-envtools/install
64 $(INSTALL_DIR) $(1)/usr/sbin
65 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
66 ln -s fw_printenv $(1)/usr/sbin/fw_setenv
67 $(INSTALL_DIR) $(1)/lib
68 $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
69 ifneq ($(CONFIG_TARGET_ar71xx),)
70 $(INSTALL_DIR) $(1)/etc/uci-defaults
71 $(INSTALL_DATA) ./files/ar71xx $(1)/etc/uci-defaults/30_uboot-envtools
73 ifneq ($(CONFIG_TARGET_cns3xxx),)
74 $(INSTALL_DIR) $(1)/etc/uci-defaults
75 $(INSTALL_DATA) ./files/cns3xxx $(1)/etc/uci-defaults/30_uboot-envtools
77 ifneq ($(CONFIG_TARGET_imx6),)
78 $(INSTALL_DIR) $(1)/etc/uci-defaults
79 $(INSTALL_DATA) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
81 ifneq ($(CONFIG_TARGET_kirkwood),)
82 $(INSTALL_DIR) $(1)/etc/uci-defaults
83 $(INSTALL_DATA) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
85 ifneq ($(CONFIG_TARGET_lantiq),)
86 $(INSTALL_DIR) $(1)/etc/uci-defaults
87 $(INSTALL_DATA) ./files/lantiq $(1)/etc/uci-defaults/30_uboot-envtools
89 ifneq ($(CONFIG_TARGET_mvebu),)
90 $(INSTALL_DIR) $(1)/etc/uci-defaults
91 $(INSTALL_BIN) ./files/mvebu $(1)/etc/uci-defaults/30_uboot-envtools
93 ifneq ($(CONFIG_TARGET_mxs),)
94 $(INSTALL_DIR) $(1)/etc/uci-defaults
95 $(INSTALL_BIN) ./files/mxs $(1)/etc/uci-defaults/30_uboot-envtools
97 ifneq ($(CONFIG_TARGET_ramips),)
98 $(INSTALL_DIR) $(1)/etc/uci-defaults
99 $(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools
103 $(eval $(call BuildPackage,uboot-envtools))