summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-09 14:51:22 +0100
committerSimon Rettberg2019-03-09 14:51:22 +0100
commit2afdec0afb77ce52edf68bf3c6eb66c778d36e8a (patch)
tree31d60a3bb3a17b02fab605d4c4efb0a9fe4f0b54
parent[SshdConfigGenerator] Only allow root to login (diff)
downloadtmlite-bwlp-2afdec0afb77ce52edf68bf3c6eb66c778d36e8a.tar.gz
tmlite-bwlp-2afdec0afb77ce52edf68bf3c6eb66c778d36e8a.tar.xz
tmlite-bwlp-2afdec0afb77ce52edf68bf3c6eb66c778d36e8a.zip
[CompileIPxeLegacy] (Re-)add log output
-rw-r--r--src/main/java/org/openslx/taskmanager/tasks/CompileIPxeLegacy.java28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/main/java/org/openslx/taskmanager/tasks/CompileIPxeLegacy.java b/src/main/java/org/openslx/taskmanager/tasks/CompileIPxeLegacy.java
index 6e2e297..c55276e 100644
--- a/src/main/java/org/openslx/taskmanager/tasks/CompileIPxeLegacy.java
+++ b/src/main/java/org/openslx/taskmanager/tasks/CompileIPxeLegacy.java
@@ -9,7 +9,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.openslx.satserver.util.Exec;
+import org.openslx.satserver.util.Exec.ExecCallback;
import org.openslx.taskmanager.api.AbstractTask;
+import org.openslx.taskmanager.api.BoundedLog;
import com.google.gson.annotations.Expose;
@@ -144,11 +146,12 @@ public class CompileIPxeLegacy extends AbstractTask
return false;
}
// Compile
- if ( 0 != Exec.syncAt( 240, "/opt/openslx/ipxe/src", "make", "EMBED=../ipxelinux.ipxe,../pxelinux.0", "bin/undionly.kkkpxe" ) ) {
+ ProcLogger pl = new ProcLogger();
+ if ( 0 != Exec.syncAt( 240, pl, "/opt/openslx/ipxe/src", "make", "EMBED=../ipxelinux.ipxe,../pxelinux.0", "bin/undionly.kkkpxe" ) ) {
status.error = "Compiling ipxelinux.0 failed";
return false;
}
- if ( 0 != Exec.syncAt( 240, "/opt/openslx/ipxe/src", "make", "EMBED=../usb.ipxe,../pxelinux.0", "bin/ipxe.usb" ) ) {
+ if ( 0 != Exec.syncAt( 240, pl, "/opt/openslx/ipxe/src", "make", "EMBED=../usb.ipxe,../pxelinux.0", "bin/ipxe.usb" ) ) {
FileUtils.deleteQuietly( new File( "/opt/openslx/ipxe/openslx-bootstick.raw" ) );
status.error = "Compiling ipxe usb image failed";
return false;
@@ -173,6 +176,27 @@ public class CompileIPxeLegacy extends AbstractTask
class Output
{
protected String error = null;
+ protected final BoundedLog log = new BoundedLog( 20, true );
+
+ protected void addLog( String data )
+ {
+ log.addLog( data );
+ }
+ }
+
+ private class ProcLogger implements ExecCallback
+ {
+ @Override
+ public void processStdOut( String line )
+ {
+ status.addLog( line );
+ }
+
+ @Override
+ public void processStdErr( String line )
+ {
+ status.addLog( line );
+ }
}
}