Some minor boot cleanups and feature adds
This commit is contained in:
@@ -29,7 +29,7 @@ func ipxe(w http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
|
||||
if node.HostName != "" {
|
||||
replace := make(map[string]string)
|
||||
log.Printf("IPXE: %15s: %s\n", node.Fqdn, req.URL.Path)
|
||||
|
||||
conf, err := config.New()
|
||||
if err != nil {
|
||||
@@ -53,10 +53,16 @@ func ipxe(w http.ResponseWriter, req *http.Request) {
|
||||
newLine = strings.ReplaceAll(newLine, "@HWADDR@", url[2])
|
||||
newLine = strings.ReplaceAll(newLine, "@IPADDR@", conf.Ipaddr)
|
||||
newLine = strings.ReplaceAll(newLine, "@HOSTNAME@", node.HostName)
|
||||
newLine = strings.ReplaceAll(newLine, "@FQDN@", node.Fqdn)
|
||||
newLine = strings.ReplaceAll(newLine, "@PORT@", strconv.Itoa(conf.Port))
|
||||
// TODO: Add KernelArgs to nodes.conf
|
||||
//newLine = strings.ReplaceAll(newLine, "@KERNELARGS@", node.KernelArgs)
|
||||
|
||||
|
||||
fmt.Fprintln(w, newLine)
|
||||
}
|
||||
log.Printf("SEND: %15s: %s\n", node.Fqdn, ipxeTemplate)
|
||||
|
||||
|
||||
} else {
|
||||
log.Printf("ERROR: iPXE request from unknown Node (hwaddr=%s)\n", url[2])
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#!ipxe
|
||||
|
||||
echo
|
||||
echo Now booting Warewulf - v4 Proof of Concept
|
||||
echo ================================================================================
|
||||
echo Warewulf v4 now booting: @FQDN@
|
||||
echo
|
||||
echo
|
||||
|
||||
set base http://@IPADDR@:@PORT@/
|
||||
|
||||
kernel ${base}/kernel/@HWADDR@ crashkernel=no quiet
|
||||
initrd ${base}/vnfs/@HWADDR@
|
||||
initrd ${base}/kmods/@HWADDR@
|
||||
initrd ${base}/overlay-system/@HWADDR@
|
||||
boot
|
||||
kernel ${base}/kernel/@HWADDR@ crashkernel=no quiet || reboot
|
||||
initrd ${base}/vnfs/@HWADDR@ || reboot
|
||||
initrd ${base}/kmods/@HWADDR@ || reboot
|
||||
initrd ${base}/overlay-system/@HWADDR@ || reboot
|
||||
boot || reboot
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Edit at your own risk! DANGER DANGER.
|
||||
|
||||
|
||||
clear
|
||||
|
||||
echo "Warewulf v4 is now booting"
|
||||
|
||||
# Considering what to do if we are operating on a read only root
|
||||
|
||||
Reference in New Issue
Block a user