platform.lua 488 B

12345678910111213141516171819202122232425262728293031
  1. local platform_info = require 'platform_info'
  2. local util = require 'luci.util'
  3. local setmetatable = setmetatable
  4. module 'gluon.platform'
  5. setmetatable(_M,
  6. {
  7. __index = platform_info,
  8. }
  9. )
  10. function match(target, subtarget, boards)
  11. if get_target() ~= target then
  12. return false
  13. end
  14. if get_subtarget() ~= subtarget then
  15. return false
  16. end
  17. if boards and not util.contains(boards, get_board_name()) then
  18. return false
  19. end
  20. return true
  21. end