Skip to content

Commit b6b306e

Browse files
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

File tree

utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def get_full_kernel_path(kernel_location, image, arch=None):
9090
if not kernel.exists():
9191
die(f"Kernel ('{kernel}') does not exist!")
9292

93-
return kernel
93+
return kernel.resolve()
9494

9595

9696
def green(string):

0 commit comments

Comments
 (0)