Commit 1ea1c675 authored by Mike Hibler's avatar Mike Hibler

Respect the node_types pxe_boot_path field if set.

parent c34575d9
......@@ -173,6 +173,7 @@ while (<IF>) {
my $nodetype = $2;
my $query_result =
DBQueryWarn("select n.node_id,n.pxe_boot_path, ".
" t.pxe_boot_path as nt_pxe_boot_path, ".
" i.IP,i.MAC,r.pid,r.eid, ".
" r.vname,r.inner_elab_role, ".
" r.inner_elab_boot ".
......@@ -237,7 +238,13 @@ while (<IF>) {
"${spaces}\toption host-name \"$node_id\";\n";
}
# Handle alternate boot program filename if it exists
#
# 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($row{"pxe_boot_path"})) {
my $fn = $row{"pxe_boot_path"};
# make sure it is pretty constrained
......@@ -245,6 +252,13 @@ while (<IF>) {
$filename = "${spaces}\tfilename \"$fn\";\n";
}
}
if (!$filename && defined($row{"nt_pxe_boot_path"})) {
my $fn = $row{"nt_pxe_boot_path"};
# make sure it is pretty constrained
if ($fn =~ /^\/tftpboot\// && $fn !~ /\.\./) {
$filename = "${spaces}\tfilename \"$fn\";\n";
}
}
# Need to make MAC look right..
$mac =~ s/(..)\B/$1:/g;
......
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