• Home
  • Raw
  • Download

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:
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:
111 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
116 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
117 kernel_path = os.path.join(build_dir, self._kernel_path)
118 qemu_command = ['qemu-system-' + self._qemu_arch,
119 '-nodefaults',
120 '-m', '1024',
121 '-kernel', kernel_path,
122 '-append', ' '.join(params + [self._kernel_command_line]),
123 '-no-reboot',
124 '-nographic',
125 '-serial', self._serial] + self._extra_qemu_params
130 stdout=subprocess.PIPE,
131 stderr=subprocess.STDOUT,
140 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig:
145 def start(self, params: List[str], build_dir: str) -> subprocess.Popen:
147 linux_bin = os.path.join(build_dir, 'linux')
151 stdout=subprocess.PIPE,
152 stderr=subprocess.STDOUT,
155 def get_kconfig_path(build_dir: str) -> str:
156 return os.path.join(build_dir, KCONFIG_PATH)
158 def get_kunitconfig_path(build_dir: str) -> str:
159 return os.path.join(build_dir, KUNITCONFIG_PATH)
161 def get_old_kunitconfig_path(build_dir: str) -> str:
162 return os.path.join(build_dir, OLD_KUNITCONFIG_PATH)
165 kunitconfig_paths: Optional[List[str]]=None) -> kunit_config.Kconfig:
167 path = get_kunitconfig_path(build_dir)
168 if not os.path.exists(path):
169 shutil.copyfile(DEFAULT_KUNITCONFIG_PATH, path)
170 return kunit_config.parse_file(path)
174 for path in kunitconfig_paths:
175 if os.path.isdir(path):
176 path = os.path.join(path, KUNITCONFIG_PATH)
177 if not os.path.exists(path):
178 raise ConfigError(f'Specified kunitconfig ({path}) does not exist')
180 partial = kunit_config.parse_file(path)
183 diff_str = '\n\n'.join(f'{a}\n vs from {path}\n{b}' for a, b in diff)
188 def get_outfile_path(build_dir: str) -> str:
189 return os.path.join(build_dir, OUTFILE_PATH)
191 def _default_qemu_config_path(arch: str) -> str:
192 config_path = os.path.join(QEMU_CONFIGS_DIR, arch + '.py')
193 if os.path.isfile(config_path):
196 options = [f[:-3] for f in os.listdir(QEMU_CONFIGS_DIR) if f.endswith('.py')]
201 cross_compile: Optional[str]) -> Tuple[str, LinuxSourceTreeOperations]:
202 # The module name/path has very little to do with where the actual file
210 module_path = '.' + os.path.join(os.path.basename(QEMU_CONFIGS_DIR), os.path.basename(config_path))
237 extra_qemu_args: Optional[List[str]]=None) -> None:
254 def arch(self) -> str:
257 def clean(self) -> bool:
265 def validate_config(self, build_dir: str) -> bool:
270 missing = set(self._kconfig.as_entries()) - set(validated_kconfig.as_entries())
276 'on a different architecture with something like "--arch=x86_64".'
280 def build_config(self, build_dir: str, make_options: Optional[List[str]]) -> bool:
282 if build_dir and not os.path.exists(build_dir):
295 if os.path.exists(old_path):
300 def _kunitconfig_changed(self, build_dir: str) -> bool:
302 if not os.path.exists(old_path):
308 def build_reconfig(self, build_dir: str, make_options: Optional[List[str]]) -> bool:
311 if not os.path.exists(kconfig_path):
324 def build_kernel(self, jobs: int, build_dir: str, make_options: Optional[List[str]]) -> bool:
333 …, filter: str='', filter_action: Optional[str]=None, timeout: Optional[int]=None) -> Iterator[str]:
345 assert process.stdout is not None # tell mypy it's set
348 def _wait_proc() -> None:
361 for line in process.stdout:
367 output.write(process.stdout.read())
369 process.stdout.close()
374 def signal_handler(self, unused_sig: int, unused_frame: Optional[FrameType]) -> None: