Commit 092e2dec authored by Mike Hibler's avatar Mike Hibler
Browse files

Don't clobber our carefully crafted pxelinux config files.

parent d0a5f9cd
...@@ -431,6 +431,17 @@ while (<IF>) { ...@@ -431,6 +431,17 @@ while (<IF>) {
# 4. "pxe_boot_path" node_type_attribute for node type # 4. "pxe_boot_path" node_type_attribute for node type
# 5. don't set (i.e., use the dhcpd.conf global default). # 5. don't set (i.e., use the dhcpd.conf global default).
# #
# XXX Note that we cannot do this right now for
# boot_method == "pxelinux" nodes as they use the same
# file for their regular boot. We could do this in the
# future by taking advantage of the fact that pxelinux
# tries an order list of config files for each node.
#
my $nobj = Node->Lookup($node_id);
if (!$nobj) {
fatal("Could not find Node info for $node_id");
}
if ($nobj->boot_method() ne "pxelinux") {
my $pxeboot = $row{"next_pxe_boot_path"}; my $pxeboot = $row{"next_pxe_boot_path"};
if (!$pxeboot) { if (!$pxeboot) {
$pxeboot = $row{"pxe_boot_path"}; $pxeboot = $row{"pxe_boot_path"};
...@@ -438,16 +449,13 @@ while (<IF>) { ...@@ -438,16 +449,13 @@ while (<IF>) {
$filename = SetupPXEBoot($node_id, $mac, 1, $pxeboot); $filename = SetupPXEBoot($node_id, $mac, 1, $pxeboot);
if (!$filename) { if (!$filename) {
# Get the node or node type default # Get the node or node type default
my $nobj = Node->Lookup($node_id);
if (!$nobj) {
fatal("Could not find Node info for $node_id");
}
my $path = $nobj->default_pxeboot(); my $path = $nobj->default_pxeboot();
$filename = SetupPXEBoot($node_id, $mac, 0, $path); $filename = SetupPXEBoot($node_id, $mac, 0, $path);
} }
if ($filename) { if ($filename) {
$filename = "${spaces}\tfilename \"$filename\";\n"; $filename = "${spaces}\tfilename \"$filename\";\n";
} }
}
spit: spit:
# Need to make MAC look right.. # Need to make MAC look right..
$mac =~ s/(..)\B/$1:/g; $mac =~ s/(..)\B/$1:/g;
......
Supports Markdown
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