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.

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