Commit 0cb1e03a authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

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

parents a7ce54b2 3533283b
......@@ -407,7 +407,7 @@ if (defined($pid)) {
# 1) To avoid an explosion in the number of features for nodes
# 2) To avoid information leaks, allowing projects to see each other's images
#
my $osidquery = "select distinct o.osid, oi.type, o.osname, o.pid, o.OS, o.version, o.description from os_info as o " .
my $osidquery = "select distinct o.osid, oi.type, o.osname, o.pid, o.OS, o.version, o.description,o.protogeni_export from os_info as o " .
"left join osidtoimageid as oi on o.osid = oi.osid " .
"left join images as i on oi.imageid = i.imageid ".
"where i.global = 1";
......@@ -447,14 +447,18 @@ my %node_latitudes;
my %node_longitudes;
$result = DBQueryFatal($osidquery);
while (my ($osid,$type,$osname,$ospid,$osos,
$osversion,$osdescription) = $result->fetchrow()) {
$osversion,$osdescription,$geni) = $result->fetchrow()) {
if ($typemap{$type}) {
push(@{ $typemap{$type}->{'OSLIST'} }, $osid);
$osid_name{$osid} = $osname;
$osid_pid{$osid} = $ospid;
$osid_os{$osid} = $osos;
$osid_version{$osid} = $osversion;
$osid_description{$osid} = $osdescription;
my $default = $typemap{$type}->{'OSID'};
if ($geni eq 1 ||
(defined($default) && $default eq $osid)) {
push(@{ $typemap{$type}->{'OSLIST'} }, $osid);
$osid_name{$osid} = $osname;
$osid_pid{$osid} = $ospid;
$osid_os{$osid} = $osos;
$osid_version{$osid} = $osversion;
$osid_description{$osid} = $osdescription;
}
}
if ($node_type_osids{$type}) {
push @{$node_type_osids{$type}}, $osid;
......
......@@ -1077,50 +1077,52 @@ sub gendhcpdconf($$)
my $singlenet = $$row{"SINGLENET"};
my $inner_elab_boot = $$row{"INNER_ELAB_BOOT"};
my $plab_boot = $$row{"PLAB_BOOT"};
my $booting;
my $dns;
if (defined $hostname) {
$hostname =
if (defined $hostname) {
$hostname =
"${spaces}\toption host-name \"$hostname\";\n";
}
}
if (defined $filename) {
if (defined $filename) {
$filename =~ s/^"(.*)"$/$1/;
$filename =
"${spaces}\tfilename \"$filename\";\n";
}
}
if (defined $next_server) {
if (defined $next_server) {
$next_server = "${spaces}\tnext-server " .
$next_server . ";\n";
}
}
if (defined $bootinfo_server) {
if (defined $bootinfo_server) {
$bootinfo_server = "${spaces}\toption " .
"PXE.emulab-bootinfo " . $bootinfo_server . ";\n";
}
}
if ($inner_elab_boot) {
if ($inner_elab_boot) {
if ($singlenet) {
$booting = "${spaces}\tignore booting;\n";
} else {
$dns = "${spaces}\toption ".
"domain-name-servers 1.1.1.1;\n";
}
}
#
# Handle alternate boot program filename if it exists.
# Use mutable nodes.pxe_boot_path if it is defined.
# Otherwise use the node_types.pxe_boot_path if it is
# defined. Otherwise don't set anything (use the global
# default).
#
if (defined $filename) {
# make sure it is pretty constrained
if ($filename =~ /^\/tftpboot\// && $fn !~ /\.\./) {
$filename = "${spaces}\tfilename \"$filename\";\n";
}
#
# Handle alternate boot program filename if it exists.
# Use mutable nodes.pxe_boot_path if it is defined.
# Otherwise use the node_types.pxe_boot_path if it is
# defined. Otherwise don't set anything (use the global
# default).
#
if (defined $filename) {
# make sure it is pretty constrained
if ($filename =~ /^\/tftpboot\// && $fn !~ /\.\./) {
$filename = "${spaces}\tfilename \"$filename\";\n";
}
}
# Need to make MAC look right..
......
......@@ -7972,7 +7972,7 @@ COMMAND_PROTOTYPE(dodhcpdconf)
}
if (inner_elab_boot) {
res2 = mydb_query("select elabinelab_singlenet from experiments "
res2 = mydb_query("select elabinelab_singlenet from experiments where "
"eid = '%s' and pid = '%s'", 1, row[5], row[6]);
if (!res2) {
......
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