
Hello community, here is the log from the commit of package nbd checked in at Mon Jul 30 22:44:36 CEST 2007. -------- --- nbd/nbd.changes 2007-03-12 23:52:13.000000000 +0100 +++ /mounts/work_src_done/STABLE/nbd/nbd.changes 2007-07-30 17:35:31.644761000 +0200 @@ -1,0 +2,19 @@ +Mon Jul 30 15:51:16 CEST 2007 - garloff@suse.de + +- Convert options from old nbd-server.conf to new nbd-server/config + on update and drop support for old config file syntax. +- Fix daemonize(0) segfault and pid filename. +- Fix compiler warnings. +- Fix /dev filename docu. +- Use startproc, killproc, checkproc in init script +- nbd-server does not support SIGHUP, fix init script accordingly. + +------------------------------------------------------------------- +Tue Jul 17 00:54:45 CEST 2007 - garloff@suse.de + +- Update to nbd-2.9.5: + * Support for more platforms, pkgconfig, debug build. + * -o option to convert cmdline options to config file. + * Fix duplication in handling nonblocking server socket. + +------------------------------------------------------------------- Old: ---- nbd-2.9.2.tar.bz2 New: ---- nbd-2.9.5-doc.diff nbd-2.9.5.tar.bz2 nbd-2.9.5-warn.diff nbd-server-daemonize-0.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nbd.spec ++++++ --- /var/tmp/diff_new_pack.a17531/_old 2007-07-30 22:39:02.000000000 +0200 +++ /var/tmp/diff_new_pack.a17531/_new 2007-07-30 22:39:02.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package nbd (Version 2.9.2) +# spec file for package nbd (Version 2.9.5) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -13,13 +13,16 @@ Name: nbd BuildRequires: doxygen glib2-devel PreReq: %insserv_prereq -Version: 2.9.2 +Version: 2.9.5 Release: 1 -License: GNU General Public License (GPL) +License: GPL v2 or later Group: Productivity/Networking/Other Autoreqprov: on Source: %{name}-%{version}.tar.bz2 Source2: init.nbd-server +Patch1: nbd-server-daemonize-0.diff +Patch2: nbd-2.9.5-warn.diff +Patch3: nbd-2.9.5-doc.diff Summary: Network Block Device Server and Client Utilities URL: http://nbd.sourceforge.net/ Prefix: /usr @@ -54,6 +57,9 @@ %prep %setup +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 touch nbd-client.8 %build @@ -62,7 +68,7 @@ #export CFLAGS="$RPM_OPT_FLAGS" ./configure --with-gnu-ld --prefix=/usr --mandir=%{_mandir} \ --infodir=%{_infodir} --libdir=%{_libdir} --libexecdir=%{_libdir} \ - --program-prefix="" --build=%{_target_cpu}-suse-linux + --program-prefix="" --sysconfdir=/etc --build=%{_target_cpu}-suse-linux make doxygen @@ -72,7 +78,11 @@ install %SOURCE2 $RPM_BUILD_ROOT/etc/init.d/nbd-server mkdir -p $RPM_BUILD_ROOT/usr/bin ln -s ../../etc/init.d/nbd-server $RPM_BUILD_ROOT/usr/bin/rcnbd-server -echo "#Port file options" > $RPM_BUILD_ROOT/etc/nbd-server.conf +#echo "#Port file options" > $RPM_BUILD_ROOT/etc/nbd-server.conf +mkdir -p $RPM_BUILD_ROOT/etc/nbd-server +touch $RPM_BUILD_ROOT/etc/nbd-server/config +touch $RPM_BUILD_ROOT/etc/nbd-server/allow +grep -A16 -B1 '^\[generic\]' README > $RPM_BUILD_ROOT/etc/nbd-server/config.example %files %defattr(-,root,root) @@ -84,15 +94,50 @@ %{_mandir}/man8/nbd-client.8.gz %doc README %doc doc/html -%config(noreplace) /etc/nbd-server.conf +#%config(noreplace) /etc/nbd-server.conf +%dir /etc/nbd-server +%ghost %config(noreplace) /etc/nbd-server/config +%ghost %config(noreplace) /etc/nbd-server/allow +/etc/nbd-server/config.example %post %{fillup_and_insserv -f nbd-server} +if test -e /etc/nbd-server.conf; then + # Do we have to create a generic section? + unset generic + if test -e /etc/nbd-server/config; then generic=1; fi + while read port file opts; do + if test -z "$port"; then continue; fi + if test "${port:0:1}" = "#"; then continue; fi + if test -z "$generic"; then + echo -e "[generic]\n\t# No generic options yet\n" > /etc/nbd-server/config + generic=1 + fi + FN=${file%/*} + nm="cvt.$port.${FN##*/}.${file##*/}" + echo " ... convert $port $file $opts -> $nm" + /usr/bin/nbd-server $port $file $opts -o "$nm" >> /etc/nbd-server/config + done < /etc/nbd-server.conf + mv /etc/nbd-server.conf /etc/nbd-server.conf.converted +fi %postun %{insserv_cleanup} %changelog +* Mon Jul 30 2007 - garloff@suse.de +- Convert options from old nbd-server.conf to new nbd-server/config + on update and drop support for old config file syntax. +- Fix daemonize(0) segfault and pid filename. +- Fix compiler warnings. +- Fix /dev filename docu. +- Use startproc, killproc, checkproc in init script +- nbd-server does not support SIGHUP, fix init script accordingly. +* Tue Jul 17 2007 - garloff@suse.de +- Update to nbd-2.9.5: + * Support for more platforms, pkgconfig, debug build. + * -o option to convert cmdline options to config file. + * Fix duplication in handling nonblocking server socket. * Mon Mar 12 2007 - garloff@suse.de - Update to 2.9.2: * make child socket nonblocking ++++++ init.nbd-server ++++++ --- nbd/init.nbd-server 2007-03-13 00:00:20.000000000 +0100 +++ /mounts/work_src_done/STABLE/nbd/init.nbd-server 2007-07-30 17:32:25.834752000 +0200 @@ -31,12 +31,16 @@ NBD_CONFIG=/etc/nbd-server.conf NBD29_CONFIG=/etc/nbd-server/config test -r $NBD_CONFIG && { - echo "$NBD_CONFIG: Using old style config file deprecated"; + echo "$NBD_CONFIG: Using old style config file unsupported"; } -test -r $NBD_CONFIG || test -r $NBD29_CONFIG || { +test -r $NBD29_CONFIG || { echo "No config file $NBD29_CONFIG existing"; - if [ "$1" = "stop" ]; then exit 0; - else exit 6; fi; } + if [ "$1" = "stop" ]; then + exit 0; + else + exit 6; + fi; +} # Shell functions sourced from /etc/rc.status: . /etc/rc.status @@ -49,44 +53,21 @@ echo -n "Starting nbd-server " ## Start daemon with startproc(8). If this fails ## the return value is set appropriately by startproc. - if test -r $NBD29_CONFIG; then - $NBD_BIN - rc_check - else - declare -i started - started=0 - while read port file options; do - if test -z "$port"; then continue; fi - if test "${port:0:1}" = "#"; then continue; fi - echo -n " $port" - #/sbin/startproc -p /var/run/nbd-server.$port.pid $NBD_BIN $port $file $options - $NBD_BIN $port $file $options - rc_check - let started+=1 - done < $NBD_CONFIG - fi - # Remember status and be verbose - if test $_rc_status = 0 -a $started = 0; then - rc_status -s - else - true - rc_status -v - fi + startproc $NBD_BIN + rc_status -v ;; stop) echo -n "Shutting down nbd-server " ## Stop daemon with killproc(8) and if this fails ## killproc sets the return value according to LSB. - if test -r $NBD29_CONFIG; then - killall ${NBD_BIN##*/} - else - while read port file options; do - if test -z "$port"; then continue; fi - if test "${port:0:1}" = "#"; then continue; fi - echo -n " $port" - /sbin/killproc -p /var/run/nbd-server.$port.pid $NBD_BIN $port $file $options - done < $NBD_CONFIG - fi + #killall ${NBD_BIN##*/} + $0 status >/dev/null 2>&1 + stat=$? + if test $stat = 3; then echo -n " (not running) "; + elif test $stat != 0; then echo -n " (dead) "; fi + killproc $NBD_BIN + # TODO: Only kill nbd-server processes started by config file. + # Remember status and be verbose rc_status -v ;; @@ -97,7 +78,7 @@ if test "$1" = "condrestart"; then echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" fi - $0 status + $0 status >/dev/null 2>&1 if test $? = 0; then $0 restart else @@ -123,45 +104,31 @@ echo -n "Reload service nbd-server " ## if it supports it: - /sbin/killproc -HUP $NBD_BIN + #/sbin/killproc -HUP $NBD_BIN #touch /var/run/nbd-server.pid - rc_status -v + #rc_status -v ## Otherwise: - #$0 try-restart - #rc_status + $0 try-restart + rc_status ;; reload) ## Like force-reload, but if daemon does not support ## signaling, do nothing (!) - - # If it supports signaling: - echo -n "Reload service nbd-server " - /sbin/killproc -HUP $NBD_BIN - #touch /var/run/nbd-server.pid - rc_status -v + #$0 force-reload + #rc_status ## Otherwise if it does not support reload: - #rc_failed 3 - #rc_status -v + echo -n "Reload service nbd-server " + rc_failed 3 + rc_status -v ;; status) echo -n "Checking for service nbd-server " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. + checkproc $NBD_BIN - # NOTE: checkproc returns LSB compliant status values. - while read port file options; do - if test -z "$port"; then continue; fi - if test "${port:0:1}" = "#"; then continue; fi - echo -n " $port" - if ! test -r /var/run/nbd-server.$port.pid; then rc_failed 3; echo -n ":DIS"; continue; fi - read PID </var/run/nbd-server.$port.pid - if ! test -e /proc/$PID/exe; then rc_failed 1; echo -n ":DEAD"; continue; fi - if ! cmp /proc/$PID/exe $NBD_BIN; then rc_failed 1; echo -n ":DEAD"; continue; fi - echo -n ":OK" - #rc_status - done < $NBD_CONFIG # NOTE: rc_status knows that we called this init script with # "status" option and adapts its messages accordingly. rc_status -v @@ -171,8 +138,8 @@ ## argument to this init script which is required for a reload. ## Note: probe is not (yet) part of LSB (as of 1.9) - #test $NBD_CONFIG -nt /var/run/nbd-server.pid && echo restart - rc_failed 3 + test $NBD29_CONFIG -nt /var/run/nbd-server.pid && echo restart + #rc_failed 3 ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" ++++++ nbd-2.9.5-doc.diff ++++++ diff -uNrp nbd-2.9.5.nowarn/README nbd-2.9.5.doc/README --- nbd-2.9.5.nowarn/README 2007-01-30 14:00:59.000000000 +0100 +++ nbd-2.9.5.doc/README 2007-07-30 17:08:31.328692000 +0200 @@ -12,14 +12,16 @@ deadlock issues if you do that[1]. To install the package, please see the INSTALL file. You'll need to install it on both the client and the server. -Using NBD is quite easy. First, on the client, you need to create the -device nodes: +Using NBD is quite easy. First, on the client, you need to load the nbd +kernel module; on modern systems, udev will create the needed device +nodes /dev/nbdX. +Otherwise, you can create them manually: # cd /dev -# ./MAKEDEV nb0 +# ./MAKEDEV nbd0 -(if you need more than one NBD device, repeat the above command for nb1, -nb2, ...) +(if you need more than one NBD device, repeat the above command for nbd1, +nbd2, ...) Next, start the server. You can use a file or a block device for that: @@ -39,7 +41,7 @@ nbd-client <hostname> <port> <nbd device e.g., -nbd-client 10.0.0.1 1234 /dev/nb0 +nbd-client 10.0.0.1 1234 /dev/nbd0 nbd-client must be ran as root; the same is not true for nbd-server (but do make sure that /var/run is writeable by the server that nbd-server ++++++ nbd-2.9.2.tar.bz2 -> nbd-2.9.5.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/aclocal.m4 new/nbd-2.9.5/aclocal.m4 --- old/nbd-2.9.2/aclocal.m4 2007-01-28 00:43:47.000000000 +0100 +++ new/nbd-2.9.5/aclocal.m4 2007-07-08 12:02:20.000000000 +0200 @@ -44,20 +44,13 @@ esac done - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + PKG_PROG_PKG_CONFIG([0.7]) no_glib="" - if test x$PKG_CONFIG != xno ; then - if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then - : - else - echo *** pkg-config too old; version 0.7 or better required. - no_glib=yes - PKG_CONFIG=no - fi - else + if test "x$PKG_CONFIG" = x ; then no_glib=yes + PKG_CONFIG=no fi min_glib_version=ifelse([$1], ,2.0.0,$1) @@ -227,6 +220,164 @@ rm -f conf.glibtest ]) +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/config.guess new/nbd-2.9.5/config.guess --- old/nbd-2.9.2/config.guess 2006-10-12 14:52:19.000000000 +0200 +++ new/nbd-2.9.5/config.guess 2007-04-20 04:09:10.000000000 +0200 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2006-07-02' +timestamp='2007-03-06' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -161,6 +161,7 @@ arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -780,7 +781,7 @@ i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - i*:MINGW*:*) + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) @@ -790,12 +791,15 @@ i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - x86:Interix*:[3456]*) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T:Interix*:[3456]*) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; @@ -950,6 +954,9 @@ x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -1208,6 +1215,15 @@ SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/config.h.in new/nbd-2.9.5/config.h.in --- old/nbd-2.9.2/config.h.in 2007-01-28 00:44:20.000000000 +0100 +++ new/nbd-2.9.5/config.h.in 2007-07-08 12:03:29.000000000 +0200 @@ -1,5 +1,9 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Define if you want a debugging version of nbd-server (lots of copious + output) */ +#undef DODBG + /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM @@ -106,6 +110,9 @@ /* Define to 1 if Large File Support should be enabled */ #undef NBD_LFS +/* Define if you don't want the nbd-server to fork() */ +#undef NOFORK + /* Name of package */ #undef PACKAGE diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/config.sub new/nbd-2.9.5/config.sub --- old/nbd-2.9.2/config.sub 2006-10-12 14:52:19.000000000 +0200 +++ new/nbd-2.9.5/config.sub 2007-04-20 04:09:10.000000000 +0200 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2006-09-20' +timestamp='2007-01-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -245,12 +245,12 @@ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore \ + | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -324,7 +324,7 @@ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ @@ -925,6 +925,9 @@ basic_machine=sh-hitachi os=-hms ;; + sh5el) + basic_machine=sh5le-unknown + ;; sh64) basic_machine=sh64-unknown ;; @@ -1219,7 +1222,7 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1414,6 +1417,9 @@ m68*-cisco) os=-aout ;; + mep-*) + os=-elf + ;; mips*-cisco) os=-elf ;; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/configure new/nbd-2.9.5/configure --- old/nbd-2.9.2/configure 2007-01-28 00:43:56.000000000 +0100 +++ new/nbd-2.9.5/configure 2007-07-08 12:02:36.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for nbd 2.9.2. +# Generated by GNU Autoconf 2.61 for nbd 2.9.5. # # Report bugs to <wouter@debian.org>. # @@ -574,8 +574,8 @@ # Identity of this package. PACKAGE_NAME='nbd' PACKAGE_TARNAME='nbd' -PACKAGE_VERSION='2.9.2' -PACKAGE_STRING='nbd 2.9.2' +PACKAGE_VERSION='2.9.5' +PACKAGE_STRING='nbd 2.9.5' PACKAGE_BUGREPORT='wouter@debian.org' # Factoring default headers for most tests. @@ -721,7 +721,8 @@ LDFLAGS LIBS CPPFLAGS -CPP' +CPP +PKG_CONFIG' # Initialize some variables set by options. @@ -1224,7 +1225,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures nbd 2.9.2 to adapt to many kinds of systems. +\`configure' configures nbd 2.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1294,7 +1295,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of nbd 2.9.2:";; + short | recursive ) echo "Configuration of nbd 2.9.5:";; esac cat <<\_ACEOF @@ -1305,6 +1306,7 @@ (and sometimes confusing) to the casual installer --disable-lfs Disable Large File Support (default on) --enable-syslog Enable Syslog logging + --enable-debug Build a debugging version of the server --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-glibtest do not try to compile and run a test GLIB program @@ -1318,6 +1320,7 @@ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor + PKG_CONFIG path to pkg-config utility Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1383,7 +1386,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -nbd configure 2.9.2 +nbd configure 2.9.5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1397,7 +1400,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by nbd $as_me 2.9.2, which was +It was created by nbd $as_me 2.9.5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2067,7 +2070,7 @@ # Define the identity of the package. PACKAGE='nbd' - VERSION='2.9.2' + VERSION='2.9.5' cat >>confdefs.h <<_ACEOF @@ -2285,6 +2288,7 @@ fi + { echo "$as_me:$LINENO: checking whether syslog logging is requested" >&5 echo $ECHO_N "checking whether syslog logging is requested... $ECHO_C" >&6; } if test $ISSERVER -eq 1; then @@ -2300,6 +2304,45 @@ echo "${ECHO_T}no" >&6; } fi +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then + enableval=$enable_debug; + if test "x$enableval" = "xyes"; then + DODBG=1 + else + DODBG=0 + fi + +else + DODBG=0 + +fi + +{ echo "$as_me:$LINENO: checking whether a debugging version is requested" >&5 +echo $ECHO_N "checking whether a debugging version is requested... $ECHO_C" >&6; } +if test $DODBG -eq 1; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + if test $ISSERVER -eq 1; then + { { echo "$as_me:$LINENO: error: You requested both syslog logging and a debugging version of the server. Bad idea!" >&5 +echo "$as_me: error: You requested both syslog logging and a debugging version of the server. Bad idea!" >&2;} + { (exit 1); exit 1; }; } + fi + +cat >>confdefs.h <<\_ACEOF +#define DODBG 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define NOFORK 1 +_ACEOF + +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7738,8 +7781,12 @@ esac done - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then @@ -7765,7 +7812,6 @@ done IFS=$as_save_IFS - test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi @@ -7779,19 +7825,88 @@ fi +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.7 + { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + PKG_CONFIG="" + fi + +fi no_glib="" - if test x$PKG_CONFIG != xno ; then - if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then - : - else - echo *** pkg-config too old; version 0.7 or better required. - no_glib=yes - PKG_CONFIG=no - fi - else + if test "x$PKG_CONFIG" = x ; then no_glib=yes + PKG_CONFIG=no fi min_glib_version=2.6.0 @@ -8661,7 +8776,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by nbd $as_me 2.9.2, which was +This file was extended by nbd $as_me 2.9.5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8714,7 +8829,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -nbd config.status 2.9.2 +nbd config.status 2.9.5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/configure.ac new/nbd-2.9.5/configure.ac --- old/nbd-2.9.2/configure.ac 2007-01-28 00:43:37.000000000 +0100 +++ new/nbd-2.9.5/configure.ac 2007-07-08 12:01:51.000000000 +0200 @@ -1,7 +1,7 @@ dnl Configure script for NBD system dnl (c) 1998 Martin Mares <mj@ucw.cz>, (c) 2000 Pavel Machek <pavel@ucw.cz>, dnl (c) 2003-2006 Wouter Verhelst <wouter@debian.org> -AC_INIT([nbd],[2.9.2],[wouter@debian.org]) +AC_INIT([nbd],[2.9.5],[wouter@debian.org]) AM_INIT_AUTOMAKE(foreign dist-bzip2) AM_MAINTAINER_MODE @@ -38,6 +38,7 @@ ], [ISSERVER=0] ) + AC_MSG_CHECKING([whether syslog logging is requested]) if test $ISSERVER -eq 1; then AC_DEFINE(ISSERVER,1, [Define to 1 if you want nbd-server to log through syslog]) @@ -46,6 +47,30 @@ AC_MSG_RESULT([no]) fi +AC_ARG_ENABLE( + debug, + AC_HELP_STRING(--enable-debug,Build a debugging version of the server), + [ + if test "x$enableval" = "xyes"; then + DODBG=1 + else + DODBG=0 + fi + ], + [DODBG=0] +) +AC_MSG_CHECKING([whether a debugging version is requested]) +if test $DODBG -eq 1; then + AC_MSG_RESULT([yes]) + if test $ISSERVER -eq 1; then + AC_MSG_ERROR([You requested both syslog logging and a debugging version of the server. Bad idea!]) + fi + AC_DEFINE(DODBG,1,[Define if you want a debugging version of nbd-server (lots of copious output)]) + AC_DEFINE(NOFORK,1,[Define if you don't want the nbd-server to fork()]) +else + AC_MSG_RESULT([no]) +fi + AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/INSTALL new/nbd-2.9.5/INSTALL --- old/nbd-2.9.2/INSTALL 2006-10-19 06:51:14.000000000 +0200 +++ new/nbd-2.9.5/INSTALL 2007-06-08 14:21:14.000000000 +0200 @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006 Free Software Foundation, Inc. +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -10,10 +10,7 @@ Basic Installation ================== -Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. +These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -26,9 +23,9 @@ It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is +the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale -cache files. +cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail @@ -38,17 +35,20 @@ may remove or edit it. The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. 2. Type `make' to compile the package. @@ -78,7 +78,7 @@ by setting variables in the command line or in the environment. Here is an example: - ./configure CC=c99 CFLAGS=-g LIBS=-lposix + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. @@ -87,15 +87,17 @@ You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. Installation Names ================== @@ -188,12 +190,12 @@ ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). +overridden in the site shell script). Here is a another example: -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: + /bin/bash ./configure CONFIG_SHELL=/bin/bash - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. `configure' Invocation ====================== diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/nbd-client.8 new/nbd-2.9.5/nbd-client.8 --- old/nbd-2.9.2/nbd-client.8 2006-10-19 13:42:48.000000000 +0200 +++ new/nbd-2.9.5/nbd-client.8 2007-01-30 14:02:52.000000000 +0100 @@ -3,7 +3,7 @@ .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng <steve@ggi-project.org>. -.TH "NBD-CLIENT" "8" "19 oktober 2006" "" "" +.TH "NBD-CLIENT" "8" "30 januari 2007" "" "" .SH NAME nbd-client \- connect to a server running nbd-server(1), to use its exported block device diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/nbd-client.c new/nbd-2.9.5/nbd-client.c --- old/nbd-2.9.2/nbd-client.c 2006-04-03 22:25:18.000000000 +0200 +++ new/nbd-2.9.5/nbd-client.c 2007-06-08 14:21:14.000000000 +0200 @@ -16,7 +16,6 @@ #include "config.h" #include "lfs.h" -#include <asm/page.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/types.h> diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/nbd-server.1.in new/nbd-2.9.5/nbd-server.1.in --- old/nbd-2.9.2/nbd-server.1.in 2006-10-24 20:47:15.000000000 +0200 +++ new/nbd-2.9.5/nbd-server.1.in 2007-06-15 11:28:13.000000000 +0200 @@ -3,13 +3,13 @@ .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng <steve@ggi-project.org>. -.TH "NBD-SERVER" "1" "24 oktober 2006" "" "" +.TH "NBD-SERVER" "1" "15 juni 2007" "" "" .SH NAME nbd-server \- serve a file as a block device to other computers running the GNU/Linux(tm) or GNU/Hurd Operating System .SH SYNOPSIS -\fBnbd-server \fR \fB\fIport\fB\fR \fB\fIfilename\fB\fR [ \fB\fIsize\fB\fR ] [ \fB-r\fR ] [ \fB-m\fR ] [ \fB-c\fR ] [ \fB-a \fItimeout\fB\fR ] [ \fB-l \fIhost list\fB\fR ] +\fBnbd-server \fR \fB\fIport\fB\fR \fB\fIfilename\fB\fR [ \fB\fIsize\fB\fR ] [ \fB-r\fR ] [ \fB-m\fR ] [ \fB-c\fR ] [ \fB-a \fItimeout\fB\fR ] [ \fB-l \fIhost list\fB\fR ] [ \fB-o \fIsection name\fB\fR ] .SH "DESCRIPTION" .PP @@ -114,6 +114,14 @@ current directory, unless nbd-server is compiled as a daemon, in which case it is looked for in the root-directory. +.TP +\fBsection name\fR +If the \fB-o\fR argument is given on the +command line, then nbd-server will output a configuration +file section with this as the header that is functionally +equivalent to the other options specified on the command line, +and exit. This is useful for migrating pre-2.9 nbd-server +initscript configuration files to the new format. .SH "EXAMPLES" .PP Some examples of nbd-server usage: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/nbd-server.1.sgml new/nbd-2.9.5/nbd-server.1.sgml --- old/nbd-2.9.2/nbd-server.1.sgml 2006-10-23 20:45:08.000000000 +0200 +++ new/nbd-2.9.5/nbd-server.1.sgml 2007-06-13 13:07:24.000000000 +0200 @@ -13,7 +13,7 @@ <!ENTITY dhfirstname "<firstname>Wouter</firstname>"> <!ENTITY dhsurname "<surname>Verhelst</surname>"> <!-- Please adjust the date whenever revising the manpage. --> - <!ENTITY dhdate "<date>$Date: 2006-10-23 20:45:02 +0200 (ma, 23 okt 2006) $</date>"> + <!ENTITY dhdate "<date>$Date: 2007-06-13 12:07:26 +0100 (wo, 13 jun 2007) $</date>"> <!-- SECTION should be 1-8, maybe w/ subsection other parameters are allowed: see man(7), man(1). --> <!ENTITY dhsection "<manvolnum>1</manvolnum>"> @@ -65,6 +65,7 @@ <arg><option>-c</option></arg> <arg><option>-a <replaceable>timeout</replaceable></option></arg> <arg><option>-l <replaceable>host list</replaceable></option></arg> + <arg><option>-o <replaceable>section name</replaceable></option></arg> </cmdsynopsis> </refsynopsisdiv> <refsect1> @@ -203,6 +204,17 @@ root-directory.</para> </listitem> </varlistentry> + <varlistentry> + <term><option>section name</option></term> + <listitem> + <para>If the <option>-o</option> argument is given on the + command line, then &dhpackage; will output a configuration + file section with this as the header that is functionally + equivalent to the other options specified on the command line, + and exit. This is useful for migrating pre-2.9 nbd-server + initscript configuration files to the new format.</para> + </listitem> + </varlistentry> </variablelist> </refsect1> diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/nbd-server.5.in new/nbd-2.9.5/nbd-server.5.in --- old/nbd-2.9.2/nbd-server.5.in 2006-10-25 14:42:38.000000000 +0200 +++ new/nbd-2.9.5/nbd-server.5.in 2007-01-30 14:02:51.000000000 +0100 @@ -3,7 +3,7 @@ .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng <steve@ggi-project.org>. -.TH "NBD-SERVER" "5" "25 oktober 2006" "" "" +.TH "NBD-SERVER" "5" "30 januari 2007" "" "" .SH NAME /etc/nbd-server/config \- configuration file for nbd-server diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nbd-2.9.2/nbd-server.c new/nbd-2.9.5/nbd-server.c --- old/nbd-2.9.2/nbd-server.c 2007-01-28 00:43:21.000000000 +0100 +++ new/nbd-2.9.5/nbd-server.c 2007-07-08 11:58:44.000000000 +0200 @@ -295,33 +295,12 @@ **/ inline void readit(int f, void *buf, size_t len) { ssize_t res; - gboolean tried = FALSE; - while (len > 0) { DEBUG("*"); - if ((res = read(f, buf, len)) <= 0) { - if(!tried && errno==EAGAIN) { - /* Assume the connection will work some time in - * the future, but don't run away with CPU time - * in case it doesn't */ - fd_set set; - struct timeval tv; - - DEBUG("Read failed, trying again"); - tried=TRUE; - FD_ZERO(&set); - FD_SET(f, &set); - tv.tv_sec=30; - tv.tv_usec=0; - select(f+1, &set, NULL, NULL, &tv); - } else { - err("Read failed: %m"); - } - } else { - len -= res; - buf += res; - tried=FALSE; - } + if ((res = read(f, buf, len)) <= 0) + err("Read failed: %m"); + len -= res; + buf += res; } } @@ -334,33 +313,12 @@ **/ inline void writeit(int f, void *buf, size_t len) { ssize_t res; - gboolean tried=FALSE; - while (len > 0) { DEBUG("+"); - if ((res = write(f, buf, len)) <= 0) { - if(!tried && errno==EAGAIN) { - /* Assume the connection will work some time in - * the future, but don't run away with CPU time - * in case it doesn't */ - fd_set set; - struct timeval tv; - - DEBUG("Write failed, trying again"); - tried=TRUE; - FD_ZERO(&set); - FD_SET(f, &set); - tv.tv_sec=30; - tv.tv_usec=0; - select(f+1, NULL, &set, NULL, &tv); - } else { - err("Send failed: %m"); - } - } else { - len -= res; - buf += res; - tried=FALSE; - } + if ((res = write(f, buf, len)) <= 0) + err("Send failed: %m"); + len -= res; + buf += res; } } @@ -370,20 +328,47 @@ */ void usage() { printf("This is nbd-server version " VERSION "\n"); - printf("Usage: port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-a timeout_sec] [-C configuration file] [-p PID file name]\n" + printf("Usage: port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-a timeout_sec] [-C configuration file] [-p PID file name] [-o section name]\n" "\t-r|--read-only\t\tread only\n" "\t-m|--multi-file\t\tmultiple file\n" "\t-c|--copy-on-write\tcopy on write\n" "\t-C|--config-file\tspecify an alternate configuration file\n" "\t-l|--authorize-file\tfile with list of hosts that are allowed to\n\t\t\t\tconnect.\n" "\t-a|--idle-time\t\tmaximum idle seconds; server terminates when\n\t\t\t\tidle time exceeded\n" - "\t-p|--pid-file\t\tspecify a filename to write our PID to\n\n" + "\t-p|--pid-file\t\tspecify a filename to write our PID to\n" + "\t-o|--output-config\toutput a config file section for what you\n\t\t\t\tspecified on the command line, with the\n\t\t\t\tspecified section name\n\n" "\tif port is set to 0, stdin is used (for running from inetd)\n" "\tif file_to_export contains '%%s', it is substituted with the IP\n" "\t\taddress of the machine trying to connect\n" ); printf("Using configuration file %s\n", CFILE); } +/* Dumps a config file section of the given SERVER*, and exits. */ +void dump_section(SERVER* serve, gchar* section_header) { + printf("[%s]\n", section_header); + printf("\texportname = %s\n", serve->exportname); + printf("\tport = %d\n", serve->port); + if(serve->flags & F_READONLY) { + printf("\treadonly = true\n"); + } + if(serve->flags & F_MULTIFILE) { + printf("\tmultifile = true\n"); + } + if(serve->flags & F_COPYONWRITE) { + printf("\tcopyonwrite = true\n"); + } + if(serve->expected_size) { + printf("\tfilesize = %Ld\n", (long long int)serve->expected_size); + } + if(serve->authname) { + printf("\tauthfile = %s\n", serve->authname); + } + if(serve->timeout) { + printf("\ttimeout = %d\n", serve->timeout); + } + exit(EXIT_SUCCESS); +} + /** * Parse the command line. * @@ -402,19 +387,22 @@ {"idle-time", required_argument, NULL, 'a'}, {"config-file", required_argument, NULL, 'C'}, {"pid-file", required_argument, NULL, 'p'}, + {"output-config", required_argument, NULL, 'o'}, {0,0,0,0} }; SERVER *serve; off_t es; size_t last; char suffix; + gboolean do_output=FALSE; + gchar* section_header; if(argc==1) { return NULL; } serve=g_new0(SERVER, 1); serve->authname = g_strdup(default_authname); - while((c=getopt_long(argc, argv, "-a:C:cl:mrp:", long_options, &i))>=0) { + while((c=getopt_long(argc, argv, "-a:C:cl:mo:rp:", long_options, &i))>=0) { switch (c) { case 1: /* non-option argument */ @@ -453,6 +441,10 @@ case 'm': serve->flags |= F_MULTIFILE; break; + case 'o': + do_output = TRUE; + section_header = g_strdup(optarg); + break; case 'p': strncpy(pidftemplate, optarg, 256); break; @@ -482,6 +474,13 @@ g_free(serve); serve=NULL; } + if(do_output) { + if(!serve) { + g_critical("Need a complete configuration on the command line to output a config file section!"); + exit(EXIT_FAILURE); + } + dump_section(serve, section_header); + } return serve; } @@ -680,7 +679,7 @@ pid_t pid; while((pid=waitpid(-1, &status, WNOHANG)) > 0) { - if(WIFEXITED(&status)) { + if(WIFEXITED(status)) { msg3(LOG_INFO, "Child exited with %d", WEXITSTATUS(status)); } i=g_hash_table_lookup(children, &pid); @@ -1299,10 +1298,10 @@ break; } - g_free(peername); msg4(LOG_INFO, "connect from %s, assigned file is %s", peername, client->exportname); client->clientname=g_strdup(peername); + g_free(peername); } /** @@ -1324,6 +1323,9 @@ void daemonize(SERVER* serve) { FILE*pidf; + if(!(serve->port)) { + return; + } if(daemon(0,0)<0) { err("daemon"); } @@ -1379,7 +1381,7 @@ err("fcntl F_GETFL"); } if (fcntl(serve->socket, F_SETFL, sock_flags | O_NONBLOCK) == -1) { - err("fcntl F_SETFL O_NONBLOCK on server socket"); + err("fcntl F_SETFL O_NONBLOCK"); } DEBUG("Waiting for connections... bind, "); @@ -1456,20 +1458,12 @@ for(i=0;i<servers->len;i++) { serve=&(g_array_index(servers, SERVER, i)); if(FD_ISSET(serve->socket, &rset)) { - int sock_flags; - if ((net=accept(serve->socket, (struct sockaddr *) &addrin, &addrinlen)) < 0) err("accept: %m"); client = g_malloc(sizeof(CLIENT)); client->server=serve; client->exportsize=OFFT_MAX; - if ((sock_flags = fcntl(serve->socket, F_GETFL, 0)) == -1) { - err("fcntl F_GETFL"); - } - if (fcntl(net, F_SETFL, sock_flags | O_NONBLOCK) == -1) { - err("fcntl F_SETFL O_NONBLOCK on client socket"); - } client->net=net; set_peername(net, client); if (!authorized_client(client)) { @@ -1553,31 +1547,28 @@ } if(serve) { g_array_append_val(servers, *serve); - } - -/* We don't support this at this time */ -#if 0 - if (!(serve->port)) { - CLIENT *client; + + if (!(serve->port)) { + CLIENT *client; #ifndef ISSERVER - /* You really should define ISSERVER if you're going to use - * inetd mode, but if you don't, closing stdout and stderr - * (which inetd had connected to the client socket) will let it - * work. */ - close(1); - close(2); - open("/dev/null", O_WRONLY); - open("/dev/null", O_WRONLY); -#endif - client=g_malloc(sizeof(CLIENT)); - client->server=serve; - client->net=0; - client->exportsize=OFFT_MAX; - set_peername(0,client); - serveconnection(client); - return 0; - } + /* You really should define ISSERVER if you're going to use + * inetd mode, but if you don't, closing stdout and stderr + * (which inetd had connected to the client socket) will let it + * work. */ + close(1); + close(2); + open("/dev/null", O_WRONLY); + open("/dev/null", O_WRONLY); #endif + client=g_malloc(sizeof(CLIENT)); + client->server=serve; + client->net=0; + client->exportsize=OFFT_MAX; + set_peername(0,client); + serveconnection(client); + return 0; + } + } if((!serve) && (!servers||!servers->len)) { g_message("Nothing to do! Bye!"); exit(EXIT_FAILURE); ++++++ nbd-2.9.5-warn.diff ++++++ diff -uNrp nbd-2.9.5/nbd-server.c nbd-2.9.5.nowarn/nbd-server.c --- nbd-2.9.5/nbd-server.c 2007-07-30 16:48:09.400856000 +0200 +++ nbd-2.9.5.nowarn/nbd-server.c 2007-07-30 17:00:30.179327000 +0200 @@ -395,7 +395,7 @@ SERVER* cmdline(int argc, char *argv[]) size_t last; char suffix; gboolean do_output=FALSE; - gchar* section_header; + gchar* section_header=NULL; if(argc==1) { return NULL; @@ -865,7 +865,7 @@ ssize_t rawexpwrite(off_t a, char *buf, * @return 0 on success, nonzero on failure **/ int rawexpwrite_fully(off_t a, char *buf, size_t len, CLIENT *client) { - ssize_t ret; + ssize_t ret = 0; while(len > 0 && (ret=rawexpwrite(a, buf, len, client)) > 0 ) { a += ret; @@ -907,7 +907,7 @@ ssize_t rawexpread(off_t a, char *buf, s * @return 0 on success, nonzero on failure **/ int rawexpread_fully(off_t a, char *buf, size_t len, CLIENT *client) { - ssize_t ret; + ssize_t ret = 0; while(len > 0 && (ret=rawexpread(a, buf, len, client)) > 0 ) { a += ret; @@ -1266,7 +1266,7 @@ void serveconnection(CLIENT *client) { void set_peername(int net, CLIENT *client) { struct sockaddr_in addrin; struct sockaddr_in netaddr; - size_t addrinlen = sizeof( addrin ); + socklen_t addrinlen = sizeof( addrin ); char *peername; char *netname; char *tmp; @@ -1486,7 +1486,7 @@ int serveloop(GArray* servers) { } /* child */ g_hash_table_destroy(children); - for(i=0;i<servers->len,serve=(g_array_index(servers, SERVER*, i));i++) { + for(i=0; (i<servers->len && (serve=(g_array_index(servers, SERVER*, i)))); i++) { close(serve->socket); } /* FALSE does not free the ++++++ nbd-server-daemonize-0.diff ++++++ diff -uNrp nbd-2.9.5.orig/nbd-server.c nbd-2.9.5/nbd-server.c --- nbd-2.9.5.orig/nbd-server.c 2007-07-08 11:58:44.000000000 +0200 +++ nbd-2.9.5/nbd-server.c 2007-07-30 16:48:09.400856000 +0200 @@ -1323,17 +1323,17 @@ void destroy_pid_t(gpointer data) { void daemonize(SERVER* serve) { FILE*pidf; - if(!(serve->port)) { - return; - } - if(daemon(0,0)<0) { + //if (!serve) { + // return; + //} + if(daemon(0,0) < 0) { err("daemon"); } if(!*pidftemplate) { if(serve) { - strncpy(pidftemplate, "/var/run/server.%d.pid", 255); + strncpy(pidftemplate, "/var/run/nbd-server.%d.pid", 255); } else { - strncpy(pidftemplate, "/var/run/server.pid", 255); + strncpy(pidftemplate, "/var/run/nbd-server.pid", 255); } } snprintf(pidfname, 255, pidftemplate, serve ? serve->port : 0); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de