diff options
author | Karel Kočí <cynerd@email.cz> | 2015-04-27 12:17:00 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-04-27 12:17:00 +0200 |
commit | 509ec6da2ed54bcd29b7fcf4f308abb916ad1a71 (patch) | |
tree | a1f2e30f1c67eff3dd1686b394a6194244848b33 /scripts | |
parent | a6bff3a30fee2a2c77d0683eda7945764e7624a8 (diff) | |
download | linux-conf-perf-509ec6da2ed54bcd29b7fcf4f308abb916ad1a71.tar.gz linux-conf-perf-509ec6da2ed54bcd29b7fcf4f308abb916ad1a71.tar.bz2 linux-conf-perf-509ec6da2ed54bcd29b7fcf4f308abb916ad1a71.zip |
Firt implementation of boot.py
Not yet finished.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/boot.py | 26 |
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) + |