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:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=https://download.flashrom.org/releases
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_HASH:=3702fa215ba5fb5af8e54c852d239899cfa1389194c1e51cb2a170c4dc9dee64
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
  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. +libusb-compat \
  41. +pciutils
  42. VARIANT:=full
  43. DEFAULT_VARIANT:=1
  44. endef
  45. define Package/flashrom-pci
  46. $(Package/flashrom/default)
  47. TITLE+= (pci)
  48. DEPENDS+= \
  49. +(TARGET_x86||TARGET_x86_64):dmidecode \
  50. +pciutils
  51. VARIANT:=pci
  52. endef
  53. define Package/flashrom-spi
  54. $(Package/flashrom/default)
  55. TITLE+= (spi)
  56. VARIANT:=spi
  57. endef
  58. define Package/flashrom-usb
  59. $(Package/flashrom/default)
  60. TITLE+= (usb)
  61. DEPENDS+= \
  62. +libftdi1 \
  63. +libusb-1.0 \
  64. +libusb-compat
  65. VARIANT:=usb
  66. endef
  67. define Package/flashrom/default/description
  68. flashrom is an utility for identifying, reading, writing, verifying
  69. and erasing flash chips. It's often used to flash BIOS/EFI/coreboot
  70. /firmware images.
  71. endef
  72. Package/flashrom/description = $(Package/flashrom/default/description)
  73. Package/flashrom-pci/description = $(Package/flashrom/default/description)
  74. Package/flashrom-spi/description = $(Package/flashrom/default/description)
  75. Package/flashrom-usb/description = $(Package/flashrom/default/description)
  76. define Package/flashrom/install
  77. $(INSTALL_DIR) $(1)/usr/sbin
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom
  79. endef
  80. define Package/flashrom-pci/install
  81. $(INSTALL_DIR) $(1)/usr/sbin
  82. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-pci
  83. endef
  84. define Package/flashrom-spi/install
  85. $(INSTALL_DIR) $(1)/usr/sbin
  86. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-spi
  87. endef
  88. define Package/flashrom-usb/install
  89. $(INSTALL_DIR) $(1)/usr/sbin
  90. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-usb
  91. endef
  92. $(eval $(call BuildPackage,flashrom))
  93. $(eval $(call BuildPackage,flashrom-pci))
  94. $(eval $(call BuildPackage,flashrom-spi))
  95. $(eval $(call BuildPackage,flashrom-usb))