From 87b7374b4c79c98d982b025bf31256f6c0d31db9c3b32b50d190dee0b1356d67 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 17 Jun 2011 06:10:53 +0000 Subject: [PATCH] - update postin to work in / again when running insserv macro OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=7 --- hyper-v.changes | 5 +++++ hyper-v.spec | 30 +++++++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/hyper-v.changes b/hyper-v.changes index 63059df..b78671d 100644 --- a/hyper-v.changes +++ b/hyper-v.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 17 08:10:12 CEST 2011 - ohering@suse.de + +- update postin to work in / again when running insserv macro + ------------------------------------------------------------------- Thu Jun 16 15:33:49 CEST 2011 - ohering@suse.de diff --git a/hyper-v.spec b/hyper-v.spec index b8c51cf..2005179 100644 --- a/hyper-v.spec +++ b/hyper-v.spec @@ -122,31 +122,27 @@ 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 +board_vendor= +product_name= +if pushd /sys/class/dmi/id > /dev/null 2>/dev/null then - pushd /sys/class/dmi/id > /dev/null - board_vendor= if test -r board_vendor then board_vendor="`cat board_vendor`" fi - if test "${board_vendor}" = "Microsoft Corporation" + if test -r product_name 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}'" - popd > /dev/null - %{fillup_and_insserv -Y hv_kvp_daemon} - exit 0 - fi + product_name="`cat product_name`" fi + popd > /dev/null +fi +if test "${board_vendor}" = "Microsoft Corporation" -a test "${product_name}" = "Virtual Machine" +then + echo "Enabling hv_kvp_daemon on '${product_name}' from '${board_vendor}'" + %{fillup_and_insserv -Y hv_kvp_daemon} +else + %{fillup_and_insserv hv_kvp_daemon} fi -%{fillup_and_insserv hv_kvp_daemon} %preun %stop_on_removal