pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc * Add a MESSAGE file with helpful information for NetB...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fa999a6eb578
branches:  trunk
changeset: 502656:fa999a6eb578
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Nov 08 00:47:35 2005 +0000

description:
* Add a MESSAGE file with helpful information for NetBSD domain0
  installations.

* Modify the package to not install all of the configuration files with
  the execute bit set -- only install the helper scripts that way.

* Update the block-file-nbsd script to not blindly try to configure (and
  often fail to configure) every vnd(4) device until it finds one that
  works.  We now just determine what the next free vnd(4) device is and
  configure it directly.

* Add a netbsd-nbsd script that avoids trying to do all the Linux-specific
  that just filled the log files with garbage on NetBSD.

* Update the vif-bridge-nbsd script to check that the bridge device is
  configured before using it.

* Add clear comments at the top of scripts that can be customized so that
  the user has enough information to know how to do the customization.

* Add a xendomains rc.d script that can be used to start and stop guest
  domains at system boot- or shutdown-time.

Bump the PKGREVISION to 5.

diffstat:

 doc/CHANGES                               |    3 +-
 sysutils/xentools20/MESSAGE.NetBSD        |   17 +++
 sysutils/xentools20/Makefile              |   49 +++++------
 sysutils/xentools20/PLIST                 |    3 +-
 sysutils/xentools20/files/block-file-nbsd |   69 +++++++++++-----
 sysutils/xentools20/files/network-nbsd    |   55 ++++++++++++
 sysutils/xentools20/files/vif-bridge-nbsd |   82 +++++++++----------
 sysutils/xentools20/files/xend.sh         |    6 +-
 sysutils/xentools20/files/xendomains.sh   |  128 ++++++++++++++++++++++++++++++
 9 files changed, 315 insertions(+), 97 deletions(-)

diffs (truncated from 553 to 300 lines):

diff -r 0a559a5c55a1 -r fa999a6eb578 doc/CHANGES
--- a/doc/CHANGES       Mon Nov 07 23:51:14 2005 +0000
+++ b/doc/CHANGES       Tue Nov 08 00:47:35 2005 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.11857 2005/11/07 22:02:50 seb Exp $
+$NetBSD: CHANGES,v 1.11858 2005/11/08 00:47:38 jlam Exp $
 
 Changes to the packages collection and infrastructure in 2005:
 
@@ -5111,3 +5111,4 @@
        Updated audio/p5-CDDB_get to 2.25 [reed 2005-11-07]
        Updated devel/check to 0.9.3 [tv 2005-11-07]
        Updated net/sipcalc to 1.1.3 [seb 2005-11-07]
+       Updated sysutils/xentools20 to 2.0.7nb5 [jlam 2005-11-08]
diff -r 0a559a5c55a1 -r fa999a6eb578 sysutils/xentools20/MESSAGE.NetBSD
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xentools20/MESSAGE.NetBSD        Tue Nov 08 00:47:35 2005 +0000
@@ -0,0 +1,17 @@
+===========================================================================
+$NetBSD: MESSAGE.NetBSD,v 1.1 2005/11/08 00:47:35 jlam Exp $
+
+Please ensure that the Xen-specific devices needed by xend(8) exist:
+
+       cd /dev && sh MAKEDEV xen
+
+There are example configuration files for setting up a guest domain in:
+
+       ${EGDIR}/xmexample[0-9]*
+
+Please also refer to the the "NetBSD/xen How-To" for more information on
+creating a Xen setup:
+
+       http://www.netbsd.org/Ports/xen/howto.html
+
+===========================================================================
diff -r 0a559a5c55a1 -r fa999a6eb578 sysutils/xentools20/Makefile
--- a/sysutils/xentools20/Makefile      Mon Nov 07 23:51:14 2005 +0000
+++ b/sysutils/xentools20/Makefile      Tue Nov 08 00:47:35 2005 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.21 2005/10/01 02:10:10 xtraeme Exp $
+# $NetBSD: Makefile,v 1.22 2005/11/08 00:47:35 jlam Exp $
 #
 
 DISTNAME=              xen-2.0.7-src
 PKGNAME=               xentools20-2.0.7
-PKGREVISION=           4
+PKGREVISION=           5
 CATEGORIES=            sysutils
 MASTER_SITES=          http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/
 EXTRACT_SUFX=          .tgz
@@ -24,6 +24,7 @@
 WRKSRC=                        ${WRKDIR}/xen-2.0/tools
 
 EGDIR=                 ${PREFIX}/share/examples/xen
+MESSAGE_SUBST=         EGDIR=${EGDIR}
 
 USE_TOOLS+=            gmake
 MAKE_ENV+=             EGDIR="${EGDIR}"
@@ -73,45 +74,41 @@
 PROCPATH=              /proc
 .endif
 
-RCD_SCRIPTS=           xend
+RCD_SCRIPTS=           xend xendomains
 FILES_SUBST+=          RCD_INTERPRETER=${PYTHONBIN}
 FILES_SUBST+=          PROCPATH=${PROCPATH}
 FILES_SUBST+=          PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
 
-INSTALLATION_DIRS=     share/examples/xen
-
-XEND_SCRIPTS=          network block-enbd vif-bridge block-file \
-                       xmexample1 xmexample2 xmexample3
+XEND_SCRIPTS=          network block-enbd vif-bridge block-file
 
 CONF_FILES=            ${EGDIR}/xend-config.sxp \
                        ${PKG_SYSCONFDIR}/xend-config.sxp
-.for f in ${XEND_SCRIPTS}
-CONF_FILES+=           ${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f}
+.for s in ${XEND_SCRIPTS}
+CONF_FILES_PERMS+=     ${EGDIR}/${s} ${PKG_SYSCONFDIR}/${s}            \
+                       ${ROOT_USER} ${ROOT_GROUP} 0755
 .endfor
 
-CONF_FILES_MODE=       0755
-
 pre-build:
        ${MKDIR} ${WRKSRC}/libxc/xen/NetBSD
        ${CP} ${FILESDIR}/xenio.h ${WRKSRC}/libxc/xen/NetBSD
 
+.if ${OPSYS} == "NetBSD"
+post-build:
+       cd ${FILESDIR}; for src in *-nbsd; do                           \
+               dst="$${src%-nbsd}";                                    \
+               ${SED}  -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"     \
+                       $$src > ${WRKSRC}/examples/$$dst;               \
+       done
+.endif
+
 post-install:
-       ${INSTALL_DATA} ${WRKSRC}/examples/xend-config.sxp \
-               ${EGDIR}/xend-config.sxp
-.if ${OPSYS} == "Linux"
-.  for s in ${XEND_SCRIPTS}
+       ${INSTALL_DATA_DIR} ${EGDIR}
+       for f in xend-config.sxp xmexample1 xmexample2 xmexample3; do   \
+               ${INSTALL_DATA} ${WRKSRC}/examples/$$f ${EGDIR}/$$f;    \
+       done
+.for s in ${XEND_SCRIPTS}
        ${INSTALL_SCRIPT} ${WRKSRC}/examples/${s} ${EGDIR}/${s}
-.  endfor
-.else
-.  for f in vif-bridge block-file
-       ${SED} -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"      \
-               ${FILESDIR}/${f}-nbsd > ${WRKSRC}/${f}-nbsd
-       ${INSTALL_SCRIPT} ${WRKSRC}/${f}-nbsd ${EGDIR}/${f}
-.  endfor
-.  for f in ${XEND_SCRIPTS:S/vif-bridge//:S/block-file//}
-       ${INSTALL_SCRIPT} ${WRKSRC}/examples/${f} ${EGDIR}/${f}
-.  endfor
-.endif
+.endfor
 
 .include "../../lang/python/application.mk"
 .include "../../lang/python/extension.mk"
diff -r 0a559a5c55a1 -r fa999a6eb578 sysutils/xentools20/PLIST
--- a/sysutils/xentools20/PLIST Mon Nov 07 23:51:14 2005 +0000
+++ b/sysutils/xentools20/PLIST Tue Nov 08 00:47:35 2005 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.7 2005/08/06 17:43:14 bouyer Exp $
+@comment $NetBSD: PLIST,v 1.8 2005/11/08 00:47:35 jlam Exp $
 bin/xencons
 bin/xenperf
 include/xc.h
@@ -179,6 +179,7 @@
 sbin/xfrd
 sbin/xm
 share/examples/rc.d/xend
+share/examples/rc.d/xendomains
 share/examples/xen/block-enbd
 share/examples/xen/block-file
 share/examples/xen/network
diff -r 0a559a5c55a1 -r fa999a6eb578 sysutils/xentools20/files/block-file-nbsd
--- a/sysutils/xentools20/files/block-file-nbsd Mon Nov 07 23:51:14 2005 +0000
+++ b/sysutils/xentools20/files/block-file-nbsd Tue Nov 08 00:47:35 2005 +0000
@@ -1,34 +1,59 @@
 #!/bin/sh
 #
-# $NetBSD: block-file-nbsd,v 1.1 2005/10/01 02:10:10 xtraeme Exp $
+# $NetBSD: block-file-nbsd,v 1.2 2005/11/08 00:47:35 jlam Exp $
 #
-# Usage: block_file [bind file|unbind node]
+# Usage: block-file bind file
+#
+#    The file argument is the path to the file to which a vnd(4) device
+#    will be bound.
 #
-# The file argument to the bind command is the file we are to bind to a
-# vnd device.  We print the path to the vnd device node to stdout.
+# Usage: block-file unbind node
+#
+#    The node argument is the name of the device node to unbind.
 #
-# The node argument to unbind is the name of the device node we are to
-# unbind.
+
+case "$1" in
+bind)
+       FILE="$2"
 
-case $1 in
-       bind)
-               for dev in /dev/vnd?d; do
-                       if /usr/sbin/vnconfig $dev $2; then
-                               echo $dev
-                               exit 0
-                       fi
-               done
-               exit 1
+       # Store the list of available vnd(4) devices in ``available_disks'',
+       # and mark them as ``free''.
+       #
+       list=`/bin/ls -1 /dev/vnd[0-9]*d | sed "s,/dev/vnd,,;s,d,," | sort -n`
+       for i in $list; do
+               disk="vnd$i"
+               available_disks="$available_disks $disk"
+               eval $disk=free
+       done
+
+       # Mark the used vnd(4) devices as ``used''.
+       for disk in `sysctl hw.disknames`; do
+               case $disk in
+               vnd[0-9]*) eval $disk=used ;;
+               esac
+       done
+
+       # Configure the first free vnd(4) device.
+       for disk in $available_disks; do
+               eval status=\$$disk
+               if [ "$status" = "free" ] && \
+                  vnconfig /dev/${disk}d $FILE >/dev/null; then
+                       echo /dev/${disk}d
+                       exit 0
+               fi
+       done
+       exit 1
        ;;
 
-       unbind)
-               /usr/sbin/vnconfig -u $2
-               exit 0
+unbind)
+       NODE="$2"
+       vnconfig -u $NODE
+       exit 0
        ;;
 
-       *)
-               echo 'Unknown command: ' $1
-               echo 'Valid commands are: bind, unbind'
-               exit 1
+*)
+       echo "Unknown command: $1"
+       echo "Valid commands are: bind, unbind"
+       exit 1
        ;;
 esac
diff -r 0a559a5c55a1 -r fa999a6eb578 sysutils/xentools20/files/network-nbsd
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xentools20/files/network-nbsd    Tue Nov 08 00:47:35 2005 +0000
@@ -0,0 +1,55 @@
+#!/bin/sh
+#============================================================================
+# $NetBSD: network-nbsd,v 1.1 2005/11/08 00:47:35 jlam Exp $
+#
+# @PKG_SYSCONFDIR@/network
+#
+# Script for starting and stopping the network configuration for the Xen
+# domains.  The xend(8) daemon calls a network script when it starts,
+# before any guest domains are started.  The xend(8) daemon also calls
+# a network script when it stops.  The script name to use is defined in
+# @PKG_SYSCONFDIR@/xend-config.sxp in the ``network-script'' field.
+# 
+# Usage: network start|stop|status [var=value ...]
+#
+# Actions:
+#    start     Create the network configuration for the Xen domains.
+#    stop      Destroy the network configuration for the Xen domains.
+#    status    Print some network-related information, e.g. ifconfig
+#              and routes.
+#
+# This script may be customized so that the "start" action creates the
+# bridge device(s) to which the guest domains' vifs should connect.
+# However, it is simpler to create any network devices at system startup
+# via /etc/ifconfig.* scripts, e.g. if dom0 has a bge0 device and we wish
+# to create a bridge0 device:
+#
+# /etc/ifconfig.bridge0
+# ------8<------8<------8<------8<------
+# create
+# !brconfig $int add bge0 stp bge0 up
+# ------>8------>8------>8------>8------
+#
+#============================================================================
+
+# Exit if anything goes wrong.
+set -e
+
+# First arg is the operation.
+OP=$1; shift
+
+# Pull variables in args into environment
+for arg ; do export "${arg}" ; done
+
+case $OP in
+start|stop|status)
+       # Do nothing
+       ;;
+*)
+       echo 'Invalid command: ' $OP  
+       echo 'Valid commands are: start, stop, status'
+       exit 1
+       ;;
+esac
+
+exit 0
diff -r 0a559a5c55a1 -r fa999a6eb578 sysutils/xentools20/files/vif-bridge-nbsd
--- a/sysutils/xentools20/files/vif-bridge-nbsd Mon Nov 07 23:51:14 2005 +0000
+++ b/sysutils/xentools20/files/vif-bridge-nbsd Tue Nov 08 00:47:35 2005 +0000
@@ -1,47 +1,39 @@
 #!/bin/sh
+#============================================================================
+# $NetBSD: vif-bridge-nbsd,v 1.3 2005/11/08 00:47:35 jlam Exp $
 #
-# $NetBSD: vif-bridge-nbsd,v 1.2 2005/10/01 02:38:51 xtraeme Exp $
-#
-#============================================================================
 # @PKG_SYSCONFDIR@/vif-bridge
 #
-# Script for configuring a vif in bridged mode.
-# Xend calls a vif script when bringing a vif up or down.



Home | Main Index | Thread Index | Old Index