ports/182210: Ports containing Hyper-V integration components for FreeBSD
BSD Integration Components for Hyper-V
bsdic at microsoft.com
Wed Sep 18 17:40:01 UTC 2013
>Number: 182210
>Category: ports
>Synopsis: Ports containing Hyper-V integration components for FreeBSD
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 18 17:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: BSD Integration Components for Hyper-V
>Release: 9.1
>Organization:
Microsoft
>Environment:
FreeBSD freebsdonhyperv.org 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# hyperv-ic
# hyperv-ic/pkg-descr
# hyperv-ic/pkg-plist
# hyperv-ic/Makefile
# hyperv-ic/pkg-deinstall
# hyperv-ic/distinfo
# hyperv-ic/pkg-install
#
echo c - hyperv-ic
mkdir -p hyperv-ic > /dev/null 2>&1
echo x - hyperv-ic/pkg-descr
sed 's/^X//' >hyperv-ic/pkg-descr << '25efb91224a43d45fffdff064a69ca52'
XNAME
X hyperv-ic -- Hyper-V Integration Components
X
XSYNOPSIS
X The hyperv-ic provision a collection of kernel mode drivers and services
X that enhance FreeBSD guest experience on Hyper-V.
X
XDESCRIPTION
X The Hyper-V Integration Components include drivers and services that
X improve functionality and performance of a FreeBSD guest operating system
X running on Hyper-V. As of this writing, the hyperv-ic ports package
X installs the following binaries:
X
X a) hv_vmbus.ko - This is a loadable kernel module that provides a high
X performance communication interface between the FreeBSD guest partition
X and the Hyper-V root partition running Windows Server software. This mod-
X ule is located under /boot/kernel/.
X
X b) hv_storvsc.ko - This is a loadable kernel module that provides FreeBSD
X guests with optimized access to physical storage devices. This module is
X located under /boot/kernel/.
X
X c) hv_netvsc.ko - This is a loadable kernel module that provides FreeBSD
X guests with optimized access to the physical network card. This module
X is located under /boot/kernel/.
X
X d) hv_utils.ko - This is a loadable kernel module that provides FreeBSD
X guests with timekeeping, heartbeat, console shutdown and key-value pair
X functionality. This module is located under /boot/kernel/.
X
X e) hv_ata_pci_disengage.ko - This is a loadable kernel module that dis-
X ables the FreeBSD native ATA driver in order to avoid conflicts with the
X hv_storvsc driver. This module is located under /boot/kernel/.
X
X f) hv_kvp_daemon - This is a user mode daemon that communicates with the
X hv_utils driver to manage user configurable metadata in the form of key
X value pairs. This daemon also allows the system administrator to read
X and set IP addresses assigned to a FreeBSD guest. The daemon utilizes the
X following collection of scripts stored under /usr/local/hyperv/scripts:
X hv_get_dhcp_info
X hv_get_dns_info
X hv_set_ifconfig
X
X The daemon is located under /usr/sbin/. The corresponding daemon script
X named hv_kvpd is present under /etc/rc.d/.
X
XPRE-REQUISITE
X Before you install hyperv-ic ports, please ensure that you have added
X disk labels or UUIDs to all devices listed in fstab.
X
XSEE ALSO
X hv_vmbus(4), hv_utils(4), hv_netvsc(4), hv_storvsc(4),
X hv_ata_pci_disengage(4), hv_kvp_daemon(8)
X
XHISTORY
X Support for hyperv-ic ports was first released in September 2013. The
X ports were developed through a joint effort between Citrix Inc.,
X Microsoft Corp. and Network Appliance Inc..
X
XAUTHORS
X FreeBSD support for hyperv-ic was first added by Microsoft BSD
X Integration Services Team <bsdic at microsoft.com>.
25efb91224a43d45fffdff064a69ca52
echo x - hyperv-ic/pkg-plist
sed 's/^X//' >hyperv-ic/pkg-plist << 'ae2305b65c9dbf7789f9d55dd252500c'
X at cwd /boot/kernel
Xhv_ata_pci_disengage.ko
Xhv_netvsc.ko
Xhv_storvsc.ko
Xhv_utils.ko
Xhv_vmbus.ko
X at cwd /usr/local/hyperv/scripts
Xhv_get_dhcp_info
Xhv_get_dns_info
Xhv_set_ifconfig
X at cwd /etc/rc.d
Xhv_kvpd
X at cwd /usr/sbin
Xhv_kvp_daemon
X at cwd /usr/share/man/man1
Xhyperv-ic.1.gz
X at cwd /usr/share/man/man4
Xhv_ata_pci_disengage.4.gz
Xhv_kvp.4.gz
Xhv_netvsc.4.gz
Xhv_storvsc.4.gz
Xhv_utils.4.gz
Xhv_vmbus.4.gz
X at cwd /usr/share/man/man8
Xhv_kvp_daemon.8.gz
ae2305b65c9dbf7789f9d55dd252500c
echo x - hyperv-ic/Makefile
sed 's/^X//' >hyperv-ic/Makefile << 'ab915107f78c05963c93866dff9180d1'
X# $FreeBSD$
X
XPORTNAME= hyperv-ic
XPORTVERSION= 1.0
XCATEGORIES= kld
XMASTER_SITES= https://github.com/FreeBSDonHyper-V/Hyperv-Ports/raw/packages/hyperv-ic/
X
XMAINTAINER= bsdic at microsoft.com
XCOMMENT= Hyper-V Integration Components
X
XFETCH_ARGS= -Fpr
X
XCC?=clang
XCXX?=clang++
XCPP?=clang-cpp
X
XONLY_FOR_ARCHS= amd64 i386
X
X.include <bsd.port.pre.mk>
X
X.if ${OSVERSION} != 901000
XBROKEN= Only for FreeBSD 9.1 Release
X.endif
X
Xpre-install:
X @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
X
Xpost-install:
X @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
X
Xpost-deinstall:
X @PKG_PREFIX=${PREFIX} ${SH} ${PKGDEINSTALL} ${PKGNAME} POST-DEINSTALL
X
X.include <bsd.port.post.mk>
ab915107f78c05963c93866dff9180d1
echo x - hyperv-ic/pkg-deinstall
sed 's/^X//' >hyperv-ic/pkg-deinstall << 'd96c615be4e82833d9962e829a1fc8f4'
X#!/bin/sh
X#
X# make deinstall or pkd_delete script
X# cleans the hyperv labels
X#
X
Xif [ "$2" = "DEINSTALL" ]; then
X test="/boot/loader.conf"
X
X if [ -f $test ]; then
X echo "===> File $test exists"
X echo "Removing Hyper-v drivers labels "
X # Deleting hyperv driver names
X sed -i".bak" '/Loader labels for Hyper-V driver/d' /boot/loader.conf
X sed -i".bak" '/hv_vmbus_load/d' /boot/loader.conf
X sed -i".bak" '/hv_utils_load/d' /boot/loader.conf
X sed -i".bak" '/hv_storvsc_load/d' /boot/loader.conf
X sed -i".bak" '/hv_netvsc_load/d' /boot/loader.conf
X sed -i".bak" '/hv_ata_pci_disengage_load/d' /boot/loader.conf
X else
X echo "===> File $test not found"
X fi
X
Xecho "===> Removing kvp daemon label"
Xsed -i".bak" '/Labels for KVP daemon/d' /etc/rc.conf
Xsed -i".bak" '/hv_kvp_daemon_enable/d' /etc/rc.conf
X
Xfi
Xexit 0
d96c615be4e82833d9962e829a1fc8f4
echo x - hyperv-ic/distinfo
sed 's/^X//' >hyperv-ic/distinfo << '8c75fc298d62206188858e8f8db9031d'
XSHA256 (hyperv-ic-1.0.tar.gz) = 1b9f438d7a20160392c1975a3adbaf3cb8d4f3325590a7fe6bd1ef6b9c0dcd84
XSIZE (hyperv-ic-1.0.tar.gz) = 109773
8c75fc298d62206188858e8f8db9031d
echo x - hyperv-ic/pkg-install
sed 's/^X//' >hyperv-ic/pkg-install << 'de9ebe5ee976520640da45d75e8093e1'
X#!/bin/sh
X#
X# make install or pkg_add script
X# Checks labels/gptids for roots and swap partitions
X# adds hyperv labels in loader.conf
X#
X
Xif [ "$2" = "PRE-INSTALL" ]; then
Xecho "===> Pre-install Check"
X
X#rootfs check
Xroot_flag=$(mount | awk '/ on \/ / { print $1 }' | cut -d / -f3-)
Xif [ "$root_flag" != "" ]; then
X fs_test=$(glabel status | awk '{print $1}' | grep $root_flag)
X if [ "$fs_test" == "" ]; then
X echo " xxx rootfs Label/gptid missing in fstab"
X fi
Xelse
X echo " xxx rootfs Label/gptid missing in fstab"
Xfi
X
X#swap check
Xswap_flag=$(grep swap /etc/fstab | awk '{print $1}' | cut -d / -f3-)
Xif [ "$swap_flag" != "" ]; then
X sw_test=$(glabel status | awk '{print $1}' | grep $swap_flag)
X if [ "$sw_test" == "" ]; then
X echo " xxx swap Label/gptid missing in fstab"
X fi
Xelse
X echo " xxx swap Label/gptid missing in fstab "
Xfi
X
Xif [ "$fs_test" != "" -a "$sw_test" != "" ]; then
X echo "===> Labels/gptids Found"
X echo "===> Hyper-V Installation Continues"
X else
X echo "===> Labels/gptids Not found"
X echo "===> Hyper-V Installation Aborted"
X echo "===> Refer to Disk UUID section in README document"
X echo "===> Please refer the Prerequisites page and complete all steps"
X echo "WWW: https://github.com/FreeBSDonHyper-V/Hyperv-Ports/wiki/Prerequisites "
X exit -1
Xfi
X
X# KVP - Directories Check
X
Xecho "===> Checking KVP directories"
Xkvp_dir="/usr/local/hyperv/"
Xkvp_dir_scripts="/usr/local/hyperv/scripts"
X
Xif [ -d $kvp_dir ]; then
X if [ -d $kvp_dir_scripts ]; then
X echo " ### KVP Directories present "
X else
X echo " ### Creating $kvp_dir_scripts directory "
X mkdir /usr/local/hyperv/scripts
X fi
Xelse
X echo " xxx KVP directories not found"
X echo " ### Creating KVP directories "
X mkdir /usr/local/hyperv
X mkdir /usr/local/hyperv/scripts
Xfi
X
Xelse if [ "$2" = "POST-INSTALL" ]; then
X test="/boot/loader.conf"
X
X if [ -f $test ]; then
X echo "===> File $test exists"
X echo "Adding for Hyper-v drivers"
X
X # Deleting hyperv driver names
X sed -i".bak" '/Loader labels for Hyper-V driver/d' /boot/loader.conf
X sed -i".bak" '/hv_vmbus_load/d' /boot/loader.conf
X sed -i".bak" '/hv_utils_load/d' /boot/loader.conf
X sed -i".bak" '/hv_storvsc_load/d' /boot/loader.conf
X sed -i".bak" '/hv_netvsc_load/d' /boot/loader.conf
X sed -i".bak" '/hv_ata_pci_disengage_load/d' /boot/loader.conf
X
X #hyperv driver names
X echo "# Loader labels for Hyper-V drivers -do not modify" >> /boot/loader.conf
X echo "hv_vmbus_load=\"YES\"" >> /boot/loader.conf
X echo "hv_utils_load=\"YES\"" >> /boot/loader.conf
X echo "hv_storvsc_load=\"YES\"" >> /boot/loader.conf
X echo "hv_netvsc_load=\"YES\"" >> /boot/loader.conf
X echo "hv_ata_pci_disengage_load=\"YES\"" >> /boot/loader.conf
X
X else
X echo "===> File $test does not exists"
X echo " Adding File $test and Hyper-V driver labels"
X #hyperv driver names
X echo "# Loader labels for Hyper-V drivers -do not modify" >> /boot/loader.conf
X echo "hv_vmbus_load=\"YES\"" >> /boot/loader.conf
X echo "hv_utils_load=\"YES\"" >> /boot/loader.conf
X echo "hv_storvsc_load=\"YES\"" >> /boot/loader.conf
X echo "hv_netvsc_load=\"YES\"" >> /boot/loader.conf
X echo "hv_ata_pci_disengage_load=\"YES\"" >> /boot/loader.conf
X fi
X
X# KVP - daemon label
Xecho "===> Adding kvp daemon label"
Xsed -i".bak" '/Labels for KVP daemon/d' /etc/rc.conf
Xsed -i".bak" '/hv_kvp_daemon_enable/d' /etc/rc.conf
Xecho "# Labels for KVP daemon -do not modify" >> /etc/rc.conf
Xecho "hv_kvp_daemon_enable=\"YES\"" >> /etc/rc.conf
X
Xfi
Xfi
Xexit 0
de9ebe5ee976520640da45d75e8093e1
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list