diff --git a/tools/xen/functions b/tools/xen/functions index 4e9fede387..8c674dcce3 100644 --- a/tools/xen/functions +++ b/tools/xen/functions @@ -179,7 +179,8 @@ function xenapi_ip_on { local bridge_or_net_name bridge_or_net_name=$1 - ifconfig $(bridge_for "$bridge_or_net_name") | grep "inet addr" | cut -d ":" -f2 | sed "s/ .*//" + ip -4 addr show $(bridge_for "$bridge_or_net_name") |\ + awk '/inet/{split($2, ip, "/"); print ip[1];}' } function xenapi_is_listening_on { diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh index b49347e09b..e24d9ed0b9 100755 --- a/tools/xen/install_os_domU.sh +++ b/tools/xen/install_os_domU.sh @@ -193,7 +193,10 @@ if [ -z "$templateuuid" ]; then TMP_DIR=/tmp/temp.$RANDOM mkdir -p $TMP_DIR mount -o loop $TOOLS_ISO $TMP_DIR - DEB_FILE=$(ls $TMP_DIR/Linux/*amd64.deb) + # the target deb package maybe *amd64.deb or *all.deb, + # so use *amd64.deb by default. If it doesn't exist, + # then use *all.deb. + DEB_FILE=$(ls $TMP_DIR/Linux/*amd64.deb || ls $TMP_DIR/Linux/*all.deb) cp $DEB_FILE $HTTP_SERVER_LOCATION umount $TMP_DIR rmdir $TMP_DIR