summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-04-18 15:29:36 +0000
committerjlam <jlam@pkgsrc.org>2006-04-18 15:29:36 +0000
commit279bbadaa5fde91a986df76e1a60505f34abb0e7 (patch)
tree2e60ddee7cfd16c6053639e899a461a44f3cd500 /sysutils
parentc069d226b6abc53a5d86e7c678f01067562bea00 (diff)
downloadpkgsrc-279bbadaa5fde91a986df76e1a60505f34abb0e7.tar.gz
Improve the block-file-nbsd script slightly so that it's possible to
force a read-only bind of the image file to a vnd(4) device. Bump the PKGREVISION.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/xentools20/Makefile4
-rw-r--r--sysutils/xentools20/files/block-file-nbsd19
2 files changed, 17 insertions, 6 deletions
diff --git a/sysutils/xentools20/Makefile b/sysutils/xentools20/Makefile
index 6d31c7ce3e2..41b5b70e32a 100644
--- a/sysutils/xentools20/Makefile
+++ b/sysutils/xentools20/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.25 2006/02/05 23:10:57 joerg Exp $
+# $NetBSD: Makefile,v 1.26 2006/04/18 15:29:36 jlam Exp $
#
DISTNAME= xen-2.0.7-src
PKGNAME= xentools20-2.0.7
-PKGREVISION= 6
+PKGREVISION= 7
CATEGORIES= sysutils
MASTER_SITES= http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/
EXTRACT_SUFX= .tgz
diff --git a/sysutils/xentools20/files/block-file-nbsd b/sysutils/xentools20/files/block-file-nbsd
index 06c9fcbe067..dfa0d31a81a 100644
--- a/sysutils/xentools20/files/block-file-nbsd
+++ b/sysutils/xentools20/files/block-file-nbsd
@@ -1,11 +1,15 @@
#!/bin/sh
#
-# $NetBSD: block-file-nbsd,v 1.2 2005/11/08 00:47:35 jlam Exp $
+# $NetBSD: block-file-nbsd,v 1.3 2006/04/18 15:29:36 jlam Exp $
#
-# Usage: block-file bind file
+# Usage: block-file bind file [flags]
#
# The file argument is the path to the file to which a vnd(4) device
-# will be bound.
+# will be bound. The flags argument is an optional block of flags
+# to modify how the file is bound to the vnd(4) device. The valid
+# flags are:
+#
+# r bind the file as read-only
#
# Usage: block-file unbind node
#
@@ -15,6 +19,7 @@
case "$1" in
bind)
FILE="$2"
+ FLAGS="$3"
# Store the list of available vnd(4) devices in ``available_disks'',
# and mark them as ``free''.
@@ -33,11 +38,17 @@ bind)
esac
done
+ vnconfig_flags=
+ case "$FLAGS" in
+ *r*) vnconfig_flags="$vnconfig_flags -r" ;;
+ esac
+
# Configure the first free vnd(4) device.
for disk in $available_disks; do
eval status=\$$disk
+ vnconfig_cmd="vnconfig $vnconfig_flags /dev/${disk}d $FILE"
if [ "$status" = "free" ] && \
- vnconfig /dev/${disk}d $FILE >/dev/null; then
+ eval $vnconfig_cmd >/dev/null; then
echo /dev/${disk}d
exit 0
fi