summaryrefslogtreecommitdiffstats
path: root/server/lib/shell.js
diff options
context:
space:
mode:
authorJannik Schönartz2018-07-17 00:20:04 +0200
committerJannik Schönartz2018-07-17 00:20:04 +0200
commit98816654b66b6581e3803f1ec37540dde89a8430 (patch)
tree67ee40969fa582cbd1fb8d907efbb9ea5d0c97b1 /server/lib/shell.js
parent[webapp] Initial commit to add the node webapp stuff. (diff)
downloadbas-98816654b66b6581e3803f1ec37540dde89a8430.tar.gz
bas-98816654b66b6581e3803f1ec37540dde89a8430.tar.xz
bas-98816654b66b6581e3803f1ec37540dde89a8430.zip
[server/ipxe] Building ipxe with external configs.
Diffstat (limited to 'server/lib/shell.js')
-rw-r--r--server/lib/shell.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/server/lib/shell.js b/server/lib/shell.js
index ab07b81..931286c 100644
--- a/server/lib/shell.js
+++ b/server/lib/shell.js
@@ -9,18 +9,25 @@ module.exports = {
return res.status(500).send({ status: 'GIT_MISSING', error_message: 'Please install git on the server.' });
}
-
var gitclone = 'git clone ' + ipxeGIT;
shell.cd(path.join(__appdir, 'ipxe'));
shell.exec(gitclone, function(code, stdout, stderr) {
shell.cd(path.join(__appdir, 'ipxe', 'ipxe', 'src'));
- var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe');
+
+ // Remove the general config and paste in the own one
+ shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'general.h'));
+ shell.cp(path.join(__appdir, 'ipxe', 'general.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'));
+ shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'console.h'));
+ shell.cp(path.join(__appdir, 'ipxe', 'console.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'));
+ //var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe');
+ var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe') + " TRUST=" + path.join(__appdir, 'bin', 'fullchain.pem');
//shell.env.PATH = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin';
shell.env.DEBUG = '';
shell.exec(make, function(code, stdout, stderr) {
- shell.cp('-rf', 'bin/ipxe.pxe', path.join(__appdir, 'tftp'));
- shell.cp('-rf', 'bin/undionly.kpxe', path.join(__appdir, 'tftp'));
- //shell.rm('-rf', 'ipxe');
+ shell.rm(path.join(__appdir, 'tftp', 'ipxe.0'));
+ shell.cp('bin/ipxe.pxe', path.join(__appdir, 'tftp'));
+ shell.mv(path.join(__appdir, 'tftp', 'ipxe.pxe'), path.join(__appdir, 'tftp', 'ipxe.0'));
+ // shell.rm('-rf', 'ipxe');
return res.status(200).send({ status: 'success' });
});
});