From fc0fbf96a901e192ccbc20fbe6016f1ed30f132904f4f9778fcb0638328c6035 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 16 Jun 2011 09:14:38 +0000 Subject: [PATCH] - enable hv_kvp_daemon if run in a hv guest [fate#312213] OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=3 --- hyper-v.changes | 5 +++++ hyper-v.spec | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/hyper-v.changes b/hyper-v.changes index 3f35061..5e76759 100644 --- a/hyper-v.changes +++ b/hyper-v.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jun 16 11:12:06 CEST 2011 - ohering@suse.de + +- enable hv_kvp_daemon if run in a hv guest [fate#312213] + ------------------------------------------------------------------- Thu Apr 21 17:18:20 CEST 2011 - ohering@suse.de diff --git a/hyper-v.spec b/hyper-v.spec index ee0a39a..c0f901c 100644 --- a/hyper-v.spec +++ b/hyper-v.spec @@ -35,7 +35,7 @@ Group: System/Kernel AutoReqProv: on Summary: Microsoft Hyper-V drivers Url: http://www.kernel.org -Version: 0 +Version: 1 Release: %(bash %_sourcedir/get_release_number.sh) Source: Module.supported Source1: hyperv_pvdrivers.conf @@ -122,6 +122,29 @@ install -m644 %SOURCE1 $RPM_BUILD_ROOT/etc/modprobe.d/hyperv_pvdrivers.conf /usr/sbin/hv_kvp_daemon %post +if test -d /sys/class/dmi/id +then + cd /sys/class/dmi/id + board_vendor= + if test -r board_vendor + then + board_vendor="`cat board_vendor`" + fi + if test "${board_vendor}" = "Microsoft Corporation" + then + product_name= + if test -r product_name + then + product_name="`cat product_name`" + fi + if test "${product_name}" = "Virtual Machine" + then + echo "Enabling hv_kvp_daemon on '${product_name}' from '${board_vendor}'" + %{fillup_and_insserv -Y hv_kvp_daemon} + exit 0 + fi + fi +fi %{fillup_and_insserv hv_kvp_daemon} %preun