summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Boehm <hollow@gentoo.org>2009-04-18 15:56:45 +0000
committerBenedikt Boehm <hollow@gentoo.org>2009-04-18 15:56:45 +0000
commit986293439fafc244f3730681fe5b5c9f33d72edd (patch)
tree0ebb1d73b704cf9660531c6468480b2d7bc22399 /dev-ruby/facter/files
parentstable amd64, bug 266562 (diff)
downloadhistorical-986293439fafc244f3730681fe5b5c9f33d72edd.tar.gz
historical-986293439fafc244f3730681fe5b5c9f33d72edd.tar.bz2
historical-986293439fafc244f3730681fe5b5c9f33d72edd.zip
fix virtual detection for openvz and vserver
Package-Manager: portage-2.2_rc28/cvs/Linux i686
Diffstat (limited to 'dev-ruby/facter/files')
-rw-r--r--dev-ruby/facter/files/facter-1.5.2-virtual.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/dev-ruby/facter/files/facter-1.5.2-virtual.patch b/dev-ruby/facter/files/facter-1.5.2-virtual.patch
new file mode 100644
index 000000000000..91cb039620fa
--- /dev/null
+++ b/dev-ruby/facter/files/facter-1.5.2-virtual.patch
@@ -0,0 +1,31 @@
+Index: facter-1.5.2/lib/facter/virtual.rb
+===================================================================
+--- facter-1.5.2.orig/lib/facter/virtual.rb
++++ facter-1.5.2/lib/facter/virtual.rb
+@@ -7,7 +7,7 @@ Facter.add("virtual") do
+
+ setcode do
+
+- if FileTest.exists?("/proc/user_beancounters")
++ if FileTest.exists?("/proc/vz/veinfo") && !FileTest.exists?("/proc/vz/version")
+ result = "openvz"
+ end
+
+@@ -45,12 +45,11 @@ Facter.add("virtual") do
+ result = "vmware_server"
+ end
+
+- mountexists = system "which mount > /dev/null 2>&1"
+- if $?.exitstatus == 0
+- output = %x{mount}
+- output.each {|p|
+- result = "vserver" if p =~ /\/dev\/hdv1/
+- }
++ if FileTest.exists?("/proc/self/status")
++ txt = File.read("/proc/self/status")
++ if txt =~ /^(s_context|VxID):[[:blank:]]*[1-9]/
++ result = "vserver"
++ end
+ end
+
+ if FileTest.directory?('/proc/virtual')