From 516b4172056e6304f8ea52ba6887546817f565634f0d1661c0864028fd47ade8 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 26 Oct 2012 15:14:16 +0000 Subject: [PATCH 1/2] - update hv_set_ifconfig to work with our ifcfg OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=34 --- hyper-v.changes | 5 +++ hyper-v.tools.hv.hv_set_ifconfig.sh | 67 ++++++++++++++++++----------- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/hyper-v.changes b/hyper-v.changes index eee0e75..592d6d8 100644 --- a/hyper-v.changes +++ b/hyper-v.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Oct 26 17:13:40 CEST 2012 - ohering@suse.de + +- update hv_set_ifconfig to work with our ifcfg + ------------------------------------------------------------------- Sat Oct 13 11:40:30 CEST 2012 - ohering@suse.de diff --git a/hyper-v.tools.hv.hv_set_ifconfig.sh b/hyper-v.tools.hv.hv_set_ifconfig.sh index bcfd731..1be68df 100644 --- a/hyper-v.tools.hv.hv_set_ifconfig.sh +++ b/hyper-v.tools.hv.hv_set_ifconfig.sh @@ -1,7 +1,4 @@ #!/bin/bash - -# This example script activates an interface based on the specified -# configuration. # # In the interest of keeping the KVP daemon code free of distro specific # information; the kvp daemon code invokes this external script to configure @@ -10,13 +7,6 @@ # The only argument to this script is the configuration file that is to # be used to configure the interface. # -# Each Distro is expected to implement this script in a distro specific -# fashion. For instance on Distros that ship with Network Manager enabled, -# this script can be based on the Network Manager APIs for configuring the -# interface. -# -# This example script is based on a RHEL environment. -# # Here is the format of the ip configuration file: # # HWADDR=macaddr @@ -45,24 +35,49 @@ # is expected to return the configuration that is set via the SET # call. # - - - -echo "IPV6INIT=yes" >> $1 -echo "NM_CONTROLLED=no" >> $1 -echo "PEERDNS=yes" >> $1 -echo "ONBOOT=yes" >> $1 - -dhcp=$(grep "DHCP" $1 2>/dev/null) -if [ "$dhcp" != "" ]; +cfg=$1 +if ! test -f "${cfg}" then -echo "BOOTPROTO=dhcp" >> $1; + : expect configuration datafile as first argument + exit 1 +fi +# +( +unset DHCP +unset IF_NAME +. "$1" +if test -z "${IF_NAME}" +then + echo "Missing IF_NAME= in ${cfg}" + exit 1 +fi +# +t=`mktemp` +if test -z "${t}" +then + exit 1 fi -cp $1 /etc/sysconfig/network-scripts/ +_exit() { + rm -f "${t}" +} +trap _exit EXIT +# +cat >> "${t}" <<_EOF_ +# contents from $0 $* +`cat "${cfg}"` +# +# additional options: +STARTMODE=auto +_EOF_ +if test "${DHCP}" = "yes" +then + echo "BOOTPROTO=dhcp" >> ${t}; +fi -interface=$(echo $1 | awk -F - '{ print $2 }') - -/sbin/ifdown $interface 2>/dev/null -/sbin/ifup $interfac 2>/dev/null +echo "$0: working on network interface ifcfg-${IF_NAME}" +cp -b ${t} /etc/sysconfig/network/ifcfg-${IF_NAME} +ifdown ${IF_NAME} -o hotplug +ifup ${IF_NAME} -o hotplug +) 2>&1 | logger -t "${0##*/}[$PPID / $$]" From c88432d5de69aaf9fb70b39c9cbacfbde9bc83a4bd0680d9f7511f58e4da8cff Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 1 Nov 2012 14:52:30 +0000 Subject: [PATCH 2/2] - update kv_kvp_daemon to 3.7-rc1 state [fate#314441] OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=35 --- hyper-v.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hyper-v.changes b/hyper-v.changes index 592d6d8..9949a8e 100644 --- a/hyper-v.changes +++ b/hyper-v.changes @@ -14,7 +14,7 @@ Sat Oct 13 11:40:30 CEST 2012 - ohering@suse.de Thu Oct 4 15:14:05 CEST 2012 - ohering@suse.de - bump to version 4 -- update kv_kvp_daemon to 3.7-rc1 state [fate#31441] +- update kv_kvp_daemon to 3.7-rc1 state [fate#314441] support KVP IP Injection, helper scripts go to /usr/lib/hyper-v/bin: hv_get_dhcp_info, hv_get_dns_info, hv_set_ifconfig - remove usage of absolute paths in runlevel script