Lines Matching +full:stdout +full:- +full:path

1 # SPDX-License-Identifier: GPL-2.0
21 from kunit_printer import stdout
31 ABS_TOOL_PATH = os.path.abspath(os.path.dirname(__file__))
32 QEMU_CONFIGS_DIR = os.path.join(ABS_TOOL_PATH, 'qemu_configs')
49 def make_mrproper(self) -> None:
51 subprocess.check_output(['make', 'mrproper'], stderr=subprocess.STDOUT)
57 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
60 def make_olddefconfig(self, build_dir: str, make_options) -> None:
68 subprocess.check_output(command, stderr=subprocess.STDOUT)
74 def make(self, jobs, build_dir: str, make_options) -> None:
75 command = ['make', 'ARCH=' + self._linux_arch, 'O=' + build_dir, '--jobs=' + str(jobs)]
84 stdout=subprocess.DEVNULL)
95 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
110 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
115 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
116 kernel_path = os.path.join(build_dir, self._kernel_path)
117 qemu_command = ['qemu-system-' + self._qemu_arch,
118 '-nodefaults',
119 '-m', '1024',
120 '-kernel', kernel_path,
121 '-append', ' '.join(params + [self._kernel_command_line]),
122 '-no-reboot',
123 '-nographic',
124 '-serial', 'stdio'] + self._extra_qemu_params
129 stdout=subprocess.PIPE,
130 stderr=subprocess.STDOUT,
139 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
144 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
146 linux_bin = os.path.join(build_dir, 'linux')
150 stdout=subprocess.PIPE,
151 stderr=subprocess.STDOUT,
154 def get_kconfig_path(build_dir: str) -> str:
155 return os.path.join(build_dir, KCONFIG_PATH)
157 def get_kunitconfig_path(build_dir: str) -> str:
158 return os.path.join(build_dir, KUNITCONFIG_PATH)
160 def get_old_kunitconfig_path(build_dir: str) -> str:
161 return os.path.join(build_dir, OLD_KUNITCONFIG_PATH)
164 kunitconfig_paths: Optional[List[str]]=None) -> kunit_config.Kconfig:
166 path = get_kunitconfig_path(build_dir)
167 if not os.path.exists(path):
168 shutil.copyfile(DEFAULT_KUNITCONFIG_PATH, path)
169 return kunit_config.parse_file(path)
173 for path in kunitconfig_paths:
174 if os.path.isdir(path):
175 path = os.path.join(path, KUNITCONFIG_PATH)
176 if not os.path.exists(path):
177 raise ConfigError(f'Specified kunitconfig ({path}) does not exist')
179 partial = kunit_config.parse_file(path)
182 diff_str = '\n\n'.join(f'{a}\n vs from {path}\n{b}' for a, b in diff)
187 def get_outfile_path(build_dir: str) -> str:
188 return os.path.join(build_dir, OUTFILE_PATH)
190 def _default_qemu_config_path(arch: str) -> str:
191 config_path = os.path.join(QEMU_CONFIGS_DIR, arch + '.py')
192 if os.path.isfile(config_path):
195 options = [f[:-3] for f in os.listdir(QEMU_CONFIGS_DIR) if f.endswith('.py')]
200 cross_compile: Optional[str]) -> Tuple[str, LinuxSourceTreeOperations]:
201 # The module name/path has very little to do with where the actual file
209 module_path = '.' + os.path.join(os.path.basename(QEMU_CONFIGS_DIR), os.path.basename(config_path))
236 extra_qemu_args=None) -> None:
253 def arch(self) -> str:
256 def clean(self) -> bool:
264 def validate_config(self, build_dir: str) -> bool:
269 missing = set(self._kconfig.as_entries()) - set(validated_kconfig.as_entries())
275 'on a different architecture with something like "--arch=x86_64".'
279 def build_config(self, build_dir: str, make_options) -> bool:
281 if build_dir and not os.path.exists(build_dir):
294 if os.path.exists(old_path):
299 def _kunitconfig_changed(self, build_dir: str) -> bool:
301 if not os.path.exists(old_path):
307 def build_reconfig(self, build_dir: str, make_options) -> bool:
310 if not os.path.exists(kconfig_path):
323 def build_kernel(self, jobs, build_dir: str, make_options) -> bool:
332 def run_kernel(self, args=None, build_dir='', filter_glob='', timeout=None) -> Iterator[str]:
340 assert process.stdout is not None # tell mypy it's set
356 for line in process.stdout:
362 output.write(process.stdout.read())
364 process.stdout.close()
369 def signal_handler(self, unused_sig, unused_frame) -> None: