_system_patch.rb 463 B

12345678910111213141516171819202122
  1. #
  2. # Cookbook:: gateway
  3. # Recipe:: _system_patch
  4. #
  5. # Copyright:: 2022, The Authors, All Rights Reserved.
  6. #
  7. patch_files = %w{
  8. 0001-Fix-dkms-doesn-t-remove-modules.patch
  9. }
  10. patch_files.each do |patch_file|
  11. cache_path = ::File.join(::Chef::Config[:file_cache_path], patch_file)
  12. cookbook_file cache_path do
  13. source patch_file
  14. end
  15. execute "/usr/bin/git am #{cache_path}" do
  16. only_if "/usr/bin/git apply #{cache_path} --check"
  17. cwd '/etc'
  18. end
  19. end