]> git.pld-linux.org Git - packages/ruby-ohai.git/commitdiff
reorder vserver virtualization, so that vbox takes preference auto/th/ruby-ohai-6.16.0-2
authorElan Ruusamäe <glen@delfi.ee>
Sat, 25 May 2013 22:17:03 +0000 (01:17 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 25 May 2013 22:17:03 +0000 (01:17 +0300)
in pld, all kernels have vserver host support, and such kernel in vbox
should have vbox guest as virtualization, not "vserver host"

ruby-ohai.spec
virtualization-vserver.patch [new file with mode: 0644]

index d882d4dbc4d5288da020434b4fc4f55e22ccf223..ee86c1f9d1914f66d39cd89016349283ff970bc5 100644 (file)
@@ -6,11 +6,12 @@
 Summary:       Profiles your system and emits JSON
 Name:          ruby-%{gemname}
 Version:       6.16.0
-Release:       1
+Release:       2
 License:       Apache v2.0
 Group:         Development/Languages
 Source0:       https://github.com/opscode/ohai/archive/%{version}.tar.gz
 # Source0-md5: 5c00b0ba4c313bedfec62cd5e1525551
+Patch0:                virtualization-vserver.patch
 URL:           http://docs.opscode.com/ohai.html
 BuildRequires: rpm-rubyprov
 BuildRequires: rpmbuild(macros) >= 1.656
@@ -50,6 +51,7 @@ This package contains documentation for %{name}.
 
 %prep
 %setup -q -n ohai-%{version}
+%patch0 -p1
 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 
 # no plist and not darwin so don't care
diff --git a/virtualization-vserver.patch b/virtualization-vserver.patch
new file mode 100644 (file)
index 0000000..54b9080
--- /dev/null
@@ -0,0 +1,41 @@
+--- ohai-6.16.0/lib/ohai/plugins/linux/virtualization.rb~      2013-01-17 21:03:16.000000000 +0200
++++ ohai-6.16.0/lib/ohai/plugins/linux/virtualization.rb       2013-05-25 20:52:31.871480338 +0300
+@@ -23,6 +23,20 @@
+ # if it is possible to detect paravirt vs hardware virt, it should be put in
+ # virtualization[:mechanism]
++# Detect Linux-VServer
++if File.exists?("/proc/self/status")
++  proc_self_status = File.read("/proc/self/status")
++  vxid = proc_self_status.match(/^(s_context|VxID): (\d+)$/)
++  if vxid and vxid[2]
++    virtualization[:system] = "linux-vserver"
++    if vxid[2] == "0"
++      virtualization[:role] = "host"
++    else
++      virtualization[:role] = "guest"
++     end
++  end
++end
++
+ ## Xen
+ # /proc/xen is an empty dir for EL6 + Linode Guests
+ if File.exists?("/proc/xen")
+@@ -109,17 +123,3 @@
+   end
+ end
+-
+-# Detect Linux-VServer
+-if File.exists?("/proc/self/status")
+-  proc_self_status = File.read("/proc/self/status")
+-  vxid = proc_self_status.match(/^(s_context|VxID): (\d+)$/)
+-  if vxid and vxid[2]
+-    virtualization[:system] = "linux-vserver"
+-    if vxid[2] == "0"
+-      virtualization[:role] = "host"
+-    else
+-      virtualization[:role] = "guest"
+-     end
+-  end
+-end
This page took 0.113963 seconds and 4 git commands to generate.