Commit 47bedb24 authored by Kirk Webb's avatar Kirk Webb

More updates for win7

Remove hack from setnode script.  Rename rc script for windows7 fix up
liblocsetup for win7 specific things (comment out some more contortions,
fix some command line parameters to netsh and ipconfig.
parent 267c7550
#
2#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
......@@ -6,7 +6,7 @@
#
# XXX ONLY RUN THIS INSTALL ON A CYGWIN / WINDOWS XP NODE!
# Similar to linux9, cygwinxp is an overlay on linux, which is an overlay
# Similar to linux9, cygwinseven is an overlay on linux, which is an overlay
# on common.
#
# Trivial. These things just need to be installed into the right place
......@@ -95,7 +95,7 @@ script-install: dir-install $(SCRIPTS)
# Everybody is in the Administrators group already, so sudo is irrelevant.
$(INSTALL) -m 755 $(SRCDIR)/sudo.dummy /bin/sudo
$(INSTALL) -m 755 $(SRCDIR)/rc.firstboot $(BINDIR)/rc/rc.firstboot
$(INSTALL) -m 755 $(SRCDIR)/rc.cygwinxp $(BINDIR)/rc/rc.cygwin
$(INSTALL) -m 755 $(SRCDIR)/rc.cygwinseven $(BINDIR)/rc/rc.cygwin
#$(INSTALL) -m 755 $(SRCDIR)/clean_logonui $(BINDIR)/clean_logonui
$(INSTALL) -m 755 $(SRCDIR)/rc.reboot $(BINDIR)/rc/rc.reboot
$(INSTALL) -m 755 $(SRCDIR)/rc.lmhosts $(BINDIR)/rc/rc.lmhosts
......
......@@ -83,8 +83,8 @@ $HOSTSFILE = "$NTE/hosts";
# These are not exported
#
my $ADDUSERS = "$BINDIR/addusers.exe";
my $DEVCON = "$BINDIR/devcon.exe";
my $IFCONFIGBIN = "$NETSH interface ip set address";
my $DEVCON = "$NTS/devcon.exe";
my $IFCONFIGBIN = "$NETSH interface ipv4 set address";
my $IFCONFIG = "$IFCONFIGBIN name=\"%s\" source=static addr=%s mask=%s";
my $IFC_1000MBS = "1000baseTx";
my $IFC_100MBS = "100baseTx";
......@@ -328,34 +328,37 @@ sub os_ifconfig_line($$$$$$$;$$%)
#
# Configure.
$uplines .= sprintf($IFCONFIG, $iface, $inet, $mask) . qq{\n };
# XXX: Going to assume for now that jumping through these hoops isn't necessary
# under Win7.
#
# Check that the configuration took!
my $showip = qq[$NETSH interface ip show address name="$iface"];
my $ipconf = qq[$IPCONFIG /all | tr -d '\\r'];
my $ipawk = qq[/^Ethernet adapter/] .
qq[{ ifc = gensub("Ethernet adapter (.*):", "\\\\\\\\1", 1); next }] .
qq[/IP Address/ && ifc == "$iface"{print \$NF}];
my $addr1 = qq[addr1=\`$showip | awk '/IP Address:/{print \$NF}'\`];
my $addr2 = qq[addr2=\`$ipconf | awk '$ipawk'\`];
my $iptest = '[[ "$addr1" != '.$inet.' || "$addr2" != '.$inet.' ]]';
$uplines .= qq{$addr1\n $addr2\n };
$uplines .= qq{if $iptest; then\n };
# my $showip = qq[$NETSH interface ipv4 show address name="$iface"];
# my $ipconf = qq[$IPCONFIG /all | tr -d '\\r'];
# my $ipawk = qq[/^Ethernet adapter/] .
# qq[{ ifc = gensub("Ethernet adapter (.*):", "\\\\\\\\1", 1); next }] .
# qq[/IPv4 Address/ && ifc == "$iface"{print \$NF}]; # XXX: fix
# my $addr1 = qq[addr1=\`$showip | awk '/IP Address:/{print \$NF}'\`];
# my $addr2 = qq[addr2=\`$ipconf | awk '$ipawk'\`];
# my $iptest = '[[ "$addr1" != '.$inet.' || "$addr2" != '.$inet.' ]]';
# $uplines .= qq{$addr1\n $addr2\n };
# $uplines .= qq{if $iptest; then\n };
#
# Re-do it if not.
$uplines .= qq{ echo " Config failed on $iface, retrying."\n };
$uplines .= " $DEVCON disable '$dev_map{$iface}'\n ";
$uplines .= qq{ sleep 5\n };
$uplines .= " $DEVCON enable '$dev_map{$iface}'\n ";
$uplines .= qq{ sleep 5\n };
$uplines .= sprintf(" " . $IFCONFIG, $iface, $inet, $mask) . qq{\n };
# $uplines .= qq{ echo " Config failed on $iface, retrying."\n };
# $uplines .= " $DEVCON disable '$dev_map{$iface}'\n ";
# $uplines .= qq{ sleep 5\n };
# $uplines .= " $DEVCON enable '$dev_map{$iface}'\n ";
# $uplines .= qq{ sleep 5\n };
# $uplines .= sprintf(" " . $IFCONFIG, $iface, $inet, $mask) . qq{\n };
#
# Re-check.
$uplines .= qq{ $addr1\n $addr2\n };
$uplines .= qq{ if $iptest; then\n };
$uplines .= qq{ echo " Reconfig still failed on $iface."\n };
$uplines .= qq{ else echo " Reconfig succeeded on $iface."\n };
$uplines .= qq{ fi\n };
$uplines .= qq{fi};
# $uplines .= qq{ $addr1\n $addr2\n };
# $uplines .= qq{ if $iptest; then\n };
# $uplines .= qq{ echo " Reconfig still failed on $iface."\n };
# $uplines .= qq{ else echo " Reconfig succeeded on $iface."\n };
# $uplines .= qq{ fi\n };
# $uplines .= qq{fi};
# Shutdown.
$downlines .= qq{echo "Disabling $iface from $inet"\n };
......
......@@ -2,7 +2,7 @@
# Constants
$TMCCBIN = "C:\Cygwin\usr\local\etc\emulab\tmcc.bin"
$TMCCARGS = "-s","boss.emulab.net","-t","30"
$TMCCARGS = "-t","30"
$CYGBINPATH = "C:\Cygwin\bin"
$LOGFILE = "C:\Temp\setnodename.log"
$CNPATH = "HKLM:\System\CurrentControlSet\Control\ComputerName\ComputerName"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment