Lines Matching +full:stdout +full:- +full:path
1 # SPDX-License-Identifier: GPL-2.0
32 ABS_TOOL_PATH = os.path.abspath(os.path.dirname(__file__))
33 QEMU_CONFIGS_DIR = os.path.join(ABS_TOOL_PATH, 'qemu_configs')
50 def make_mrproper(self) -> None:
52 subprocess.check_output(['make', 'mrproper'], stderr=subprocess.STDOUT)
58 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
61 def make_olddefconfig(self, build_dir: str, make_options: Optional[List[str]]) -> None:
69 subprocess.check_output(command, stderr=subprocess.STDOUT)
75 def make(self, jobs: int, build_dir: str, make_options: Optional[List[str]]) -> None:
77 'ARCH=' + self._linux_arch, 'O=' + build_dir, '--jobs=' + str(jobs)]
86 stdout=subprocess.DEVNULL)
97 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
115 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
120 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
121 kernel_path = os.path.join(build_dir, self._kernel_path)
122 qemu_command = ['qemu-system-' + self._qemu_arch,
123 '-nodefaults',
124 '-m', '1024',
125 '-kernel', kernel_path,
126 '-append', ' '.join(params + [self._kernel_command_line]),
127 '-no-reboot',
128 '-nographic',
129 '-accel', 'kvm',
130 '-accel', 'hvf',
131 '-accel', 'tcg',
132 '-serial', self._serial] + self._extra_qemu_params
137 stdout=subprocess.PIPE,
138 stderr=subprocess.STDOUT,
147 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
152 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
154 linux_bin = os.path.join(build_dir, 'linux')
159 stdout=subprocess.PIPE,
160 stderr=subprocess.STDOUT,
163 def get_kconfig_path(build_dir: str) -> str:
164 return os.path.join(build_dir, KCONFIG_PATH)
166 def get_kunitconfig_path(build_dir: str) -> str:
167 return os.path.join(build_dir, KUNITCONFIG_PATH)
169 def get_old_kunitconfig_path(build_dir: str) -> str:
170 return os.path.join(build_dir, OLD_KUNITCONFIG_PATH)
173 kunitconfig_paths: Optional[List[str]]=None) -> kunit_config.Kconfig:
175 path = get_kunitconfig_path(build_dir)
176 if not os.path.exists(path):
177 shutil.copyfile(DEFAULT_KUNITCONFIG_PATH, path)
178 return kunit_config.parse_file(path)
182 for path in kunitconfig_paths:
183 if os.path.isdir(path):
184 path = os.path.join(path, KUNITCONFIG_PATH)
185 if not os.path.exists(path):
186 raise ConfigError(f'Specified kunitconfig ({path}) does not exist')
188 partial = kunit_config.parse_file(path)
191 diff_str = '\n\n'.join(f'{a}\n vs from {path}\n{b}' for a, b in diff)
196 def get_outfile_path(build_dir: str) -> str:
197 return os.path.join(build_dir, OUTFILE_PATH)
199 def _default_qemu_config_path(arch: str) -> str:
200 config_path = os.path.join(QEMU_CONFIGS_DIR, arch + '.py')
201 if os.path.isfile(config_path):
204 options = [f[:-3] for f in os.listdir(QEMU_CONFIGS_DIR) if f.endswith('.py')]
216 cross_compile: Optional[str]) -> Tuple[str, LinuxSourceTreeOperations]:
217 # The module name/path has very little to do with where the actual file
225 module_path = '.' + os.path.join(os.path.basename(QEMU_CONFIGS_DIR), os.path.basename(config_path))
252 extra_qemu_args: Optional[List[str]]=None) -> None:
269 def arch(self) -> str:
272 def clean(self) -> bool:
280 def validate_config(self, build_dir: str) -> bool:
285 missing = set(self._kconfig.as_entries()) - set(validated_kconfig.as_entries())
291 'on a different architecture with something like "--arch=x86_64".'
295 def build_config(self, build_dir: str, make_options: Optional[List[str]]) -> bool:
297 if build_dir and not os.path.exists(build_dir):
310 if os.path.exists(old_path):
315 def _kunitconfig_changed(self, build_dir: str) -> bool:
317 if not os.path.exists(old_path):
323 def build_reconfig(self, build_dir: str, make_options: Optional[List[str]]) -> bool:
326 if not os.path.exists(kconfig_path):
339 def build_kernel(self, jobs: int, build_dir: str, make_options: Optional[List[str]]) -> bool:
348 …, filter: str='', filter_action: Optional[str]=None, timeout: Optional[int]=None) -> Iterator[str]:
349 # Copy to avoid mutating the caller-supplied list. exec_tests() reuses
350 # the same args across repeated run_kernel() calls (e.g. --run_isolated),
362 assert process.stdout is not None # tell mypy it's set
365 def _wait_proc() -> None:
378 for line in process.stdout:
384 output.write(process.stdout.read())
386 process.stdout.close()
391 def signal_handler(self, unused_sig: int, unused_frame: Optional[FrameType]) -> None: