init.sls 769 B

123456789101112131415161718192021222324252627282930
  1. #
  2. # APU2 - Firmware-Update
  3. #
  4. apu2-flashrom:
  5. pkg.latest:
  6. - name: flashrom
  7. {% if salt['pkg.version_cmp'](salt['pkg.version']('flashrom'), '0.9.9') >= 0 %}
  8. apu2-read-firmware:
  9. cmd.run:
  10. - name: flashrom --programmer internal --read /tmp/apu2-firmware.rom
  11. - creates: /tmp/apu2-firmware.rom
  12. - require:
  13. - pkg: apu2-flashrom
  14. apu2-copy-firmware:
  15. file.managed:
  16. - name: /tmp/apu2-firmware.rom
  17. - source: salt://apu2/apu2-firmware.rom
  18. - require:
  19. - cmd: apu2-read-firmware
  20. apu2-write-firmware:
  21. cmd.wait:
  22. - name: flashrom --programmer internal --write /tmp/apu2-firmware.rom
  23. # - name: flashrom --programmer internal:boardmismatch=force --write /tmp/apu2-firmware.rom
  24. - watch:
  25. - file: apu2-copy-firmware
  26. {% endif %}