All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] scripts/runqemu: Be more loose when guessing QB_SYSTEM_NAME variable
@ 2016-09-27 18:27 California Sullivan
  2016-09-27 18:59 ` Joshua Lock
  0 siblings, 1 reply; 3+ messages in thread
From: California Sullivan @ 2016-09-27 18:27 UTC (permalink / raw)
  To: openembedded-core; +Cc: joshua.g.lock

Following the instructions to reproduce YOCTO #10026 I found that
runqemu would fail to start because QB_SYSTEM_NAME is null. This patch
makes the guessing algorithm more loose allowing it to correctly guess
the variable from the MACHINE name.

It is still a good assumption that if it contains "qemux86-64" for
example, that the system is x86-64, so this is unlikely to cause any
new issues while preserving some peoples' old workflows.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 scripts/runqemu | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 45bcad7..b06d09e 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -870,20 +870,20 @@ class BaseConfig(object):
         if not mach:
             return None
 
-        if mach == 'qemuarm':
-            qbsys = 'arm'
-        elif mach == 'qemuarm64':
+        elif 'qemuarm64' in mach:
             qbsys = 'aarch64'
-        elif mach == 'qemux86':
-            qbsys = 'i386'
-        elif mach == 'qemux86-64':
+        if 'qemuarm' in mach:
+            qbsys = 'arm'
+        elif 'qemux86-64' in mach:
             qbsys = 'x86_64'
-        elif mach == 'qemuppc':
+        elif 'qemux86' in mach:
+            qbsys = 'i386'
+        elif 'qemuppc' in mach:
             qbsys = 'ppc'
-        elif mach == 'qemumips':
-            qbsys = 'mips'
-        elif mach == 'qemumips64':
+        elif 'qemumips64' in mach:
             qbsys = 'mips64'
+        elif 'qemumips' in mach:
+            qbsys = 'mips'
 
         return 'qemu-system-%s' % qbsys
 
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC] scripts/runqemu: Be more loose when guessing QB_SYSTEM_NAME variable
  2016-09-27 18:27 [PATCH RFC] scripts/runqemu: Be more loose when guessing QB_SYSTEM_NAME variable California Sullivan
@ 2016-09-27 18:59 ` Joshua Lock
  2016-09-27 19:51   ` Cal Sullivan
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Lock @ 2016-09-27 18:59 UTC (permalink / raw)
  To: California Sullivan, openembedded-core

On Tue, 2016-09-27 at 11:27 -0700, California Sullivan wrote:
> Following the instructions to reproduce YOCTO #10026 I found that
> runqemu would fail to start because QB_SYSTEM_NAME is null. This
> patch
> makes the guessing algorithm more loose allowing it to correctly
> guess
> the variable from the MACHINE name.

Out of interest can you help me understand how/when the current code
fails?

> 
> It is still a good assumption that if it contains "qemux86-64" for
> example, that the system is x86-64, so this is unlikely to cause any
> new issues while preserving some peoples' old workflows.
> 
> Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
> ---
>  scripts/runqemu | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 45bcad7..b06d09e 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -870,20 +870,20 @@ class BaseConfig(object):
>          if not mach:
>              return None
>  
> -        if mach == 'qemuarm':
> -            qbsys = 'arm'
> -        elif mach == 'qemuarm64':
> +        elif 'qemuarm64' in mach:

This elif should be below the "if 'qemuarm' in mach" below which begins
the control flow statements for determining the value to assign to the
qbsys variable.

>              qbsys = 'aarch64'
> -        elif mach == 'qemux86':
> -            qbsys = 'i386'
> -        elif mach == 'qemux86-64':
> +        if 'qemuarm' in mach:
> +            qbsys = 'arm'
> +        elif 'qemux86-64' in mach:
>              qbsys = 'x86_64'
> -        elif mach == 'qemuppc':
> +        elif 'qemux86' in mach:
> +            qbsys = 'i386'
> +        elif 'qemuppc' in mach:
>              qbsys = 'ppc'
> -        elif mach == 'qemumips':
> -            qbsys = 'mips'
> -        elif mach == 'qemumips64':
> +        elif 'qemumips64' in mach:
>              qbsys = 'mips64'
> +        elif 'qemumips' in mach:
> +            qbsys = 'mips'
>  
>          return 'qemu-system-%s' % qbsys
>  
> -- 
> 2.5.5
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC] scripts/runqemu: Be more loose when guessing QB_SYSTEM_NAME variable
  2016-09-27 18:59 ` Joshua Lock
@ 2016-09-27 19:51   ` Cal Sullivan
  0 siblings, 0 replies; 3+ messages in thread
From: Cal Sullivan @ 2016-09-27 19:51 UTC (permalink / raw)
  To: Joshua Lock, openembedded-core



On 09/27/2016 11:59 AM, Joshua Lock wrote:
> On Tue, 2016-09-27 at 11:27 -0700, California Sullivan wrote:
>> Following the instructions to reproduce YOCTO #10026 I found that
>> runqemu would fail to start because QB_SYSTEM_NAME is null. This
>> patch
>> makes the guessing algorithm more loose allowing it to correctly
>> guess
>> the variable from the MACHINE name.
> Out of interest can you help me understand how/when the current code
> fails?
I ran into this following the instructions on the first post here: 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10026

We create a bsp layer called myqemux86-64 that gets a x86-64 
architecture and MACHINE named myqemux86-64. There is no qemuboot.conf 
file generated so it has to try and guess the variable. In the guessing 
function mach gets assigned myqemux86-64, which doesn't match to any of 
the machines directly, so it bails out.

Ultimately the failure probably isn't with runqemu, but the yocto-bsp 
scripts not supporting the new runqemu. Unfortunately I have no 
experience with either part of the system, so I took the path of least 
resistance to quickly get it working again (hence the RFC).

>
>> It is still a good assumption that if it contains "qemux86-64" for
>> example, that the system is x86-64, so this is unlikely to cause any
>> new issues while preserving some peoples' old workflows.
>>
>> Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
>> ---
>>   scripts/runqemu | 20 ++++++++++----------
>>   1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/scripts/runqemu b/scripts/runqemu
>> index 45bcad7..b06d09e 100755
>> --- a/scripts/runqemu
>> +++ b/scripts/runqemu
>> @@ -870,20 +870,20 @@ class BaseConfig(object):
>>           if not mach:
>>               return None
>>   
>> -        if mach == 'qemuarm':
>> -            qbsys = 'arm'
>> -        elif mach == 'qemuarm64':
>> +        elif 'qemuarm64' in mach:
> This elif should be below the "if 'qemuarm' in mach" below which begins
> the control flow statements for determining the value to assign to the
> qbsys variable.
Oops, you are correct. I very quickly reordered them to account for 
having to check the longer mach names first and missed that. I will fix 
it on a V2 if we decide to use this.

Thanks,
Cal

>
>>               qbsys = 'aarch64'
>> -        elif mach == 'qemux86':
>> -            qbsys = 'i386'
>> -        elif mach == 'qemux86-64':
>> +        if 'qemuarm' in mach:
>> +            qbsys = 'arm'
>> +        elif 'qemux86-64' in mach:
>>               qbsys = 'x86_64'
>> -        elif mach == 'qemuppc':
>> +        elif 'qemux86' in mach:
>> +            qbsys = 'i386'
>> +        elif 'qemuppc' in mach:
>>               qbsys = 'ppc'
>> -        elif mach == 'qemumips':
>> -            qbsys = 'mips'
>> -        elif mach == 'qemumips64':
>> +        elif 'qemumips64' in mach:
>>               qbsys = 'mips64'
>> +        elif 'qemumips' in mach:
>> +            qbsys = 'mips'
>>   
>>           return 'qemu-system-%s' % qbsys
>>   
>> -- 
>> 2.5.5
>>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-27 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-27 18:27 [PATCH RFC] scripts/runqemu: Be more loose when guessing QB_SYSTEM_NAME variable California Sullivan
2016-09-27 18:59 ` Joshua Lock
2016-09-27 19:51   ` Cal Sullivan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.