Index: fedkit/federate.sh
===================================================================
--- fedkit/federate.sh	(revision a098fab24ba58f682570d580767a70b67b84c7db)
+++ fedkit/federate.sh	(revision 3c7da22d0920339582eff27ce48a16bb0d93af15)
@@ -37,5 +37,9 @@
 cp /tmp/hosts /etc/hosts && rm /tmp/hosts
 
-GATEWAY=`$EMUDIR/tmcc -b syncserver | awk ' { match($0, /SERVER=[^[:space:]]+/); print substr($0,RSTART+8,RLENGTH-9);}'`
+# Get our gateway, share, and mount user from the configuration file.
+# There's probably a way to get all three at once, but this works.
+GATEWAY=`perl -ne '/ControlGateway:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf`
+SHARE=`perl -ne '/SMBShare:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf`
+SMBUSER=`perl -ne '/ProjectUser:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf`
 
 #
@@ -81,3 +85,3 @@
 echo "Mounting via SMB."
 
-exec "/tmp/$SMBMOUNT"
+exec "/tmp/$SMBMOUNT" $SHARE $SMBUSER $GATEWAY
Index: fedkit/make_hosts
===================================================================
--- fedkit/make_hosts	(revision 3c7da22d0920339582eff27ce48a16bb0d93af15)
+++ fedkit/make_hosts	(revision 3c7da22d0920339582eff27ce48a16bb0d93af15)
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Very simple script to copy the global hosts file over the local one
+# while preserving the localhost entry.  Run on DETER master clients
+
+grep 127\\.0\\.0\\.1 /etc/hosts > /tmp/hosts
+cat $1 >> /tmp/hosts
+cp /tmp/hosts /etc/hosts && rm /tmp/hosts
Index: fedkit/smbmount.pl
===================================================================
--- fedkit/smbmount.pl	(revision a098fab24ba58f682570d580767a70b67b84c7db)
+++ fedkit/smbmount.pl	(revision 3c7da22d0920339582eff27ce48a16bb0d93af15)
@@ -3,7 +3,7 @@
 
 $TMCC="/usr/local/etc/emulab/tmcc";
-$SHARE="USERS";
-$PUSER="jhickey";
-$ADDR=`cat /usr/local/etc/emulab/bossnode`;
+$SHARE=shift || "USERS";
+$PUSER=shift || "jhickey";
+$ADDR=shift || `cat /usr/local/etc/emulab/bossnode`;
 
 chomp $ADDR;
Index: fedkit/splitter.pl
===================================================================
--- fedkit/splitter.pl	(revision a098fab24ba58f682570d580767a70b67b84c7db)
+++ fedkit/splitter.pl	(revision 3c7da22d0920339582eff27ce48a16bb0d93af15)
@@ -7,5 +7,5 @@
 use File::Copy;
 
-@scripts = ("federate.sh", "smbmount.pl");
+@scripts = ("federate.sh", "smbmount.pl", "make_hosts");
 $local_script_dir = ".";
 
@@ -233,4 +233,10 @@
 $tb_config = $opts{'testbeds'} || "./testbeds";	# testbed configurations
 $local_script_dir = $opts{'scriptdir'};	# Local scripts
+
+$smb_share = $opts{'smbshare'} ||	# Share to mount from the master
+    die "Must give an SMB share\n";
+$project_user = $opts{'smbuser'} ||	# User to mount project dirs as
+    die "Must give an SMB user\n";
+
 # For now specify these.  We may want to generate them later.
 $gw_pubkey = $opts{'gatewaypubkey'};
@@ -349,7 +355,18 @@
 	next;
     };
+    # End of the gateways section.  Output the client config for this testbed
     /^#\s+End\s+gateways\s+\((\w+)\)/ && do {
 	die "Mismatched gateway markers ($1, $gateways)\n" 
 	    unless !$gateways || $gateways == $1;
+
+	die "No control gateway for $gateways?" unless $control_gateway;
+	# Client config
+	$cc = new IO::File(">$tmpdir/$gateways/client.conf");
+	die "Can't open $tmpdir/$gateways/client.conf: $!\n" unless $cc;
+	print $cc "ControlGateway: $control_gateway\n";
+	print $cc "SMBShare: $smb_share\n";
+	print $cc "ProjectUser: $project_user\n";
+	$cc->close();
+	
 	$gateways = 0;
 	next;
@@ -389,4 +406,8 @@
 	else { $active_end{"$gateways-$dtb"}++; $active = "true"; }
 
+	# This is used to create the client configuration.
+	$control_gateway = "$myname$sdomain"
+	    if $type =~ /(control|both)/;
+
 	# Write out the file
 	open(GWCONFIG, ">$tmpdir/$gateways/$myname$sdomain.gw.conf") || 
@@ -585,4 +606,14 @@
 F</tmp> is used.
 
+=item SMBShare
+
+The SMB share on the master testbed that will be exported to remote clients.
+
+=item SMBUser
+
+The experiment user to mount project directories as.  This user needs to be a
+member of the exported experiment - that is one of the users in the project
+containing this experiment on the master testbed.
+
 =item Tclparse
 
