Commit 4ca417ad authored by Leigh B Stoller's avatar Leigh B Stoller

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents d3d24832 25fbcaeb
......@@ -279,6 +279,8 @@ REPLACE INTO mode_transitions VALUES ('ALWAYSUP','ISUP','RELOAD-MOTE','ISUP','Re
REPLACE INTO mode_transitions VALUES ('RELOAD-MOTE','SHUTDOWN','ALWAYSUP','ISUP','ReloadDone');
REPLACE INTO mode_transitions VALUES ('PCVM','SHUTDOWN','RELOAD-PCVM','SHUTDOWN','ReloadSetup');
REPLACE INTO mode_transitions VALUES ('RELOAD-PCVM','SHUTDOWN','PCVM','SHUTDOWN','ReloadDone');
REPLACE INTO mode_transitions VALUES ('RELOAD-PUSH','SHUTDOWN','MINIMAL','SHUTDOWN','ReloadDone');
REPLACE INTO mode_transitions VALUES ('MINIMAL','SHUTDOWN','RELOAD-PUSH','SHUTDOWN','ReloadStart');
REPLACE INTO mode_transitions VALUES ('SECUREBOOT','TPMSIGNOFF','MINIMAL','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('SECUREBOOT','TPMSIGNOFF','NORMAL','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('SECUREBOOT','TPMSIGNOFF','NORMALv2','SHUTDOWN','');
......@@ -556,6 +558,12 @@ REPLACE INTO state_transitions VALUES ('RELOAD','TBSETUP','ISUP','FailedBoot');
REPLACE INTO state_transitions VALUES ('RELOAD','TBSETUP','TBFAILED','FailedBoot');
REPLACE INTO state_transitions VALUES ('RELOAD','ISUP','SHUTDOWN','RebootAfterFail');
REPLACE INTO state_transitions VALUES ('RELOAD','TBFAILED','SHUTDOWN','RebootAfterFail');
REPLACE INTO state_transitions VALUES ('RELOAD-PUSH','SHUTDOWN','BOOTING','Booting');
REPLACE INTO state_transitions VALUES ('RELOAD-PUSH','BOOTING','BOOTING','BootRetry');
REPLACE INTO state_transitions VALUES ('RELOAD-PUSH','RELOADSETUP','RELOADING','ReloadStart');
REPLACE INTO state_transitions VALUES ('RELOAD-PUSH','RELOADING','RELOADDONE','ReloadDone');
REPLACE INTO state_transitions VALUES ('RELOAD-PUSH','RELOADDONE','SHUTDOWN','ReloadDone');
REPLACE INTO state_transitions VALUES ('RELOAD-PUSH','SHUTDOWN','RELOADSETUP','ReloadSetup');
REPLACE INTO state_transitions VALUES ('SECUREBOOT','BOOTING','SECVIOLATION','QuoteFailed');
REPLACE INTO state_transitions VALUES ('SECUREBOOT','BOOTING','TPMSIGNOFF','QuoteOK');
REPLACE INTO state_transitions VALUES ('SECUREBOOT','GPXEBOOTING','PXEBOOTING','DHCP');
......@@ -592,6 +600,7 @@ REPLACE INTO state_triggers VALUES ('*','RELOAD','RELOADOLDMFS','RELOADOLDMFS');
REPLACE INTO state_triggers VALUES ('*','RELOAD-PCVM','RELOADDONE','RESET, RELOADDONE');
REPLACE INTO state_triggers VALUES ('*','RELOAD','ISUP','REBOOT');
REPLACE INTO state_triggers VALUES ('*','RELOAD','TBFAILED','REBOOT');
REPLACE INTO state_triggers VALUES ('*','RELOAD-PUSH','RELOADDONE','RELOADDONE');
REPLACE INTO state_triggers VALUES ('*','*','GPXEBOOTING','SECUREBOOT');
REPLACE INTO state_triggers VALUES ('*','*','SECVIOLATION','POWEROFF, EMAILNOTIFY');
REPLACE INTO state_triggers VALUES ('*','SECUREBOOT','BOOTING','');
......
#
# Make stated's MINIMAL mode a little more capable for reloading.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBQueryFatal("REPLACE INTO mode_transitions VALUES " .
"('MINIMAL','SHUTDOWN','RELOAD-PUSH','SHUTDOWN','ReloadStart')");
DBQueryFatal("REPLACE INTO mode_transitions VALUES " .
"('RELOAD-PUSH','SHUTDOWN','MINIMAL','SHUTDOWN','ReloadDone')");
DBQueryFatal("REPLACE INTO state_transitions VALUES " .
"('RELOAD-PUSH','BOOTING','BOOTING','BootRetry')");
DBQueryFatal("REPLACE INTO state_transitions VALUES " .
"('RELOAD-PUSH','RELOADDONE','SHUTDOWN','ReloadDone')");
DBQueryFatal("REPLACE INTO state_transitions VALUES " .
"('RELOAD-PUSH','RELOADING','RELOADDONE','ReloadDone')");
DBQueryFatal("REPLACE INTO state_transitions VALUES " .
"('RELOAD-PUSH','RELOADSETUP','RELOADING','ReloadStart')");
DBQueryFatal("REPLACE INTO state_transitions VALUES " .
"('RELOAD-PUSH','SHUTDOWN','BOOTING','Booting')");
DBQueryFatal("REPLACE INTO state_transitions VALUES " .
"('RELOAD-PUSH','SHUTDOWN','RELOADSETUP','ReloadSetup')");
DBQueryFatal("REPLACE INTO state_triggers VALUES " .
"('*','RELOAD-PUSH','RELOADDONE','RELOADDONE')");
return 0;
}
1;
#
# Add a new feature for libosload_new
#
use strict;
use EmulabFeatures;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
#
# Add a new feature for libosload_new
#
my $feature = EmulabFeatures->Lookup("NewOsload");
if (!defined($feature)) {
$feature = EmulabFeatures->Create("NewOsload",
"Use libosload_new instead of libosload. ".
"libosload_new will eventually replace libosload.");
}
return -1
if (!defined($feature));
return 0;
}
1;
......@@ -836,14 +836,15 @@ sub NewType($$)
eval "require libossetup_$type";
$newtype = eval { $packname->New($self); };
if ($@) {
print STDERR "$self NewType($type): module load failed: " . $@ . "\n";
# print STDERR "$self NewType($type): module load failed: " . $@ . "\n"
# if ($self->debug());
return undef;
}
}
$self->{'TYPECACHE'}->{$type} = $newtype;
print STDERR "Created type object $type with parent $self\n"
if ($self->debug());
# print STDERR "Created type object $type with parent $self\n"
# if ($self->debug());
return $newtype;
}
......
......@@ -1113,8 +1113,11 @@ sub doListVlans ($) {
#
# These need to be declared here for the benefit of the format string
# See perlform(1) for help with formats
# Note that they are declared 'our' rather than 'my' due to a stupid
# bug in perl 5.10
#
my ($vlan_id,$ddep,$pideid,$vname,$members);
our ($vlan_id,$ddep,$pideid,$vname,$members);
#
# Check to see if they want device-specific VLAN numbers, which makes the
# display more cramped, but is useful for debugging
......@@ -1267,7 +1270,7 @@ sub doListPorts($) {
#
# See perlform(1) for help with formats
#
my ($port,$enabled,$up,$speed,$duplex);
our ($port,$enabled,$up,$speed,$duplex);
print << "END";
Port Enabled Up Speed Duplex
--------------------------------------------
......@@ -1470,7 +1473,7 @@ sub doGetStats($) {
push @statList, $stack->getStats();
}
my ($port, $inoctets, $inunicast, $innunicast, $indiscards, $inerr,
our ($port, $inoctets, $inunicast, $innunicast, $indiscards, $inerr,
$inunk, $outoctets, $outunicast, $outnunicast, $outdiscards,
$outerr,$outq);
#
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -276,7 +276,11 @@ sub DelaySetup
}
# polling
print DEL " if [ -n \"`sysctl kern.polling.enable 2>/dev/null`\" ]; then\n";
if ($FBSD_VERSION >= 8) {
print DEL " if [ -n \"`sysctl kern.polling.phase 2>/dev/null`\" ]; then\n";
} else {
print DEL " if [ -n \"`sysctl kern.polling.enable 2>/dev/null`\" ]; then\n";
}
if ($FBSD_VERSION >= 6) {
foreach my $bridge (@bridges) {
my (undef,$if1,$if2) = @$bridge;
......@@ -424,9 +428,15 @@ sub DelaySetup
# in question. For older FreeBSDs, we just have to turn it on
# globally.
#
print DEL "if [ -n \"`sysctl kern.polling.enable 2>/dev/null`\" ]; then\n";
if ($FBSD_VERSION >= 8) {
print DEL " if [ -n \"`sysctl kern.polling.phase 2>/dev/null`\" ]; then\n";
} else {
print DEL "if [ -n \"`sysctl kern.polling.enable 2>/dev/null`\" ]; then\n";
}
if ($FBSD_VERSION >= 6) {
print DEL " sysctl -w kern.polling.enable=0\n";
if ($FBSD_VERSION < 8) {
print DEL " sysctl -w kern.polling.enable=0\n";
}
foreach my $bridge (@bridges) {
my (undef,$if1,$if2) = @$bridge;
print DEL " ifconfig $if1 polling\n";
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -67,13 +67,12 @@ $ENV{'PATH'} = "/tmp:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:".
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
# Determine if we need the magic to enable writing the active disk.
# Determine if we should use the "geom" tools to make everything happen.
# Empirically, this seems to only be needed for FreeBSD 8 and above.
#
my $needsysctl = 0;
my $didsysctl = 0;
my $usegeom = 0;
if (`uname -r` =~ /^(\d+)\./ && $1 > 7) {
$needsysctl = $1;
$usegeom = $1;
}
#
......@@ -244,9 +243,12 @@ if (!$forceit) {
#
# Dark magic to allow us to modify the open boot disk
#
if ($needsysctl) {
mysystem("sysctl kern.geom.debugflags=16");
$didsysctl = 1;
if ($usegeom && $slice != 0) {
if ($stype != 0) {
mysystem("gpart delete -i $slice $disk");
}
mysystem("gpart add -i $slice -t freebsd $disk");
$stype = 165;
}
#
......@@ -269,20 +271,11 @@ elsif ($stype != 165) {
# If not recreating the filesystems, just try to mount it
#
elsif ($noinit) {
if ($didsysctl) {
system("sysctl kern.geom.debugflags=0");
$didsysctl = 0;
}
mysystem("mount $fsdevice $mountpoint");
mysystem("echo \"$fsdevice $mountpoint ufs rw 0 2\" >> /etc/fstab");
exit(0);
}
if ($didsysctl) {
system("sysctl kern.geom.debugflags=0");
$didsysctl = 0;
}
#
# Now create the disklabel
#
......@@ -380,8 +373,6 @@ sub mysystem($)
print "'$command'\n";
my $rv = system($command);
if ($rv) {
system("sysctl kern.geom.debugflags=0")
if ($didsysctl);
die("*** $0:\n".
" Failed ($rv): '$command'\n");
}
......
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