diff mbox series

[V2] runqemu: fix special characters bug

Message ID 20250806024254.3399945-1-libo.chen.cn@windriver.com
State New
Headers show
Series [V2] runqemu: fix special characters bug | expand

Commit Message

Chen, Libo (CN) Aug. 6, 2025, 2:42 a.m. UTC
From: Libo Chen <libo.chen.cn@windriver.com>

Fix the bug in runqemu that happens when the file path contains
the specific words such as 'vmlinux', e.g. /home/frank/vmlinux.

runqemu - ERROR - wic doesn't need kernel

Signed-off-by: Libo Chen <libo.chen.cn@windriver.com>
---
 scripts/runqemu | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Alexander Kanavin Aug. 6, 2025, 6:45 a.m. UTC | #1
Thanks, this looks fine.

Alex

On Wed, 6 Aug 2025 at 04:42, Chen, Libo (CN) via
lists.openembedded.org
<libo.chen.cn=windriver.com@lists.openembedded.org> wrote:
>
> From: Libo Chen <libo.chen.cn@windriver.com>
>
> Fix the bug in runqemu that happens when the file path contains
> the specific words such as 'vmlinux', e.g. /home/frank/vmlinux.
>
> runqemu - ERROR - wic doesn't need kernel
>
> Signed-off-by: Libo Chen <libo.chen.cn@windriver.com>
> ---
>  scripts/runqemu | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 2ab36fd03d..f189dbfb60 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -368,12 +368,13 @@ class BaseConfig(object):
>          - Check whether it is an NFS dir
>          - Check whether it is an OVMF flash file
>          """
> +        n = os.path.basename(p)
>          if p.endswith('.qemuboot.conf'):
>              self.qemuboot = p
>              self.qbconfload = True
> -        elif re.search('\\.bin$', p) or re.search('bzImage', p) or \
> -             re.search('zImage', p) or re.search('vmlinux', p) or \
> -             re.search('fitImage', p) or re.search('uImage', p):
> +        elif re.search('\\.bin$', n) or re.search('bzImage', n) or \
> +             re.search('zImage', n) or re.search('vmlinux', n) or \
> +             re.search('fitImage', n) or re.search('uImage', n):
>              self.kernel =  p
>          elif os.path.isfile(p) and ('-image-' in os.path.basename(p) or '.rootfs.' in os.path.basename(p)):
>              self.rootfs = p
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#221496): https://lists.openembedded.org/g/openembedded-core/message/221496
> Mute This Topic: https://lists.openembedded.org/mt/114560389/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index 2ab36fd03d..f189dbfb60 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -368,12 +368,13 @@  class BaseConfig(object):
         - Check whether it is an NFS dir
         - Check whether it is an OVMF flash file
         """
+        n = os.path.basename(p)
         if p.endswith('.qemuboot.conf'):
             self.qemuboot = p
             self.qbconfload = True
-        elif re.search('\\.bin$', p) or re.search('bzImage', p) or \
-             re.search('zImage', p) or re.search('vmlinux', p) or \
-             re.search('fitImage', p) or re.search('uImage', p):
+        elif re.search('\\.bin$', n) or re.search('bzImage', n) or \
+             re.search('zImage', n) or re.search('vmlinux', n) or \
+             re.search('fitImage', n) or re.search('uImage', n):
             self.kernel =  p
         elif os.path.isfile(p) and ('-image-' in os.path.basename(p) or '.rootfs.' in os.path.basename(p)):
             self.rootfs = p