]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/templates/default/ohai.rb.erb
Make users-agreed a template
[chef.git] / cookbooks / hardware / templates / default / ohai.rb.erb
index 1ca3de03aa5d789c82b7c8f60fdddc2b1ed5e62b..fec5d6bf319ca9fe39277c55954286cf755ca8ec 100644 (file)
@@ -190,7 +190,7 @@ Ohai.plugin(:Hardware) do
     Dir.glob("/sys/class/scsi_host/host*") do |host|
       driver = read_sysctl_file("#{host}/proc_name")
 
-      if driver == "ahci" || driver == "mptsas"
+      if %w(ahci mptsas sata_mv sata_nv).include?(driver)
         bus = host.sub("/sys/class/scsi_host/host", "")
 
         Dir.glob("/sys/bus/scsi/devices/#{bus}:0:*").each do |device|
@@ -358,6 +358,8 @@ Ohai.plugin(:Hardware) do
         controller[:device] = File.basename(device).sub(/^cciss(\d+)$/, "/dev/cciss/c\\1d0")
       elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:3:0/*:3:0:0/scsi_generic/sg*").first
         controller[:device] = "/dev/#{File.basename(device)}"
+      elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:1:0/*:1:0:0/scsi_generic/sg*").first
+        controller[:device] = "/dev/#{File.basename(device)}"
       end
     end
   end