aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/boot.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/boot.py b/scripts/boot.py
new file mode 100644
index 0000000..1f7e0f9
--- /dev/null
+++ b/scripts/boot.py
@@ -0,0 +1,26 @@
+import os
+import sys
+import subprocess
+import shutil
+
+import utils
+from conf import conf
+from exceptions import MissingFile
+
+def gen_nbscript():
+ try:
+ os.remove(conf.nbscript)
+ except OSError:
+ pass
+
+ with open(conf.nbscript, 'w') as f:
+ f.write('load ' + conf.linux_image + ' console=ttyS0,115200\n')
+ f.write('load ' + conf.initram + '\n')
+
+def boot():
+ if not os.path.isfile(conf.nbscript):
+ gen_nbscript()
+
+ sprc = subprocess.Popen([conf.novaboot, conf.nbscript] + conf.novaboot_args,
+ stdout = subprocess.PIPE)
+