Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-stable
Commits
7aa1e29b
Commit
7aa1e29b
authored
Apr 09, 2001
by
Leigh B. Stoller
Browse files
A set of minor changes for specifying deltas in the NS file.
parent
02d790b7
Changes
5
Hide whitespace changes
Inline
Side-by-side
db/nfree.in
View file @
7aa1e29b
...
...
@@ -161,7 +161,7 @@ foreach my $n (@node_names) {
# And clean out various tidbits from the nodes table.
$cmd
=
"
update nodes set def_boot_cmd_line='',def_boot_path='',
"
.
"
startupcmd='',rpms='',def_boot_image_id='
$defimageid
'
"
.
"
startupcmd='',rpms='',
deltas='',
def_boot_image_id='
$defimageid
'
"
.
"
where node_id='
$n
'
";
$sth
=
$dbh
->
query
(
$cmd
)
||
(
print
"
Failed Command:
\n
$cmd
\n
Error string is:
"
.
$dbh
->
errstr
.
"
\n
"
...
...
tbsetup/ir/handle_os.in
View file @
7aa1e29b
...
...
@@ -206,6 +206,19 @@ foreach (split("\n",&ir_get("/rpms"))) {
$sth
->
execute
;
$sth
->
finish
;
}
if
(
!
&ir_exists
("
/deltas
"))
{
print
STDERR
"
IR incomplete: No /deltas.
\n
";
exit
(
1
);
}
foreach
(
split
("
\n
",
&ir_get
("
/deltas
")))
{
(
$node
,
$deltas
)
=
/^([^ ]+)(.*)$/
;
$deltas
=~
s/^ //
;
$deltas
=~
s/ /:/g
;
$sth
=
$dbh
->
prepare
("
UPDATE nodes set deltas =
\"
$deltas
\"
"
.
"
where node_id =
\"
$nodemap
{
$node
}
\"
");
$sth
->
execute
;
$sth
->
finish
;
}
foreach
(
values
(
%nodemap
))
{
$node
=
$_
;
...
...
tbsetup/ns2ir/postparse.in
View file @
7aa1e29b
...
...
@@ -97,6 +97,7 @@ open(TBCMD,$tbcmdfile) || do {
$cmdlines
=
();
$startups
=
();
$rpms
=
();
$deltas
=
();
while
(
<
TBCMD
>
)
{
chop
;
@line
=
split
;
...
...
@@ -180,8 +181,17 @@ while (<TBCMD>) {
next
;
}
$startups
{
$line
[
1
]}
=
join
("
",
@line
[
2
..
$#line
]);
}
elsif
(
$line
[
0
]
eq
"
tb-set-node-deltas
")
{
if
(
$#line
<
2
)
{
push
(
@ERRORS
,"
Syntax: tb-set-node-deltas node rpms...
");
next
;
}
if
(
!
defined
(
$nodes
{
$line
[
1
]}))
{
push
(
@ERRORS
,"
$line
[1] is not a valid node.
");
next
;
}
$deltas
{
$line
[
1
]}
=
join
("
",
@line
[
2
..
$#line
]);
}
}
close
(
TBCMD
);
...
...
@@ -282,5 +292,14 @@ foreach $node (keys(%nodes)) {
}
}
print
IRFILE
"
END cmdline
\n
";
print
IRFILE
"
START deltas
\n
";
foreach
$node
(
keys
(
%nodes
))
{
if
(
defined
(
$deltas
{
$node
}))
{
print
IRFILE
"
$node
$deltas
{
$node
}
\n
";
}
else
{
print
IRFILE
"
$node
\n
";
}
}
print
IRFILE
"
END deltas
\n
";
close
IRFILE
;
tbsetup/ns2ir/tb_compat.tcl.in
View file @
7aa1e29b
...
...
@@ -90,6 +90,10 @@ proc tb-set-node-startup {node cmd} {
global TBCMD nodeid_map
puts $TBCMD "tb-set-node-startup $nodeid_map($node) $cmd"
}
proc tb-set-node-deltas {node args} {
global TBCMD nodeid_map
puts $TBCMD "tb-set-node-deltas $nodeid_map($node) $args"
}
# Show that we have loaded
set TB_COMPACT 1
www/tutorial/tb_compat.tcl
View file @
7aa1e29b
...
...
@@ -13,3 +13,4 @@ proc tb-set-lan-loss {lan rate} {}
proc tb-set-node-rpms
{
node args
}
{}
proc tb-set-node-startup
{
node cmd
}
{}
proc tb-set-node-cmdline
{
node cmd
}
{}
proc tb-set-node-deltas
{
node args
}
{}
Write
Preview
Supports
Markdown
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