Commit b6b306e
committed
utils: Expand relative paths in get_full_kernel_path()
When attempting to use '-k .' with boot-uml.py, the following stacktrace
is observed:
$ .../boot-uml.py -k .
$ linux ubd0=.../boot-utils/images/x86_64/rootfs.ext4
Traceback (most recent call last):
File ".../boot-utils/boot-uml.py", line 82, in <module>
run_kernel(kernel, decomp_rootfs(), args.interactive)
File ".../boot-utils/boot-uml.py", line 75, in run_kernel
subprocess.run(uml_cmd, check=True)
File "/usr/lib/python3.11/subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.11/subprocess.py", line 1917, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: PosixPath('linux')
This is because subprocess.run() tries to locate the linux binary in
PATH, not the current directory.
Fix this by always returning an absolute path from
get_full_kernel_path(), so that subprocess.run() uses the correct
binary.
Closes: #103
Signed-off-by: Nathan Chancellor <nathan@kernel.org>1 parent aac8f35 commit b6b306e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
0 commit comments