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.

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