summaryrefslogtreecommitdiffstats
path: root/external
diff options
context:
space:
mode:
authorSimon Rettberg2013-11-16 15:42:16 +0100
committerSimon Rettberg2013-11-16 15:42:16 +0100
commit633e43127c6d1a96d47587eed2739bdaff6c3d4f (patch)
treeafe22b5cef77a5a054388d05f6a2c106dcb4d60b /external
parentAdd custom config.tgz upload functionality (diff)
downloadslx-admin-633e43127c6d1a96d47587eed2739bdaff6c3d4f.tar.gz
slx-admin-633e43127c6d1a96d47587eed2739bdaff6c3d4f.tar.xz
slx-admin-633e43127c6d1a96d47587eed2739bdaff6c3d4f.zip
Add minilinux download functionality and ipxe compilation scripts
Diffstat (limited to 'external')
-rwxr-xr-xexternal/build_ipxe.sh40
-rw-r--r--external/tgz/list.php24
2 files changed, 64 insertions, 0 deletions
diff --git a/external/build_ipxe.sh b/external/build_ipxe.sh
new file mode 100755
index 00000000..8cb23cd0
--- /dev/null
+++ b/external/build_ipxe.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# Call: $0 <ip_file> <server_ip> <logfile>
+# Self-Call: $0 --exec <ip_file> <server_ip>
+
+if [ $# -lt 3 ]; then
+ echo "Falscher Aufruf: Keine zwei Parameter angegeben!"
+ exit 1
+fi
+
+if [ "$1" != "--exec" ]; then
+ $0 --exec "$1" "$2" > "$3" 2>&1 &
+ RET=$!
+ echo "PID: ${RET}."
+ exit 0
+fi
+
+FILE="$2"
+SERVER="$3"
+
+cd "/opt/openslx/ipxe/src"
+
+[ -e "bin/undionly.kkkpxe" ] && unlink "bin/undionly.kkkpxe"
+
+make bin/undionly.kkkpxe EMBED=../ipxelinux.ipxe,../pxelinux.0
+
+if [ ! -e "bin/undionly.kkkpxe" -o "$(stat -c %s "bin/undionly.kkkpxe")" -lt 80000 ]; then
+ echo "Error compiling ipxelinux.0"
+ exit 1
+fi
+
+if ! cp "bin/undionly.kkkpxe" "/srv/openslx/tftp/ipxelinux.0"; then
+ echo "** Error copying ipxelinux.0 to target **"
+ exit 1
+fi
+
+echo -n "$SERVER" > "$FILE"
+echo " ** SUCCESS **"
+exit 0
+
diff --git a/external/tgz/list.php b/external/tgz/list.php
new file mode 100644
index 00000000..5c8d1c67
--- /dev/null
+++ b/external/tgz/list.php
@@ -0,0 +1,24 @@
+<?php
+
+/*
+echo '[';
+
+$first = true;
+foreach (glob('./*.tgz') as $file) {
+ if (!$first) echo ', ';
+ $first = false;
+ echo ' { "file" : "' . basename($file) . '", "description" : "<Beschreibung>" }';
+}
+echo ' ]';
+*/
+
+$files = array();
+foreach (glob('./*.tgz') as $file) {
+ $files[] = array(
+ 'file' => basename($file),
+ 'description' => 'Eine sinnvolle Beschreibung'
+ );
+}
+
+echo json_encode($files);
+