aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--scripts/boot.py26
2 files changed, 28 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 0d98c64..ec0d650 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,5 @@
build
__*__
+
+scripts/nbscript
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)
+