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.

103 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. PKG_BUILD_DEPENDS:=meson/host
  20. include $(INCLUDE_DIR)/package.mk
  21. include ../../devel/meson/meson.mk
  22. include flashrom.mk
  23. define Package/flashrom/default
  24. SECTION:=utils
  25. CATEGORY:=Utilities
  26. TITLE:=FlashROM Utility
  27. URL:=https://www.flashrom.org/
  28. endef
  29. define Package/flashrom
  30. $(Package/flashrom/default)
  31. TITLE+= (full)
  32. DEPENDS+= \
  33. +(TARGET_x86||TARGET_x86_64):dmidecode \
  34. +libftdi1 \
  35. +libusb-1.0 \
  36. +pciutils
  37. VARIANT:=full
  38. DEFAULT_VARIANT:=1
  39. endef
  40. define Package/flashrom-pci
  41. $(Package/flashrom/default)
  42. TITLE+= (pci)
  43. DEPENDS+= \
  44. +(TARGET_x86||TARGET_x86_64):dmidecode \
  45. +pciutils
  46. VARIANT:=pci
  47. endef
  48. define Package/flashrom-spi
  49. $(Package/flashrom/default)
  50. TITLE+= (spi)
  51. VARIANT:=spi
  52. endef
  53. define Package/flashrom-usb
  54. $(Package/flashrom/default)
  55. TITLE+= (usb)
  56. DEPENDS+= \
  57. +libftdi1 \
  58. +libusb-1.0
  59. VARIANT:=usb
  60. endef
  61. define Package/flashrom/default/description
  62. flashrom is an utility for identifying, reading, writing, verifying
  63. and erasing flash chips. It's often used to flash BIOS/EFI/coreboot
  64. /firmware images.
  65. endef
  66. Package/flashrom/description = $(Package/flashrom/default/description)
  67. Package/flashrom-pci/description = $(Package/flashrom/default/description)
  68. Package/flashrom-spi/description = $(Package/flashrom/default/description)
  69. Package/flashrom-usb/description = $(Package/flashrom/default/description)
  70. define Package/flashrom/install
  71. $(INSTALL_DIR) $(1)/usr/sbin
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom
  73. endef
  74. define Package/flashrom-pci/install
  75. $(INSTALL_DIR) $(1)/usr/sbin
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-pci
  77. endef
  78. define Package/flashrom-spi/install
  79. $(INSTALL_DIR) $(1)/usr/sbin
  80. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-spi
  81. endef
  82. define Package/flashrom-usb/install
  83. $(INSTALL_DIR) $(1)/usr/sbin
  84. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-usb
  85. endef
  86. $(eval $(call BuildPackage,flashrom))
  87. $(eval $(call BuildPackage,flashrom-pci))
  88. $(eval $(call BuildPackage,flashrom-spi))
  89. $(eval $(call BuildPackage,flashrom-usb))