diff options
-rw-r--r-- | scripts/exceptions.py | 6 | ||||
-rw-r--r-- | scripts/kernel.py | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/scripts/exceptions.py b/scripts/exceptions.py index 722c44a..68fef59 100644 --- a/scripts/exceptions.py +++ b/scripts/exceptions.py @@ -19,3 +19,9 @@ class PhaseMismatch(Exception): pass def __str__(self): return "Phase in " + conf.phase_file + " is unknown." + +class KernelConfigFailed(Exception): + def __init__(self): + pass + def __str__(self): + return "Kernel configuration failed." diff --git a/scripts/kernel.py b/scripts/kernel.py index 51c5b21..76255d0 100644 --- a/scripts/kernel.py +++ b/scripts/kernel.py @@ -2,9 +2,9 @@ import os import sys import subprocess -import utils from conf import conf - +import utils +from exceptions import KernelConfigFailed def config(): # Executing old linux config @@ -16,11 +16,12 @@ def config(): line = sprc.stdout.readline() if line != '': if b'Restart config' in line: - print("Kernel config failed") sprc.terminate() + raise KernelConfigFailed() break else: - print(line.decode('utf-8'), end="") + if conf.kernel_config_output: + print(line.decode('utf-8'), end="") else: break os.chdir(wd) |