diff mbox series

[v2] runqemu: match .rootfs. in addition to -image- for rootfs

Message ID 20240104101437.2586980-1-mikko.rapeli@linaro.org
State Accepted, archived
Commit 107d0db3dc3678e6f0ae4035f4c0b86c6b421168
Headers show
Series [v2] runqemu: match .rootfs. in addition to -image- for rootfs | expand

Commit Message

Mikko Rapeli Jan. 4, 2024, 10:14 a.m. UTC
Also change path.exists() and !path.isdir() to a single
path.isfile() which should be equal.

Enables running tests against image recipes which are not called
"bla-image" but plain "bla". Currently they fail with do_testimage/runqemu
error:

runqemu - ERROR - Unknown path arg /home/builder/src/base/build/tmp_qemuarm64/deploy/images/qemuarm64/img-qemuarm64.rootfs.wic

Suggested-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 scripts/runqemu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

v2: check for both -image- and .rootfs. in file names as suggested by
    Richard Purdie <richard.purdie@linuxfoundation.org>, and using
    isfile() instead of both exists() and !isdir()

v1: https://lists.openembedded.org/g/openembedded-core/message/193280
diff mbox series

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index 18aeb7f5f0..9ed3ab17ac 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -373,7 +373,7 @@  class BaseConfig(object):
              re.search('zImage', p) or re.search('vmlinux', p) or \
              re.search('fitImage', p) or re.search('uImage', p):
             self.kernel =  p
-        elif os.path.exists(p) and (not os.path.isdir(p)) and '-image-' in os.path.basename(p):
+        elif os.path.isfile(p) and ('-image-' in os.path.basename(p) or '.rootfs.' in os.path.basename(p)):
             self.rootfs = p
             # Check filename against self.fstypes can handle <file>.cpio.gz,
             # otherwise, its type would be "gz", which is incorrect.