diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | scripts/boot.py | 26 |
2 files changed, 28 insertions, 0 deletions
@@ -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) + |