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_BUILD_DIR:=$(BUILD_DIR)/u-boot-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
18 http://mirror2.openwrt.org/sources \
19 ftp://ftp.denx.de/pub/u-boot
20 PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955
22 PKG_BUILD_DEPENDS:=+fstools
24 PKG_LICENSE:=GPL-2.0 GPL-2.0+
25 PKG_LICENSE_FILES:=Licenses/README
31 include $(INCLUDE_DIR)/package.mk
33 define Package/uboot-envtools
37 TITLE:=read/modify U-Boot bootloader environment
38 URL:=http://www.denx.de/wiki/U-Boot
41 define Package/uboot-envtools/description
42 This package includes tools to read and modify U-Boot bootloader environment.
45 define Package/uboot-envtools/config
46 source "$(SOURCE)/Config.in"
49 define Build/Configure
50 touch $(PKG_BUILD_DIR)/include/config.mk
51 touch $(PKG_BUILD_DIR)/include/config.h
52 mkdir -p $(PKG_BUILD_DIR)/include/generated
53 touch $(PKG_BUILD_DIR)/include/generated/autoconf.h
56 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
59 $(MAKE) -C $(PKG_BUILD_DIR) \
60 CROSS_COMPILE="$(TARGET_CROSS)" \
61 TARGET_CFLAGS="$(TARGET_CFLAGS)" \
62 UBI="$(CONFIG_UBOOT_ENVTOOLS_UBI)" \
68 define Package/uboot-envtools/conffiles
73 define Package/uboot-envtools/install
74 $(INSTALL_DIR) $(1)/usr/sbin
75 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
76 $(LN) fw_printenv $(1)/usr/sbin/fw_setenv
77 $(INSTALL_DIR) $(1)/lib
78 $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
79 ifneq ($(CONFIG_TARGET_ar71xx),)
80 $(INSTALL_DIR) $(1)/etc/uci-defaults
81 $(INSTALL_DATA) ./files/ar71xx $(1)/etc/uci-defaults/30_uboot-envtools
83 ifneq ($(CONFIG_TARGET_cns3xxx),)
84 $(INSTALL_DIR) $(1)/etc/uci-defaults
85 $(INSTALL_DATA) ./files/cns3xxx $(1)/etc/uci-defaults/30_uboot-envtools
87 ifneq ($(CONFIG_TARGET_imx6),)
88 $(INSTALL_DIR) $(1)/etc/uci-defaults
89 $(INSTALL_DATA) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
91 ifneq ($(CONFIG_TARGET_ipq806x),)
92 $(INSTALL_DIR) $(1)/etc/uci-defaults
93 $(INSTALL_DATA) ./files/ipq $(1)/etc/uci-defaults/30_uboot-envtools
95 ifneq ($(CONFIG_TARGET_kirkwood),)
96 $(INSTALL_DIR) $(1)/etc/uci-defaults
97 $(INSTALL_DATA) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
99 ifneq ($(CONFIG_TARGET_lantiq),)
100 $(INSTALL_DIR) $(1)/etc/uci-defaults
101 $(INSTALL_DATA) ./files/lantiq $(1)/etc/uci-defaults/30_uboot-envtools
103 ifneq ($(CONFIG_TARGET_mvebu),)
104 $(INSTALL_DIR) $(1)/etc/uci-defaults
105 $(INSTALL_BIN) ./files/mvebu $(1)/etc/uci-defaults/30_uboot-envtools
107 ifneq ($(CONFIG_TARGET_mxs),)
108 $(INSTALL_DIR) $(1)/etc/uci-defaults
109 $(INSTALL_BIN) ./files/mxs $(1)/etc/uci-defaults/30_uboot-envtools
111 ifneq ($(CONFIG_TARGET_oxnas),)
112 $(INSTALL_DIR) $(1)/etc/uci-defaults
113 $(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools
115 ifneq ($(CONFIG_TARGET_ramips),)
116 $(INSTALL_DIR) $(1)/etc/uci-defaults
117 $(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools
121 $(eval $(call BuildPackage,uboot-envtools))