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:
114 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
119 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
120 kernel_path = os.path.join(build_dir, self._kernel_path)
121 qemu_command = ['qemu-system-' + self._qemu_arch,
122 '-nodefaults',
123 '-m', '1024',
124 '-kernel', kernel_path,
125 '-append', ' '.join(params + [self._kernel_command_line]),
126 '-no-reboot',
127 '-nographic',
128 '-accel', 'kvm',
129 '-accel', 'hvf',
130 '-accel', 'tcg',
131 '-serial', self._serial] + self._extra_qemu_params
136 stdout=subprocess.PIPE,
137 stderr=subprocess.STDOUT,
146 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
151 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
153 linux_bin = os.path.join(build_dir, 'linux')
158 stdout=subprocess.PIPE,
159 stderr=subprocess.STDOUT,
162 def get_kconfig_path(build_dir: str) -> str:
163 return os.path.join(build_dir, KCONFIG_PATH)
165 def get_kunitconfig_path(build_dir: str) -> str:
166 return os.path.join(build_dir, KUNITCONFIG_PATH)
168 def get_old_kunitconfig_path(build_dir: str) -> str:
169 return os.path.join(build_dir, OLD_KUNITCONFIG_PATH)
172 kunitconfig_paths: Optional[List[str]]=None) -> kunit_config.Kconfig:
174 path = get_kunitconfig_path(build_dir)
175 if not os.path.exists(path):
176 shutil.copyfile(DEFAULT_KUNITCONFIG_PATH, path)
177 return kunit_config.parse_file(path)
181 for path in kunitconfig_paths:
182 if os.path.isdir(path):
183 path = os.path.join(path, KUNITCONFIG_PATH)
184 if not os.path.exists(path):
185 raise ConfigError(f'Specified kunitconfig ({path}) does not exist')
187 partial = kunit_config.parse_file(path)
190 diff_str = '\n\n'.join(f'{a}\n vs from {path}\n{b}' for a, b in diff)
195 def get_outfile_path(build_dir: str) -> str:
196 return os.path.join(build_dir, OUTFILE_PATH)
198 def _default_qemu_config_path(arch: str) -> str:
199 config_path = os.path.join(QEMU_CONFIGS_DIR, arch + '.py')
200 if os.path.isfile(config_path):
203 options = [f[:-3] for f in os.listdir(QEMU_CONFIGS_DIR) if f.endswith('.py')]
208 cross_compile: Optional[str]) -> Tuple[str, LinuxSourceTreeOperations]:
209 # The module name/path has very little to do with where the actual file
217 module_path = '.' + os.path.join(os.path.basename(QEMU_CONFIGS_DIR), os.path.basename(config_path))
244 extra_qemu_args: Optional[List[str]]=None) -> None:
261 def arch(self) -> str:
264 def clean(self) -> bool:
272 def validate_config(self, build_dir: str) -> bool:
277 missing = set(self._kconfig.as_entries()) - set(validated_kconfig.as_entries())
283 'on a different architecture with something like "--arch=x86_64".'
287 def build_config(self, build_dir: str, make_options: Optional[List[str]]) -> bool:
289 if build_dir and not os.path.exists(build_dir):
302 if os.path.exists(old_path):
307 def _kunitconfig_changed(self, build_dir: str) -> bool:
309 if not os.path.exists(old_path):
315 def build_reconfig(self, build_dir: str, make_options: Optional[List[str]]) -> bool:
318 if not os.path.exists(kconfig_path):
331 def build_kernel(self, jobs: int, build_dir: str, make_options: Optional[List[str]]) -> bool:
340 …, filter: str='', filter_action: Optional[str]=None, timeout: Optional[int]=None) -> Iterator[str]:
352 assert process.stdout is not None # tell mypy it's set
355 def _wait_proc() -> None:
368 for line in process.stdout:
374 output.write(process.stdout.read())
376 process.stdout.close()
381 def signal_handler(self, unused_sig: int, unused_frame: Optional[FrameType]) -> None: