init.sls 674 B

1234567891011121314151617181920212223242526272829
  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. - watch:
  24. - file: apu2-copy-firmware
  25. {% endif %}