From 3d88618b2c7ee2b3e633221ac7dad6016cd0db0e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 1 Sep 2016 16:34:24 +0200 Subject: [CompileIPxe] Support usb stick generation --- src/main/java/org/openslx/taskmanager/tasks/CompileIPxe.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openslx/taskmanager/tasks/CompileIPxe.java b/src/main/java/org/openslx/taskmanager/tasks/CompileIPxe.java index 975496c..bb69559 100644 --- a/src/main/java/org/openslx/taskmanager/tasks/CompileIPxe.java +++ b/src/main/java/org/openslx/taskmanager/tasks/CompileIPxe.java @@ -124,9 +124,7 @@ public class CompileIPxe extends AbstractTask } // Substitution String hybridEmbed = template.replace( "%ipaddress%", this.ipaddress ); - String usbEmbed = template.replaceFirst( "^ifopen$", "ifopen net0\n" - + "set net0/ip 0.0.0.0\n" - + "set net0/netmask 255.255.255.255\n" + String usbEmbed = hybridEmbed.replaceFirst( "ifopen", "ifopen net0\n" + ":retry_dhcp\n" + "dhcp net0 && goto dhcp_ok ||\n" + "echo DHCP not successful, trying again in 10s...\n" @@ -134,7 +132,9 @@ public class CompileIPxe extends AbstractTask + "goto retry_dhcp\n" + ":dhcp_ok\n" + "clear net0/ip\n" - + "clear net0/netmask\n" ); + + "clear net0/netmask\n" + + "set net0.dhcp/210:string http://" + this.ipaddress + "/tftp/ ||\n" + + "set 210:string http://" + this.ipaddress + "/tftp/ ||\n" ); // Write out try { FileUtils.writeStringToFile( new File( "/opt/openslx/ipxe/ipxelinux.ipxe" ), hybridEmbed, StandardCharsets.UTF_8 ); -- cgit v1.2.3-55-g7522