summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/taskmanager/tasks/CompileIPxeNew.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/openslx/taskmanager/tasks/CompileIPxeNew.java')
-rw-r--r--src/main/java/org/openslx/taskmanager/tasks/CompileIPxeNew.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/main/java/org/openslx/taskmanager/tasks/CompileIPxeNew.java b/src/main/java/org/openslx/taskmanager/tasks/CompileIPxeNew.java
index 2afa636..c4c0f3c 100644
--- a/src/main/java/org/openslx/taskmanager/tasks/CompileIPxeNew.java
+++ b/src/main/java/org/openslx/taskmanager/tasks/CompileIPxeNew.java
@@ -3,6 +3,9 @@ package org.openslx.taskmanager.tasks;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -34,9 +37,10 @@ public class CompileIPxeNew extends AbstractTask
/**
* Files which should be copied to the TFTP dir so they're available for netboot
*/
- private static final String[] FILES_NET = { "bin-i386-pcbios/undionly.kpxe", "bin-i386-pcbios/undionly.kkpxe",
+ private static final String[] FILES_NET = { "bin-i386-pcbios/ipxe.pxe",
+ "bin-i386-pcbios/undionly.kpxe", "bin-i386-pcbios/undionly.kkpxe",
"bin-i386-pcbios/undionly.kkkpxe", "bin-x86_64-efi/ipxe.efi", "bin-x86_64-efi/snponly.efi" };
-
+
/**
* Files which should be moved to the websrv so they're available for download
*/
@@ -123,13 +127,26 @@ public class CompileIPxeNew extends AbstractTask
}
// NETBOOT
for ( String f : FILES_NET ) {
+ String destName = new File( f ).getName();
+ if ( f.contains( "-pcbios" ) ) {
+ // Append .0 to filename, otherwise older pxelinux won't be able to chain to us
+ destName += ".0";
+ }
try {
FileUtils.copyFile( new File( "/opt/openslx/ipxe/src", f ),
- new File( "/srv/openslx/tftp", new File( f ).getName() ) );
+ new File( "/srv/openslx/tftp", destName ) );
} catch ( Exception e ) {
status.addError( "Cannot copy " + f + " to TFTP dir: " + e.toString() );
}
}
+ // Change ipxelinux.0 so old DHCP entries keep working
+ Path link = Paths.get( "/srv/openslx/tftp/ipxelinux.0" );
+ FileUtils.deleteQuietly( link.toFile() );
+ try {
+ Files.createSymbolicLink( link, Paths.get( "undionly.kpxe.0" ) );
+ } catch ( Exception e1 ) {
+ status.addError( "Could not create ipxelinux.0 symlink" );
+ }
// DOWNLOAD
for ( String f : FILES_DL ) {
try {