From 5ebabf1d3ec364fc2e9df54a9694a9402fb5a8bc Mon Sep 17 00:00:00 2001 From: jkim Date: Mon, 18 Mar 2013 23:22:47 +0000 Subject: Add preliminary support for IBM/Lenovo TrackPoint. PR: kern/147237 (based on the initial patch for 8.x) Tested by: glebius (device detection and suspend/resume) MFC after: 1 month --- share/man/man4/psm.4 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/man/man4/psm.4 b/share/man/man4/psm.4 index ffcd1d5..99835fb 100644 --- a/share/man/man4/psm.4 +++ b/share/man/man4/psm.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2012 +.Dd March 18, 2013 .Dt PSM 4 .Os .Sh NAME @@ -339,6 +339,12 @@ at boot-time. This will enable .Nm to handle packets from guest devices (sticks) and extra buttons. +Similarly, extended support for IBM/Lenovo TrackPoint can be enabled +by setting +.Va hw.psm.trackpoint_support +to +.Em 1 +at boot-time. .Pp Tap and drag gestures can be disabled by setting .Va hw.psm.tap_enabled @@ -832,8 +838,8 @@ In contrast, some pad products, e.g.\& some versions of ALPS GlidePoint and Interlink VersaPad, treat the tapping action as fourth button events. .Pp -It is reported that ALPS GlidePoint, Synaptics Touchpad, and -Interlink VersaPad require +It is reported that ALPS GlidePoint, Synaptics Touchpad, IBM/Lenovo +TrackPoint, and Interlink VersaPad require .Em INITAFTERSUSPEND flag in order to recover from suspended state. This flag is automatically set when one of these devices is detected by the -- cgit v1.1 From b893c0b25ff830052a49ac7c91eb5801eac0673b Mon Sep 17 00:00:00 2001 From: neel Date: Mon, 18 Mar 2013 23:46:14 +0000 Subject: Add bhyve to examples. Requested by: alfred, julian Obtained from: NetApp --- share/examples/Makefile | 2 + share/examples/bhyve/vmrun.sh | 179 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100755 share/examples/bhyve/vmrun.sh (limited to 'share') diff --git a/share/examples/Makefile b/share/examples/Makefile index a3be98c..90bef45 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -7,6 +7,7 @@ LDIRS= BSD_daemon \ FreeBSD_version \ IPv6 \ + bhyve \ bootforth \ csh \ cvsup \ @@ -42,6 +43,7 @@ XFILES= BSD_daemon/FreeBSD.pfa \ FreeBSD_version/Makefile \ FreeBSD_version/README \ IPv6/USAGE \ + bhyve/vmrun.sh \ bootforth/README \ bootforth/boot.4th \ bootforth/frames.4th \ diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh new file mode 100755 index 0000000..870c4dd --- /dev/null +++ b/share/examples/bhyve/vmrun.sh @@ -0,0 +1,179 @@ +#!/bin/sh +# +# Copyright (c) 2013 NetApp, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +LOADER=/usr/sbin/bhyveload +BHYVECTL=/usr/sbin/bhyvectl +FBSDRUN=/usr/sbin/bhyve + +DEFAULT_MEMSIZE=512 +DEFAULT_CPUS=2 +DEFAULT_TAPDEV=tap0 + +DEFAULT_VIRTIO_DISK="./diskdev" +DEFAULT_ISOFILE="./release.iso" + +usage() { + echo "Usage: vmrun.sh [-hai][-m ][-d ][-I ][-t ] " + echo " -h: display this help message" + echo " -a: force memory mapped local apic access" + echo " -c: number of virtual cpus (default is ${DEFAULT_CPUS})" + echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" + echo " -i: force boot of the Installation CDROM image" + echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" + echo " -m: memory size in MB (default is ${DEFAULT_MEMSIZE}MB)" + echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" + echo "" + echo " This script needs to be executed with superuser privileges" + echo "" + exit 1 +} + +if [ `id -u` -ne 0 ]; then + usage +fi + +kldstat -n vmm > /dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "vmm.ko is not loaded!" + exit 1 +fi + +force_install=0 +isofile=${DEFAULT_ISOFILE} +memsize=${DEFAULT_MEMSIZE} +cpus=${DEFAULT_CPUS} +virtio_diskdev=${DEFAULT_VIRTIO_DISK} +tapdev=${DEFAULT_TAPDEV} +apic_opt="" + +while getopts haic:I:m:d:t: c ; do + case $c in + h) + usage + ;; + a) + apic_opt="-a" + ;; + d) + virtio_diskdev=${OPTARG} + ;; + i) + force_install=1 + ;; + I) + isofile=${OPTARG} + ;; + c) + cpus=${OPTARG} + ;; + m) + memsize=${OPTARG} + ;; + t) + tapdev=${OPTARG} + ;; + \?) + usage + ;; + esac +done + +shift $((${OPTIND} - 1)) + +if [ $# -ne 1 ]; then + usage +fi + +vmname="$1" + +# Create the virtio diskdev file if needed +if [ ! -f ${virtio_diskdev} ]; then + echo "virtio disk device file \"${virtio_diskdev}\" does not exist." + echo "Creating it ..." + truncate -s 8G ${virtio_diskdev} > /dev/null +fi + +if [ ! -r ${virtio_diskdev} ]; then + echo "virtio disk device file \"${virtio_diskdev}\" is not readable" + exit 1 +fi + +if [ ! -w ${virtio_diskdev} ]; then + echo "virtio disk device file \"${virtio_diskdev}\" is not writable" + exit 1 +fi + +echo "Launching virtual machine \"$vmname\" ..." + +while [ 1 ]; do + ${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1 + + file ${virtio_diskdev} | grep ": x86 boot sector" > /dev/null + rc=$? + if [ $rc -ne 0 ]; then + file ${virtio_diskdev} | grep ": Unix Fast File sys" > /dev/null + rc=$? + fi + if [ $rc -ne 0 ]; then + need_install=1 + else + need_install=0 + fi + + if [ $force_install -eq 1 -o $need_install -eq 1 ]; then + if [ ! -r ${isofile} ]; then + echo -n "Installation CDROM image \"${isofile}\" " + echo "is not readable" + exit 1 + fi + BOOTDISK=${isofile} + installer_opt="-s 3:0,virtio-blk,${BOOTDISK}" + else + BOOTDISK=${virtio_diskdev} + installer_opt="" + fi + + ${LOADER} -m ${memsize} -d ${BOOTDISK} ${vmname} + if [ $? -ne 0 ]; then + break + fi + + ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P -g 0 \ + -s 0:0,hostbridge \ + -s 1:0,virtio-net,${tapdev} \ + -s 2:0,virtio-blk,${virtio_diskdev} \ + ${installer_opt} \ + -S 31,uart,stdio \ + ${vmname} + if [ $? -ne 0 ]; then + break + fi +done + +exit 99 -- cgit v1.1