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

1 # SPDX-License-Identifier: GPL-2.0
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: Optional[List[str]]) -> None:
68 subprocess.check_output(command, stderr=subprocess.STDOUT)
74 def make(self, jobs: int, build_dir: str, make_options: Optional[List[str]]) -> None:
76 'O=' + build_dir, '--jobs=' + str(jobs)]
85 stdout=subprocess.DEVNULL)
96 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
112 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
117 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
118 kernel_path = os.path.join(build_dir, self._kernel_path)
119 qemu_command = ['qemu-system-' + self._qemu_arch,
120 '-nodefaults',
121 '-m', '1024',
122 '-kernel', kernel_path,
123 '-append', ' '.join(params + [self._kernel_command_line]),
124 '-no-reboot',
125 '-nographic',
126 '-serial', self._serial] + self._extra_qemu_params
131 stdout=subprocess.PIPE,
132 stderr=subprocess.STDOUT,
141 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
146 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
148 linux_bin = os.path.join(build_dir, 'linux')
153 stdout=subprocess.PIPE,
154 stderr=subprocess.STDOUT,
157 def get_kconfig_path(build_dir: str) -> str:
158 return os.path.join(build_dir, KCONFIG_PATH)
160 def get_kunitconfig_path(build_dir: str) -> str:
161 return os.path.join(build_dir, KUNITCONFIG_PATH)
163 def get_old_kunitconfig_path(build_dir: str) -> str:
164 return os.path.join(build_dir, OLD_KUNITCONFIG_PATH)
167 kunitconfig_paths: Optional[List[str]]=None) -> kunit_config.Kconfig:
169 path = get_kunitconfig_path(build_dir)
170 if not os.path.exists(path):
171 shutil.copyfile(DEFAULT_KUNITCONFIG_PATH, path)
172 return kunit_config.parse_file(path)
176 for path in kunitconfig_paths:
177 if os.path.isdir(path):
178 path = os.path.join(path, KUNITCONFIG_PATH)
179 if not os.path.exists(path):
180 raise ConfigError(f'Specified kunitconfig ({path}) does not exist')
182 partial = kunit_config.parse_file(path)
185 diff_str = '\n\n'.join(f'{a}\n vs from {path}\n{b}' for a, b in diff)
190 def get_outfile_path(build_dir: str) -> str:
191 return os.path.join(build_dir, OUTFILE_PATH)
193 def _default_qemu_config_path(arch: str) -> str:
194 config_path = os.path.join(QEMU_CONFIGS_DIR, arch + '.py')
195 if os.path.isfile(config_path):
198 options = [f[:-3] for f in os.listdir(QEMU_CONFIGS_DIR) if f.endswith('.py')]
203 cross_compile: Optional[str]) -> Tuple[str, LinuxSourceTreeOperations]:
204 # The module name/path has very little to do with where the actual file
212 module_path = '.' + os.path.join(os.path.basename(QEMU_CONFIGS_DIR), os.path.basename(config_path))
239 extra_qemu_args: Optional[List[str]]=None) -> None:
256 def arch(self) -> str:
259 def clean(self) -> bool:
267 def validate_config(self, build_dir: str) -> bool:
272 missing = set(self._kconfig.as_entries()) - set(validated_kconfig.as_entries())
278 'on a different architecture with something like "--arch=x86_64".'
282 def build_config(self, build_dir: str, make_options: Optional[List[str]]) -> bool:
284 if build_dir and not os.path.exists(build_dir):
297 if os.path.exists(old_path):
302 def _kunitconfig_changed(self, build_dir: str) -> bool:
304 if not os.path.exists(old_path):
310 def build_reconfig(self, build_dir: str, make_options: Optional[List[str]]) -> bool:
313 if not os.path.exists(kconfig_path):
326 def build_kernel(self, jobs: int, build_dir: str, make_options: Optional[List[str]]) -> bool:
335 …, filter: str='', filter_action: Optional[str]=None, timeout: Optional[int]=None) -> Iterator[str]:
347 assert process.stdout is not None # tell mypy it's set
350 def _wait_proc() -> None:
363 for line in process.stdout:
369 output.write(process.stdout.read())
371 process.stdout.close()
376 def signal_handler(self, unused_sig: int, unused_frame: Optional[FrameType]) -> None: