summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-09-01 16:34:24 +0200
committerSimon Rettberg2016-09-01 16:34:24 +0200
commit3d88618b2c7ee2b3e633221ac7dad6016cd0db0e (patch)
treeac87c4cf334bfb4e2e31ff017a10ddbacd6e0ed8
parent[LinkConfigTgz] Passing empty target means remove link (diff)
downloadtmlite-bwlp-3d88618b2c7ee2b3e633221ac7dad6016cd0db0e.tar.gz
tmlite-bwlp-3d88618b2c7ee2b3e633221ac7dad6016cd0db0e.tar.xz
tmlite-bwlp-3d88618b2c7ee2b3e633221ac7dad6016cd0db0e.zip
[CompileIPxe] Support usb stick generation
-rw-r--r--src/main/java/org/openslx/taskmanager/tasks/CompileIPxe.java8
1 files 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 );