From 2cfa034037c20e91e2b167c1b490f8d045c68178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 11 Feb 2015 18:03:20 +0100 Subject: Kernel config repair and configurable make arguments --- scripts/kernel.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/kernel.py b/scripts/kernel.py index f50a616..51c5b21 100644 --- a/scripts/kernel.py +++ b/scripts/kernel.py @@ -11,17 +11,22 @@ def config(): env = dict(os.environ) wd = os.getcwd() os.chdir(conf.linux_sources) - sprc = subprocess.Popen(['make', 'oldconfig'], env=utils.get_kernel_env()) - for line in sprc.stdout: - if line == "* Restart config...": - print("Configuration failed") - sprc.kill() + sprc = subprocess.Popen(['make', 'oldconfig'], stdout=subprocess.PIPE, env=utils.get_kernel_env()) + while True: + line = sprc.stdout.readline() + if line != '': + if b'Restart config' in line: + print("Kernel config failed") + sprc.terminate() + break + else: + print(line.decode('utf-8'), end="") else: - print(line) + break os.chdir(wd) def make(): wd = os.getcwd() os.chdir(conf.linux_sources) - subprocess.call(['make', '-j8'], env=utils.get_kernel_env()) + subprocess.call(['make'] + conf.linux_make_args, env=utils.get_kernel_env()) os.chdir(wd) -- cgit v1.2.3