You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.8 KiB

  1. #
  2. # Copyright (C) 2010-2017 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:=flashrom
  9. PKG_VERSION:=1.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=http://download.flashrom.org/releases
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_HASH:=3702fa215ba5fb5af8e54c852d239899cfa1389194c1e51cb2a170c4dc9dee64
  15. PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=COPYING
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include flashrom.mk
  22. TARGET_CFLAGS+= \
  23. -std=gnu89
  24. MAKE_FLAGS+= \
  25. PREFIX="/usr"
  26. define Package/flashrom/default
  27. SECTION:=utils
  28. CATEGORY:=Utilities
  29. TITLE:=FlashROM Utility
  30. URL:=http://www.flashrom.org/
  31. endef
  32. define Package/flashrom
  33. $(Package/flashrom/default)
  34. TITLE+= (full)
  35. DEPENDS+= \
  36. +(TARGET_x86||TARGET_x86_64):dmidecode \
  37. +libftdi1 \
  38. +libusb-1.0 \
  39. +libusb-compat \
  40. +pciutils
  41. VARIANT:=full
  42. DEFAULT_VARIANT:=1
  43. endef
  44. define Package/flashrom-pci
  45. $(Package/flashrom/default)
  46. TITLE+= (pci)
  47. DEPENDS+= \
  48. +(TARGET_x86||TARGET_x86_64):dmidecode \
  49. +pciutils
  50. VARIANT:=pci
  51. endef
  52. define Package/flashrom-spi
  53. $(Package/flashrom/default)
  54. TITLE+= (spi)
  55. VARIANT:=spi
  56. endef
  57. define Package/flashrom-usb
  58. $(Package/flashrom/default)
  59. TITLE+= (usb)
  60. DEPENDS+= \
  61. +libftdi1 \
  62. +libusb-1.0 \
  63. +libusb-compat
  64. VARIANT:=usb
  65. endef
  66. define Package/flashrom/default/description
  67. flashrom is an utility for identifying, reading, writing, verifying
  68. and erasing flash chips. It's often used to flash BIOS/EFI/coreboot
  69. /firmware images.
  70. endef
  71. Package/flashrom/description = $(Package/flashrom/default/description)
  72. Package/flashrom-pci/description = $(Package/flashrom/default/description)
  73. Package/flashrom-spi/description = $(Package/flashrom/default/description)
  74. Package/flashrom-usb/description = $(Package/flashrom/default/description)
  75. define Package/flashrom/install
  76. $(INSTALL_DIR) $(1)/usr/sbin
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom
  78. endef
  79. define Package/flashrom-pci/install
  80. $(INSTALL_DIR) $(1)/usr/sbin
  81. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-pci
  82. endef
  83. define Package/flashrom-spi/install
  84. $(INSTALL_DIR) $(1)/usr/sbin
  85. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-spi
  86. endef
  87. define Package/flashrom-usb/install
  88. $(INSTALL_DIR) $(1)/usr/sbin
  89. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-usb
  90. endef
  91. $(eval $(call BuildPackage,flashrom))
  92. $(eval $(call BuildPackage,flashrom-pci))
  93. $(eval $(call BuildPackage,flashrom-spi))
  94. $(eval $(call BuildPackage,flashrom-usb))