Skip to content

Commit

Permalink
hardware: remove haveged as unneeded on kernel 5.15 above
Browse files Browse the repository at this point in the history
  • Loading branch information
Firefishy committed Jun 20, 2023
1 parent 6f43715 commit 02b1060
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions cookbooks/hardware/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
template "ohai.rb.erb"
end

case node[:cpu][:"0"][:vendor_id]
when "GenuineIntel"
package "intel-microcode"
when "AuthenticAMD"
package "amd64-microcode"
if node[:cpu] && node[:cpu][:"0"] && node[:cpu][:"0"][:vendor_id]

This comment has been minimized.

Copy link
@tomhughes

tomhughes Jun 20, 2023

Member

What is this supposed to fix?

This comment has been minimized.

Copy link
@Firefishy

Firefishy Jun 20, 2023

Author Member

This a hack for when ohai doesn't populate node[:cpu][:"0"][:vendor_id], affects me on a Docker on Mac.

case node[:cpu][:"0"][:vendor_id]
when "GenuineIntel"
package "intel-microcode"
when "AuthenticAMD"
package "amd64-microcode"
end
end

if node[:dmi] && node[:dmi][:system]
Expand Down Expand Up @@ -204,9 +206,20 @@
notifies :run, "execute[update-initramfs]"
end

package "haveged"
service "haveged" do
action [:enable, :start]
# haveged is only required on older kernels
# /dev/random is not blocking anymore in 5.15+
if Chef::Util.compare_versions(node[:kernel][:release], [5, 15]).negative?
package "haveged"
service "haveged" do
action [:enable, :start]
end
else
service "haveged" do
action [:stop, :disable]
end
package "haveged" do
action :remove
end
end

if node[:kernel][:modules].include?("ipmi_si")
Expand Down

0 comments on commit 02b1060

Please sign in to comment.