Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
1f3439d5
Commit
1f3439d5
authored
Aug 12, 2011
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DB update script for Windows .wim image loading state machine.
parent
ac711ea5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
99 additions
and
0 deletions
+99
-0
sql/updates/4/255
sql/updates/4/255
+99
-0
No files found.
sql/updates/4/255
0 → 100644
View file @
1f3439d5
#
# More support for WinPE/ImageX loaded images.
# stated state machine definitions.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
my @mode_transitions = (
["PXEFBSD","SHUTDOWN","WIMRELOAD","SHUTDOWN",""],
["MINIMAL","SHUTDOWN","WIMRELOAD","SHUTDOWN",""],
["NETBOOT","SHUTDOWN","WIMRELOAD","SHUTDOWN",""],
["NORMAL","SHUTDOWN","WIMRELOAD","SHUTDOWN",""],
["NORMALv1","SHUTDOWN","WIMRELOAD","SHUTDOWN",""],
["NORMALv2","SHUTDOWN","WIMRELOAD","SHUTDOWN",""],
["WIMRELOAD","SHUTDOWN","PXEFBSD","SHUTDOWN",""],
["WIMRELOAD","SHUTDOWN","MINIMAL","SHUTDOWN",""],
["WIMRELOAD","SHUTDOWN","NETBOOT","SHUTDOWN",""],
["WIMRELOAD","SHUTDOWN","NORMAL","REBOOTING",""],
["WIMRELOAD","SHUTDOWN","NORMALv1","SHUTDOWN",""],
["WIMRELOAD","SHUTDOWN","NORMALv2","SHUTDOWN",""],
["WIMRELOAD","RELOADDONE","MINIMAL","SHUTDOWN",""],
["WIMRELOAD","RELOADDONE","NETBOOT","SHUTDOWN",""],
["WIMRELOAD","RELOADDONE","NORMAL","SHUTDOWN",""],
["WIMRELOAD","RELOADDONE","NORMALv1","SHUTDOWN",""],
["WIMRELOAD","RELOADDONE","NORMALv2","SHUTDOWN",""]
);
my @timeouts = (
["WIMRELOAD","SHUTDOWN",240,"REBOOT"],
["WIMRELOAD","RELOADSETUP",60,"NOTIFY"],
["WIMRELOAD","RELOADING",1800,"NOTIFY"],
["WIMRELOAD","RELOADDONE",60,"NOTIFY"]
);
my @transitions = (
["WIMRELOAD","SHUTDOWN","RELOADSETUP","BootOK"],
["WIMRELOAD","RELOADSETUP","RELOADING","ReloadStart"],
["WIMRELOAD","RELOADING","RELOADDONE","ReloadDone"],
["WIMRELOAD","SHUTDOWN","SHUTDOWN","Retry"],
["WIMRELOAD","SHUTDOWN","PXEBOOTING","WrongPXEboot"],
["WIMRELOAD","RELOADSETUP","SHUTDOWN","Error"],
["WIMRELOAD","RELOADING","SHUTDOWN","Error"]
);
my @triggers = (
["*","WIMRELOAD","RELOADDONE","PXERESET, RESET, RELOADDONE"],
["*","WIMRELOAD","PXEBOOTING","REBOOT"],
["*","WIMRELOAD","BOOTING","REBOOT"],
["*","WIMRELOAD","ISUP","REBOOT"]
);
foreach my $row (@mode_transitions) {
my ($opm1,$s1,$opm2,$s2,$lab) = @$row;
my $query_result =
DBQueryFatal("SELECT op_mode1 FROM mode_transitions WHERE ".
"op_mode1='$opm1' AND state1='$s1' AND ".
"op_mode2='$opm2' AND state2='$s2'");
if ($query_result->numrows == 0) {
DBQueryFatal("INSERT INTO mode_transitions VALUES ".
"('$opm1','$s1','$opm2', '$s2','$lab')");
}
}
foreach my $row (@timeouts) {
my ($opm,$s,$to,$act) = @$row;
my $query_result =
DBQueryFatal("SELECT op_mode FROM state_timeouts WHERE ".
"op_mode='$opm' AND state='$s'");
if ($query_result->numrows == 0) {
DBQueryFatal("INSERT INTO state_timeouts VALUES ".
"('$opm','$s','$to', '$act')");
}
}
foreach my $row (@transitions) {
my ($opm,$s1,$s2,$lab) = @$row;
my $query_result =
DBQueryFatal("SELECT op_mode FROM state_transitions WHERE ".
"op_mode='$opm' AND state1='$s1' AND state2='$s2'");
if ($query_result->numrows == 0) {
DBQueryFatal("INSERT INTO state_transitions VALUES ".
"('$opm','$s1','$s2','$lab')");
}
}
foreach my $row (@triggers) {
my ($node,$opm,$s,$trig) = @$row;
my $query_result =
DBQueryFatal("SELECT node_id FROM state_triggers WHERE ".
"node_id='$node' AND op_mode='$opm' AND state='$s'");
if ($query_result->numrows == 0) {
DBQueryFatal("INSERT INTO state_triggers VALUES ".
"('$node','$opm','$s','$trig')");
}
}
return 0;
}
1;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment