2 # Cookbook Name:: hardware
5 # Copyright 2012, OpenStreetMap Foundation
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
20 case node[:cpu][:"0"][:vendor_id]
22 package "intel-microcode"
25 if node[:dmi] and node[:dmi][:system]
26 case node[:dmi][:system][:manufacturer]
28 manufacturer = node[:dmi][:base_board][:manufacturer]
29 product = node[:dmi][:base_board][:product_name]
31 manufacturer = node[:dmi][:system][:manufacturer]
32 product = node[:dmi][:system][:product_name]
35 manufacturer = "Unknown"
49 when "TYAN Computer Corporation"
54 when "H8DGU", "X9SCD", "X7DBU", "X7DW3", "X9DR7/E-(J)LN4F", "X9DR3-F"
66 if manufacturer == "HP" and node[:lsb][:release].to_f > 11.10
69 git "/opt/hp/hp-legacy" do
71 repository "git://chef.openstreetmap.org/hp-legacy.git"
76 link "/opt/hp/hp-health/bin/hpasmd" do
77 to "/opt/hp/hp-legacy/hpasmd"
80 link "/usr/lib/libhpasmintrfc.so.3.0" do
81 to "/opt/hp/hp-legacy/libhpasmintrfc.so.3.0"
84 link "/usr/lib/libhpasmintrfc.so.3" do
85 to "libhpasmintrfc.so.3.0"
88 link "/usr/lib/libhpasmintrfc.so" do
89 to "libhpasmintrfc.so.3.0"
94 file "/etc/init/ttySttyS#{unit}.conf" do
98 template "/etc/init/ttyS#{unit}.conf" do
103 variables :unit => unit, :speed => speed
106 service "ttyS#{unit}" do
107 provider Chef::Provider::Service::Upstart
108 action [ :enable, :start ]
109 supports :status => true, :restart => true, :reload => false
110 subscribes :restart, resources(:template => "/etc/init/ttyS#{unit}.conf")
114 if File.exist?("/etc/default/grub")
115 execute "update-grub" do
117 command "/usr/sbin/update-grub"
120 template "/etc/default/grub" do
125 variables :unit => unit, :speed => speed
126 notifies :run, resources(:execute => "update-grub")
130 execute "update-initramfs" do
132 command "update-initramfs -u -k all"
137 template "/etc/initramfs-tools/conf.d/mdadm" do
138 source "initramfs-mdadm.erb"
142 notifies :run, "execute[update-initramfs]"
145 if node[:kernel][:modules].include?("mpt2sas")
147 package "sas2ircu-status"