Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #
  2. # Copyright (C) 2006-2012 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=uboot-envtools
  9. PKG_DISTNAME:=u-boot
  10. PKG_VERSION:=2012.04.01
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
  14. PKG_MD5SUM:=192bb231082d9159fb6e16de3039b6b2
  15. PKG_BUILD_DEPENDS:=zlib
  16. include $(INCLUDE_DIR)/package.mk
  17. TAR_OPTIONS+= --strip-components=3 -C $(PKG_BUILD_DIR) $(PKG_DISTNAME)-$(PKG_VERSION)/tools/env
  18. define Package/uboot-envtools
  19. SECTION:=utils
  20. CATEGORY:=Utilities
  21. TITLE:=read/modify U-Boot bootloader environment
  22. URL:=http://www.denx.de/wiki/U-Boot
  23. MENU:=1
  24. endef
  25. define Package/uboot-envtools/config
  26. menu "Configuration"
  27. depends on PACKAGE_uboot-envtools
  28. config PACKAGE_uboot-envtools_setenv_symlink
  29. bool "Create fw_setenv symlink"
  30. default n
  31. help
  32. With this option selected you will be able to edit U-Boot bootloader environment.
  33. endmenu
  34. endef
  35. define Package/uboot-envtools/description
  36. This package includes tools to read and modify U-Boot bootloader environment.
  37. endef
  38. define Build/Prepare
  39. mkdir -p $(PKG_BUILD_DIR)
  40. tar xvjf $(DL_DIR)/$(PKG_SOURCE) --strip-components=2 -C $(PKG_BUILD_DIR) $(PKG_DISTNAME)-$(PKG_VERSION)/lib/crc32.c
  41. $(call Build/Prepare/Default)
  42. endef
  43. define Package/uboot-envtools/conffiles
  44. /etc/config/ubootenv
  45. /etc/fw_env.config
  46. endef
  47. define Package/uboot-envtools/install
  48. $(INSTALL_DIR) $(1)/usr/sbin
  49. $(INSTALL_BIN) $(PKG_BUILD_DIR)/fw_printenv $(1)/usr/sbin
  50. ifneq ($(CONFIG_PACKAGE_uboot-envtools_setenv_symlink),)
  51. ln -s fw_printenv $(1)/usr/sbin/fw_setenv
  52. endif
  53. $(INSTALL_DIR) $(1)/lib
  54. $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
  55. ifneq ($(CONFIG_TARGET_ar71xx),)
  56. $(INSTALL_DIR) $(1)/etc/uci-defaults
  57. $(INSTALL_BIN) ./files/ar71xx $(1)/etc/uci-defaults/uboot-envtools
  58. endif
  59. ifneq ($(CONFIG_TARGET_lantiq),)
  60. $(INSTALL_DIR) $(1)/etc/uci-defaults
  61. $(INSTALL_BIN) ./files/lantiq $(1)/etc/uci-defaults/uboot-envtools
  62. endif
  63. endef
  64. $(eval $(call BuildPackage,uboot-envtools))