From fff4a150af9302c7008fe7f51d2475fd2b2c4fe6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 1 Sep 2013 00:43:19 +0300 Subject: [PATCH] differenciate between vserver host and guest --- virt-what.spec | 2 ++ vserver-type.patch | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 vserver-type.patch diff --git a/virt-what.spec b/virt-what.spec index 17d2a7a..e846157 100644 --- a/virt-what.spec +++ b/virt-what.spec @@ -11,6 +11,7 @@ Group: Applications/Emulators Source0: http://people.redhat.com/~rjones/virt-what/files/%{name}-%{version}.tar.gz # Source0-md5: 28d3be1d8981e7fd83c012ebf0d95bb1 Patch0: bashisms.patch +Patch1: vserver-type.patch URL: http://people.redhat.com/~rjones/virt-what/ # This is provided by the build root, but we make it explicit # anyway in case this was dropped from the build root in future. @@ -58,6 +59,7 @@ Current types of virtualization detected: %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %configure diff --git a/vserver-type.patch b/vserver-type.patch new file mode 100644 index 0000000..2fe09ca --- /dev/null +++ b/vserver-type.patch @@ -0,0 +1,14 @@ +--- virt-what-1.13/virt-what.in 2013-09-01 00:35:37.865167616 +0300 ++++ virt-what-1.13/virt-what.in 2013-09-01 00:40:26.000000000 +0300 +@@ -147,6 +147,11 @@ + # Check for Linux-VServer + if cat "${root}/proc/self/status" | grep -q "VxID: [0-9]*"; then + echo linux_vserver ++ if grep -q "VxID: 0$" "${root}/proc/self/status"; then ++ echo linux_vserver_host ++ else ++ echo linux_vserver_guest ++ fi + fi + + # Check for UML. -- 2.44.0