diff --git a/db/subboss_dhcpd_makeconf.in b/db/subboss_dhcpd_makeconf.in index 43fc96d2bbb30ecb5a8110bd244fd703b97c0614..2fa94bc915d8bf5a6e1c0dfbb8909fe8dacddc4b 100755 --- a/db/subboss_dhcpd_makeconf.in +++ b/db/subboss_dhcpd_makeconf.in @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# Copyright (c) 2000-2021 University of Utah and the Flux Group. +# Copyright (c) 2000-2023 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -238,6 +238,7 @@ sub gendhcpdconf($$) my $bootinfo_server = $$row{"BOOTINFO"}; my $hostname = $$row{"HOSTNAME"}; my $filename = $$row{"FILENAME"}; + my $configfile = $$row{"CONFIGFILE"}; my $singlenet = $$row{"SINGLENET"}; my $inner_elab_boot = $$row{"INNER_ELAB_BOOT"}; my $inner_elab_role = $$row{"INNER_ELAB_ROLE"}; @@ -264,6 +265,11 @@ sub gendhcpdconf($$) $filename = "${spaces}\tfilename \"$filename\";\n"; } + } + elsif (defined $configfile) { + $configfile =~ s/^"(.*)"$/$1/; + $configfile = + "${spaces}\toption configfile \"$configfile\";\n"; } else { ClearPXEBoot($node_id, $mac); } @@ -298,6 +304,7 @@ sub gendhcpdconf($$) print OF "${spaces}host $ip {\n"; print OF $filename if $filename; + print OF $configfile if $configfile; print OF $next_server if $next_server; print OF $bootinfo_server if $bootinfo_server; print OF $dns if $dns; diff --git a/dhcpd/dhcpd.conf.subboss.template.in b/dhcpd/dhcpd.conf.subboss.template.in index 806c8883c3199ee95631129a6680e8788b0325f9..90d1e2df37db82bc5ba61172defdbfab159a0d25 100644 --- a/dhcpd/dhcpd.conf.subboss.template.in +++ b/dhcpd/dhcpd.conf.subboss.template.in @@ -38,6 +38,9 @@ option PXE.discovery-control code 6 = unsigned integer 8; option PXE.discovery-mcast-addr code 7 = ip-address; option PXE.emulab-bootinfo code 128 = ip-address; +# XXX for Dell S4048-ON switch bootstrap +option configfile code 209 = text; + # # For PXE booting nodes we set the magic bits to tell the client that we are # PXE-saavy so they don't wait around for 12 seconds or so waiting for a diff --git a/tmcd/tmcd.c b/tmcd/tmcd.c index 34d138afe31652b6f1a78a1d863aae91555ae32a..9c243fb61cbaf8e366ceac04d4c16b59bbbf1434 100644 --- a/tmcd/tmcd.c +++ b/tmcd/tmcd.c @@ -12315,14 +12315,18 @@ COMMAND_PROTOTYPE(dodhcpdconf) res = mydb_query("select n.node_id,n.pxe_boot_path,i.IP,i.mac,n.type," "r.eid,r.pid,r.inner_elab_role,r.inner_elab_boot," - "r.plab_role,r.plab_boot,n.next_pxe_boot_path " + "r.plab_role,r.plab_boot,n.next_pxe_boot_path, " + "nat.attrvalue " "from nodes as n " "left join subbosses as s on n.node_id=s.node_id " "left join interfaces as i on n.node_id=i.node_id " "left join reserved as r on n.node_id=r.node_id " + "left join node_attributes as nat on " + " nat.node_id=n.node_id and " + " nat.attrkey='dhcpd_configfile' " "where s.subboss_id='%s' and " "s.service='dhcp' and s.disabled=0 and i.role='ctrl' " - "order by n.priority", 12, reqp->nodeid); + "order by n.priority", 13, reqp->nodeid); if (!res) { error("dodhcpconf: %s: DB Error getting dhcpd configuration\n", reqp->nodeid); @@ -12490,7 +12494,18 @@ COMMAND_PROTOTYPE(dodhcpdconf) remain -= rc; } - if (row[11] && row[11][0]) { + if (row[12] && row[12][0]) { + rc = snprintf(b, remain, " CONFIGFILE=\"%s\"", row[12]); + + if (rc < 0) { + error("dodhcpdconf: error creating output\n"); + mysql_free_result(res); + return 1; + } + + b += rc; + remain -= rc; + } else if (row[11] && row[11][0]) { rc = snprintf(b, remain, " FILENAME=\"%s\"", row[11]); if (rc < 0) {