Index: Makefile
===================================================================
--- Makefile (nonexistent)
+++ Makefile (revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url = $(DOWNLOAD_SERVER)/sources/packages/n/netkit-bootparamd
+
+versions = 0.17
+pkgname = netkit-bootparamd
+suffix = tar.gz
+
+tarballs = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s = $(addsuffix .sha1sum, $(tarballs))
+
+patches = $(CURDIR)/patches/netkit-bootparamd-0.17.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+ @echo -e "\n======= Downloading source tarballs =======" ; \
+ for tarball in $(tarballs) ; do \
+ echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+ done ; wait
+
+$(sha1s): $(tarballs)
+ @for sha in $@ ; do \
+ echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+ echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+ touch $$sha ; \
+ echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+ sha1sum --check $$sha ; ret="$$?" ; \
+ if [ "$$ret" == "1" ]; then \
+ echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+ exit 1 ; \
+ fi ; \
+ done
+
+$(patches): $(sha1s)
+ @echo -e "\n======= Create Patches =======\n" ; \
+ ( cd create-0.17-patch ; ./create.patch.sh ) ; \
+ echo -e "\n"
+
+download_clean:
+ @rm -f $(tarballs) $(sha1s) $(patches)
Index: create-0.17-patch/create.patch.sh
===================================================================
--- create-0.17-patch/create.patch.sh (nonexistent)
+++ create-0.17-patch/create.patch.sh (revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=0.17
+
+tar --files-from=file.list -xzvf ../netkit-bootparamd-$VERSION.tar.gz
+mv netkit-bootparamd-$VERSION netkit-bootparamd-$VERSION-orig
+
+cp -rf ./netkit-bootparamd-$VERSION-new ./netkit-bootparamd-$VERSION
+
+diff --unified -Nr netkit-bootparamd-$VERSION-orig netkit-bootparamd-$VERSION > netkit-bootparamd-$VERSION.patch
+
+mv netkit-bootparamd-$VERSION.patch ../patches
+
+rm -rf ./netkit-bootparamd-$VERSION
+rm -rf ./netkit-bootparamd-$VERSION-orig
Property changes on: create-0.17-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: create-0.17-patch/file.list
===================================================================
--- create-0.17-patch/file.list (nonexistent)
+++ create-0.17-patch/file.list (revision 5)
@@ -0,0 +1,6 @@
+netkit-bootparamd-0.17/configure
+netkit-bootparamd-0.17/rpc.bootparamd/Makefile
+netkit-bootparamd-0.17/rpc.bootparamd/bootparam_prot.x.real
+netkit-bootparamd-0.17/rpc.bootparamd/bootparamd.8
+netkit-bootparamd-0.17/rpc.bootparamd/callbootd.c
+netkit-bootparamd-0.17/rpc.bootparamd/main.c
Index: create-0.17-patch/netkit-bootparamd-0.17-new/configure
===================================================================
--- create-0.17-patch/netkit-bootparamd-0.17-new/configure (nonexistent)
+++ create-0.17-patch/netkit-bootparamd-0.17-new/configure (revision 5)
@@ -0,0 +1,304 @@
+#!/bin/sh
+#
+# This file was generated by confgen version 2.
+# Do not edit.
+#
+
+PREFIX='/usr'
+#EXECPREFIX='$PREFIX'
+INSTALLROOT=''
+BINMODE='755'
+#DAEMONMODE='$BINMODE'
+MANMODE='644'
+
+while [ x$1 != x ]; do case $1 in
+
+ --help)
+ cat <<EOF
+Usage: configure [options]
+ --help Show this message
+ --with-debug Enable debugging
+ --prefix=path Prefix for location of files [/usr]
+ --exec-prefix=path Location for arch-depedent files [prefix]
+ --installroot=root Top of filesystem tree to install in [/]
+ --binmode=mode Mode for binaries [755]
+ --daemonmode=mode Mode for daemon binaries [same as binmode]
+ --manmode=mode Mode for manual pages [644]
+ --with-c-compiler=cc Program for compiling C source [guessed]
+EOF
+ exit 0;;
+ --verbose) ;;
+ --quiet) ;;
+
+ --subdir) . ../configure.defs;;
+
+ --with-debug|--debug) DEBUG=1;;
+ --prefix=*) PREFIX=`echo $1 | sed 's/^[^=]*=//'` ;;
+ --exec-prefix=*) EXECPREFIX=`echo $1 | sed 's/^[^=]*=//'` ;;
+ --installroot=*) INSTALLROOT=`echo $1 | sed 's/^[^=]*=//'` ;;
+ --binmode=*) BINMODE=`echo $1 | sed 's/^[^=]*=//'` ;;
+ --daemonmode=*) DAEMONMODE=`echo $1 | sed 's/^[^=]*=//'` ;;
+ --manmode=*) MANMODE=`echo $1 | sed 's/^[^=]*=//'` ;;
+ --with-c-compiler=*) CC=`echo $1 | sed 's/^[^=]*=//'` ;;
+ *) echo "Unrecognized option: $1"; exit 1;;
+esac
+shift
+done
+
+if [ x$EXECPREFIX = x ]; then
+ EXECPREFIX="$PREFIX"
+fi
+
+if [ x$DAEMONMODE = x ]; then
+ DAEMONMODE="$BINMODE"
+fi
+
+BINDIR="$EXECPREFIX/bin"
+SBINDIR="$EXECPREFIX/sbin"
+MANDIR="$PREFIX/share/man"
+
+echo "Directories: $BINDIR $SBINDIR $MANDIR "
+
+if [ x$INSTALLROOT != x ]; then
+ echo "Installing in chroot tree rooted at $INSTALLROOT"
+fi
+
+##################################################
+
+WARNINGS='-Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline '
+
+cat << EOF > __conftest.c
+ int main() { int class=0; return class; }
+EOF
+
+if [ x"$CC" = x ]; then
+ echo -n 'Looking for a C compiler... '
+ for TRY in egcs gcc g++ CC c++ cc; do
+ (
+ $TRY __conftest.c -o __conftest || exit 1;
+# ./__conftest || exit 1;
+ ) >/dev/null 2>&1 || continue;
+ CC=$TRY
+ break;
+ done
+ if [ x"$CC" = x ]; then
+ echo 'failed.'
+ echo 'Cannot find a C compiler. Run configure with --with-c-compiler.'
+ rm -f __conftest*
+ exit
+ fi
+ echo "$CC"
+else
+ echo -n 'Checking if C compiler works... '
+ if (
+ $CC __conftest.c -o __conftest || exit 1
+# ./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo 'yes'
+ else
+ echo 'no'
+ echo 'Compiler '"$CC"' does not exist or cannot compile C; try another.'
+ rm -f __conftest*
+ exit
+ fi
+fi
+
+echo -n "Checking if $CC accepts gcc warnings... "
+if (
+ $CC $WARNINGS __conftest.c -o __conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo 'yes'
+ CC_WARNINGS=1
+else
+ echo 'no'
+fi
+
+if [ x$DEBUG = x ]; then
+ echo -n "Checking if $CC accepts -O2... "
+ if (
+ $CC -O2 __conftest.c -o __conftest
+ ) >/dev/null 2>&1; then
+ echo 'yes'
+ CFLAGS="$CFLAGS -O2"
+ else
+ echo 'no'
+ echo -n "Checking if $CC accepts -O... "
+ if (
+ $CC -O __conftest.c -o __conftest
+ ) >/dev/null 2>&1; then
+ echo 'yes'
+ CFLAGS="$CFLAGS -O"
+ else
+ echo 'no'
+ fi
+ fi
+
+else
+ echo -n "Checking if $CC accepts -g... "
+ if (
+ $CC -g __conftest.c -o __conftest
+ ) >/dev/null 2>&1; then
+ echo 'yes'
+ CFLAGS="$CFLAGS -g"
+ else
+ echo 'no'
+ fi
+
+fi
+
+LDFLAGS=$LDFLAGS
+LIBS=$LIBS
+
+rm -f __conftest*
+
+##################################################
+
+echo -n 'Checking for BSD signal semantics... '
+cat <<EOF >__conftest.c
+#include <unistd.h>
+#include <signal.h>
+int count=0;
+void handle(int foo) { count++; }
+int main() {
+ int pid=getpid();
+ signal(SIGINT, handle);
+ kill(pid,SIGINT);
+ kill(pid,SIGINT);
+ kill(pid,SIGINT);
+ if (count!=3) return 1;
+ return 0;
+}
+
+EOF
+if (
+ $CC $CFLAGS __conftest.c -o __conftest || exit 1
+# ./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo 'yes'
+else
+ if (
+ $CC $CFLAGS -D__USE_BSD_SIGNAL __conftest.c -o __conftest || exit 1
+# ./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo '-D__USE_BSD_SIGNAL'
+ CFLAGS="$CFLAGS -D__USE_BSD_SIGNAL"
+ else
+ echo 'no'
+ echo 'This package needs BSD signal semantics to run.'
+ rm -f __conftest*
+ exit
+ fi
+fi
+rm -f __conftest*
+
+##################################################
+
+echo -n 'Checking for snprintf declaration... '
+cat <<EOF >__conftest.c
+#include <stdio.h>
+int main() {
+ void *x = (void *)snprintf;
+ printf("%lx", (long)x);
+ return 0;
+}
+
+EOF
+if (
+ $CC $CFLAGS __conftest.c -o __conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo 'ok'
+else
+ if (
+ $CC $CFLAGS -D_GNU_SOURCE __conftest.c -o __conftest || exit 1
+# ./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo '-D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -D_GNU_SOURCE"
+ else
+ echo 'manual'
+ CFLAGS="$CFLAGS -DDECLARE_SNPRINTF"
+ fi
+fi
+rm -f __conftest*
+
+echo -n 'Checking for snprintf implementation... '
+cat <<EOF >__conftest.c
+#include <stdio.h>
+#include <string.h>
+#ifdef DECLARE_SNPRINTF
+#ifdef __cplusplus
+extern "C"
+#endif /*__cplusplus*/
+int snprintf(char *, int, const char *, ...);
+#endif /*DECLARE_SNPRINTF*/
+int main() {
+ char buf[32];
+ snprintf(buf, 8, "%s", "1234567890");
+ if (strlen(buf)!=7) return 1;
+ return 0;
+}
+
+EOF
+if (
+ $CC $CFLAGS __conftest.c $LIBBSD -o __conftest || exit 1
+# ./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo 'ok'
+else
+ if (
+ $CC $CFLAGS __conftest.c -lsnprintf $LIBBSD -o __conftest || exit 1
+# ./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo '-lsnprintf'
+ LIBS="$LIBS -lsnprintf"
+ else
+ if (
+ $CC $CFLAGS __conftest.c -ldb $LIBBSD -o __conftest || exit 1
+# ./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo '-ldb'
+ LIBS="$LIBS -ldb"
+ else
+ echo 'missing'
+ echo 'This package requires snprintf.'
+ rm -f __conftest*
+ exit
+ fi
+ fi
+fi
+rm -f __conftest*
+
+##################################################
+
+## libbsd should go last in case it's broken
+if [ "x$LIBBSD" != x ]; then
+ LIBS="$LIBS $LIBBSD"
+fi
+
+echo 'Generating MCONFIG...'
+(
+ echo -n '# Generated by configure (confgen version 2) on '
+ date
+ echo '#'
+ echo
+
+ echo "BINDIR=$BINDIR"
+ echo "SBINDIR=$SBINDIR"
+ echo "MANDIR=$MANDIR"
+ echo "BINMODE=$BINMODE"
+ echo "DAEMONMODE=$DAEMONMODE"
+ echo "MANMODE=$MANMODE"
+ echo "PREFIX=$PREFIX"
+ echo "EXECPREFIX=$EXECPREFIX"
+ echo "INSTALLROOT=$INSTALLROOT"
+ echo "CC=$CC"
+ if [ x$CC_WARNINGS != x ]; then
+ CFLAGS="$CFLAGS $WARNINGS"
+ fi
+
+ echo "CFLAGS=$CFLAGS" | sed 's/= */=/'
+ echo "LDFLAGS=$LDFLAGS" | sed 's/= */=/'
+ echo "LIBS=$LIBS" | sed 's/= */=/'
+
+) > MCONFIG
+
Property changes on: create-0.17-patch/netkit-bootparamd-0.17-new/configure
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/Makefile
===================================================================
--- create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/Makefile (nonexistent)
+++ create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/Makefile (revision 5)
@@ -0,0 +1,58 @@
+all: bootparamd
+include ../MCONFIG
+include ../MRULES
+
+#
+# use BUILD machine rpcgen
+#
+RPCGEN=/usr/bin/rpcgen
+
+# Warning, do NOT put this in the current directory under its own
+# name without updating things and particularly the clean target.
+#BOOTPARAMX = /usr/include/rpcsvc/bootparam_prot.x
+# Actually the one that comes with linux libc appears to be broken
+BOOTPARAMX = bootparam_prot.x.real
+
+HEADER=bootparam_prot.h
+DIST=README main.c rpc.bootparamd.c callbootd.c bootparamd.8 Makefile
+
+all: bootparamd callbootd
+
+bootparamd: bootparam_prot_svc.o bootparam_prot_xdr.o rpc.bootparamd.o main.o
+ $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
+
+callbootd: callbootd.o bootparam_prot_clnt.o bootparam_prot_xdr.o
+ $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
+
+install: bootparamd callbootd
+ install -s -m $(DAEMONMODE) bootparamd \
+ $(INSTALLROOT)$(SBINDIR)/rpc.bootparamd
+ install -s -m $(BINMODE) callbootd $(INSTALLROOT)$(BINDIR)/callbootd
+ install -m $(MANMODE) bootparamd.8 \
+ $(INSTALLROOT)$(MANDIR)/man8/rpc.bootparamd.8
+ ln -sf rpc.bootparamd.8 $(INSTALLROOT)$(MANDIR)/man8/bootparamd.8
+
+clean:
+ rm -f *.o bootparamd callbootd
+ rm -f bootparam_prot.h bootparam_prot_svc.c
+ rm -f bootparam_prot_xdr.c bootparam_prot_clnt.c
+ rm -f bootparam_prot.x
+
+bootparam_prot_clnt.o bootparam_prot_xdr.o: bootparam_prot.h
+bootparam_prot_svc.o: bootparam_prot.h
+callbootd.o rpc.bootparamd.o main.o: bootparam_prot.h ../version.h
+
+bootparam_prot.x: $(BOOTPARAMX)
+ ln -s $(BOOTPARAMX) bootparam_prot.x
+
+bootparam_prot.h: bootparam_prot.x
+ $(RPCGEN) -h $< -o $@
+
+bootparam_prot_xdr.c: bootparam_prot.x
+ $(RPCGEN) -c $< -o $@
+
+bootparam_prot_clnt.c: bootparam_prot.x
+ $(RPCGEN) -l $< -o $@
+
+bootparam_prot_svc.c: bootparam_prot.x
+ $(RPCGEN) -m $< -o $@
Index: create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/bootparam_prot.x.real
===================================================================
--- create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/bootparam_prot.x.real (nonexistent)
+++ create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/bootparam_prot.x.real (revision 5)
@@ -0,0 +1,100 @@
+/* @(#)bootparam_prot.x 2.1 88/08/01 4.0 RPCSRC */
+/* @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro */
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * RPC for bootparms service.
+ * There are two procedures:
+ * WHOAMI takes a net address and returns a client name and also a
+ * likely net address for routing
+ * GETFILE takes a client name and file identifier and returns the
+ * server name, server net address and pathname for the file.
+ * file identifiers typically include root, swap, pub and dump
+ */
+
+#ifdef RPC_HDR
+%#include <rpc/types.h>
+%#include <sys/time.h>
+%#include <sys/errno.h>
+%#include <nfs/nfs.h>
+%
+%void bootparamprog_1(struct svc_req *, register SVCXPRT *);
+%
+#endif
+
+const MAX_MACHINE_NAME = 255;
+const MAX_PATH_LEN = 1024;
+const MAX_FILEID = 32;
+const IP_ADDR_TYPE = 1;
+
+typedef string bp_machine_name_t<MAX_MACHINE_NAME>;
+typedef string bp_path_t<MAX_PATH_LEN>;
+typedef string bp_fileid_t<MAX_FILEID>;
+
+struct ip_addr_t {
+ char net;
+ char host;
+ char lh;
+ char impno;
+};
+
+union bp_address switch (int address_type) {
+ case IP_ADDR_TYPE:
+ ip_addr_t ip_addr;
+};
+
+struct bp_whoami_arg {
+ bp_address client_address;
+};
+
+struct bp_whoami_res {
+ bp_machine_name_t client_name;
+ bp_machine_name_t domain_name;
+ bp_address router_address;
+};
+
+struct bp_getfile_arg {
+ bp_machine_name_t client_name;
+ bp_fileid_t file_id;
+};
+
+struct bp_getfile_res {
+ bp_machine_name_t server_name;
+ bp_address server_address;
+ bp_path_t server_path;
+};
+
+program BOOTPARAMPROG {
+ version BOOTPARAMVERS {
+ bp_whoami_res BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
+ bp_getfile_res BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
+ } = 1;
+} = 100026;
Index: create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/bootparamd.8
===================================================================
--- create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/bootparamd.8 (nonexistent)
+++ create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/bootparamd.8 (revision 5)
@@ -0,0 +1,48 @@
+.\" @(#)bootparamd.8
+.\"
+.\" $Id: bootparamd.8,v 1.13 2000/07/30 23:56:59 dholland Exp $
+.\"
+.Dd November 8, 1989
+.Dt BOOTPARAMD 8
+.Os "Linux NetKit (0.17)"
+.Sh NAME
+.Nm bootparamd
+.Nd boot parameter server
+.Sh SYNOPSIS
+.Nm rpc.bootparamd
+.Op Fl d
+.Op Fl s
+.Op Fl r Ar router
+.Op Fl f Ar file
+.Sh DESCRIPTION
+.Nm bootparamd
+is a server process that provides information to diskless clients
+necessary for booting. It consults the
+.Pa /etc/bootparams
+file to find the information it needs.
+.Pp
+This version will allow the use of aliases on the hostname in the
+.Pa /etc/bootparams
+file. The returned hostname to the whoami request done by the booting client
+will be the name that appears in
+.Pa /etc/bootparams
+and not the canonical name. In this way you can keep the answer short enough
+so that machines that cannot handle long hostnames won't fail during boot.
+.Sh OPTIONS
+.Bl -tag -width indent
+.It Fl d
+Display debugging information.
+.It Fl s
+Log the debugging information to syslog.
+.It Fl r Ar router
+The default router (a machine or an IP-address).
+This defaults to the machine running the server.
+.It Fl f Ar file
+The file to use as boot parameter file instead of /etc/bootparams.
+.El
+.Sh FILES
+.Pa /etc/bootparams
+.Sh BUGS
+You may find the syslog loggings too verbose.
+.Sh AUTHOR
+Written by Klas Heggemann <klas@nada.kth.se>
Index: create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/callbootd.c
===================================================================
--- create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/callbootd.c (nonexistent)
+++ create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/callbootd.c (revision 5)
@@ -0,0 +1,182 @@
+#include <rpc/rpc.h>
+#include <rpc/pmap_clnt.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <netdb.h>
+#include "bootparam_prot.h"
+
+/* #define bp_address_u bp_address */
+#include <stdio.h>
+
+#include "../version.h"
+const char callbootd_rcsid[] =
+ "$Id: callbootd.c,v 1.5 1997/09/23 08:39:26 dholland Exp $";
+
+static int printgetfile(bp_getfile_res *res);
+static int printwhoami(bp_whoami_res *res);
+
+int broadcast;
+
+char cln[MAX_MACHINE_NAME+1];
+char dmn[MAX_MACHINE_NAME+1];
+char path[MAX_PATH_LEN+1];
+
+static int
+eachres_whoami(bp_whoami_res *resultp, struct sockaddr_in *raddr)
+{
+ struct hostent *he;
+
+ he = gethostbyaddr((char*)&raddr->sin_addr.s_addr,4,AF_INET);
+ printf("%s answered:\n", he ? he->h_name : inet_ntoa(raddr->sin_addr));
+ printwhoami(resultp);
+ printf("\n");
+ return 0;
+}
+
+static int
+eachres_getfile(bp_getfile_res *resultp, struct sockaddr_in *raddr)
+{
+ struct hostent *he;
+
+ he = gethostbyaddr((char*)&raddr->sin_addr.s_addr,4,AF_INET);
+ printf("%s answered:\n", he ? he->h_name : inet_ntoa(raddr->sin_addr));
+ printgetfile(resultp);
+ printf("\n");
+ return 0;
+}
+
+int
+main(int argc, char **argv)
+{
+ char *server;
+
+ bp_whoami_arg whoami_arg;
+ bp_whoami_res *whoami_res, stat_whoami_res;
+ bp_getfile_arg getfile_arg;
+ bp_getfile_res *getfile_res, stat_getfile_res;
+
+
+ struct in_addr the_inet_addr;
+ CLIENT *clnt = NULL;
+
+ stat_whoami_res.client_name = cln;
+ stat_whoami_res.domain_name = dmn;
+
+ stat_getfile_res.server_name = cln;
+ stat_getfile_res.server_path = path;
+
+ if (argc < 3) {
+ fprintf(stderr,
+ "Usage: %s server procnum (IP-addr | host fileid)\n", argv[0]);
+ exit(1);
+ }
+
+
+ server = argv[1];
+ if (!strcmp(server , "all") ) broadcast = 1;
+
+ if (!broadcast) {
+ clnt = clnt_create(server,BOOTPARAMPROG, BOOTPARAMVERS, "udp");
+ }
+
+ switch (argc) {
+ case 3:
+ whoami_arg.client_address.address_type = IP_ADDR_TYPE;
+ if (!inet_aton(argv[2], &the_inet_addr)) {
+ fprintf(stderr, "bogus addr %s\n", argv[2]);
+ exit(1);
+ }
+ memcpy(&whoami_arg.client_address.bp_address_u.ip_addr,
+ &the_inet_addr, 4);
+ if (!broadcast) {
+ whoami_res = bootparamproc_whoami_1(&whoami_arg, clnt);
+ printf("Whoami returning:\n");
+ if (printwhoami(whoami_res)) {
+ fprintf(stderr, "Bad answer returned from server %s\n",
+ server);
+ exit(1);
+ }
+ else exit(0);
+ }
+ else {
+ (void)clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
+ BOOTPARAMPROC_WHOAMI,
+ (xdrproc_t) xdr_bp_whoami_arg,
+ (void *) &whoami_arg,
+ (xdrproc_t) xdr_bp_whoami_res,
+ (void *) &stat_whoami_res,
+ (resultproc_t) eachres_whoami);
+ exit(0);
+ }
+
+ case 4:
+
+ getfile_arg.client_name = argv[2];
+ getfile_arg.file_id = argv[3];
+
+ if (!broadcast) {
+ getfile_res = bootparamproc_getfile_1(&getfile_arg,clnt);
+ printf("getfile returning:\n");
+ if (printgetfile(getfile_res)) {
+ fprintf(stderr, "Bad answer returned from server %s\n",
+ server);
+ exit(1);
+ }
+ else exit(0);
+ }
+ else {
+ (void)clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
+ BOOTPARAMPROC_GETFILE,
+ (xdrproc_t) xdr_bp_getfile_arg,
+ (void *) &getfile_arg,
+ (xdrproc_t) xdr_bp_getfile_res,
+ (void *) &stat_getfile_res,
+ (resultproc_t) eachres_getfile);
+ exit(0);
+ }
+
+ default:
+ fprintf(stderr, "Usage: %s server procnum (IP-addr | host fileid)\n",
+ argv[0]);
+ exit(1);
+ }
+}
+
+
+int printwhoami(bp_whoami_res *res)
+{
+ if (res) {
+ printf("client_name:\t%s\ndomain_name:\t%s\n",
+ res->client_name, res->domain_name);
+ printf("router:\t%d.%d.%d.%d\n",
+ 255 & res->router_address.bp_address_u.ip_addr.net,
+ 255 & res->router_address.bp_address_u.ip_addr.host,
+ 255 & res->router_address.bp_address_u.ip_addr.lh,
+ 255 & res->router_address.bp_address_u.ip_addr.impno);
+ return 0;
+ }
+ else {
+ fprintf(stderr,"Null answer!!!\n");
+ return 1;
+ }
+}
+
+static int
+printgetfile(bp_getfile_res *res)
+{
+ if (res) {
+ struct in_addr sia;
+ memcpy(&sia, &res->server_address.bp_address_u.ip_addr, 4);
+ printf("server_name:\t%s\nserver_address:\t%s\npath:\t%s\n",
+ res->server_name,
+ inet_ntoa(sia),
+ res->server_path);
+ return 0;
+ }
+ else {
+ fprintf(stderr,"Null answer!!!\n");
+ return(1);
+ }
+}
Index: create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/main.c
===================================================================
--- create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/main.c (nonexistent)
+++ create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd/main.c (revision 5)
@@ -0,0 +1,139 @@
+#include <stdio.h>
+#include <string.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <rpc/rpc.h>
+#include <rpc/pmap_clnt.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <ctype.h>
+#include <getopt.h>
+#include <unistd.h>
+#include "bootparam_prot.h"
+
+
+#ifdef __GLIBC__
+ /* quick fix */
+ extern int get_myaddress(struct sockaddr_in *);
+#endif
+
+int debug = 0;
+int dolog = 0;
+struct in_addr route_addr;
+const char *bootpfile = "/etc/bootparams";
+
+static char *progname;
+static struct sockaddr_in my_addr;
+static int route_addr_ok;
+
+int
+main(int argc, char **argv)
+{
+ SVCXPRT *transp;
+ int s, pid;
+ struct hostent *he;
+ struct stat buf;
+ int c;
+
+ progname = rindex(argv[0],'/');
+ if (progname) progname++;
+ else progname = argv[0];
+
+ while ((c = getopt(argc, argv,"dsr:f:")) != EOF) {
+ switch (c) {
+ case 'd':
+ debug = 1;
+ break;
+ case 'r':
+ if (isdigit(*optarg)) {
+ route_addr_ok = inet_aton(optarg, &route_addr);
+ break;
+ }
+ else {
+ he = gethostbyname(optarg);
+ if (he) {
+ memcpy(&route_addr, he->h_addr, sizeof(route_addr));
+ route_addr_ok = 1;
+ break;
+ }
+ else {
+ fprintf(stderr,"%s: No such host %s\n", progname, optarg);
+ exit(1);
+ }
+ }
+ case 'f':
+ bootpfile = optarg;
+ break;
+ case 's':
+ dolog = 1;
+#ifndef LOG_DAEMON
+ openlog(progname, 0 , 0);
+#else
+ openlog(progname, 0 , LOG_DAEMON);
+ setlogmask(LOG_UPTO(LOG_NOTICE));
+#endif
+ break;
+ default:
+ fprintf(stderr,
+ "Usage: %s [-d] [-s] [-r router] [-f bootparmsfile]\n",
+ argv[0]);
+ exit(1);
+ }
+ }
+
+ if (stat(bootpfile, &buf)) {
+ fprintf(stderr,"%s: ", progname);
+ perror(bootpfile);
+ exit(1);
+ }
+
+
+ if (!route_addr_ok) {
+ get_myaddress(&my_addr);
+ memcpy(&route_addr, &my_addr.sin_addr.s_addr, sizeof(route_addr));
+ }
+
+ if (!debug) {
+ pid = fork();
+ if (pid < 0) {
+ perror("bootparamd: fork");
+ exit(1);
+ }
+ if (pid) exit(0); /* parent */
+
+ /* child */
+ for (s=0; s<20; s++) close(s);
+ open("/", 0);
+ dup2(0, 1);
+ dup2(0, 2);
+ s = open("/dev/tty",2);
+ if ( s >= 0 ) {
+ ioctl(s, TIOCNOTTY, 0);
+ close(s);
+ }
+ }
+
+
+ (void)pmap_unset(BOOTPARAMPROG, BOOTPARAMVERS);
+
+ transp = svcudp_create(RPC_ANYSOCK);
+ if (transp == NULL) {
+ (void)fprintf(stderr, "cannot create udp service.\n");
+ exit(1);
+ }
+ if (!svc_register(transp, BOOTPARAMPROG, BOOTPARAMVERS,
+ bootparamprog_1, IPPROTO_UDP))
+ {
+ fprintf(stderr,
+ "unable to register (BOOTPARAMPROG, BOOTPARAMVERS, udp).\n");
+ exit(1);
+ }
+
+ svc_run();
+ (void)fprintf(stderr, "svc_run returned\n");
+ exit(1);
+}
Index: create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd
===================================================================
--- create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd (nonexistent)
+++ create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd (revision 5)
Property changes on: create-0.17-patch/netkit-bootparamd-0.17-new/rpc.bootparamd
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: create-0.17-patch/netkit-bootparamd-0.17-new
===================================================================
--- create-0.17-patch/netkit-bootparamd-0.17-new (nonexistent)
+++ create-0.17-patch/netkit-bootparamd-0.17-new (revision 5)
Property changes on: create-0.17-patch/netkit-bootparamd-0.17-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: create-0.17-patch
===================================================================
--- create-0.17-patch (nonexistent)
+++ create-0.17-patch (revision 5)
Property changes on: create-0.17-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: patches/README
===================================================================
--- patches/README (nonexistent)
+++ patches/README (revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+ TODO: Leave some comment here.
+
+ * end */
Index: patches
===================================================================
--- patches (nonexistent)
+++ patches (revision 5)
Property changes on: patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: .
===================================================================
--- . (nonexistent)
+++ . (revision 5)
Property changes on: .
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~