From 509ec6da2ed54bcd29b7fcf4f308abb916ad1a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 27 Apr 2015 12:17:00 +0200 Subject: Firt implementation of boot.py Not yet finished. --- scripts/boot.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 scripts/boot.py (limited to 'scripts') 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) + -- cgit v1.2.3