Skip to contentSkip to conversation

runqemu: Disable vga with nographic

PATCH In review Khem Raj 2 participants 9 messages Feb 20, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 runqemu: Disable vga with nographic

When using nographic, explicitly disable vga since some qemu firmware ( OpenFirmware ) defaults to std vga, and when vga is enabled then it disables output to serial and redirects that to vga which is by design, hwoever we expect the console output to go to serial when using nographic, therefore its important to disable vga with nographic especially on qemu based ppc platforms

---
 scripts/runqemu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runqemu +1 -1
index dd92a64553..2e31338d8e 100755
@@ -462,7 +462,7 @@ class BaseConfig(object):
                     raise RunQemuError('Option nographic makes no sense alongside the sdl option.' % (arg))
                 if ('gtk' in sys.argv):
                     raise RunQemuError('Option nographic makes no sense alongside the gtk option.' % (arg))
-                self.qemu_opt_script += ' -nographic'
+                self.qemu_opt_script += ' -nographic -vga none'
                 self.kernel_cmdline_script += ' console=ttyS0'
             elif arg == 'sdl':
                 if 'gl' in sys.argv[1:]:
Signature · 1 line
2.30.1
author
#1 lore raw

PATCH 2/4 linuxloader: Deal with little-endian ppc64 ldso name

On ppc64le 'le' should be appended to ldso name

---
 meta/classes/linuxloader.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/linuxloader.bbclass +2 -2
index b161c51a50..30925ac87d 100644
@@ -9,8 +9,8 @@ def get_musl_loader_arch(d):
         ldso_arch = "mips${ABIEXTENSION}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}"
     elif targetarch == "powerpc":
         ldso_arch = "powerpc${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}"
-    elif targetarch == "powerpc64":
-        ldso_arch = "powerpc64"
+    elif targetarch.startswith("powerpc64"):
+        ldso_arch = "powerpc64${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'le', d)}"
     elif targetarch == "x86_64":
         ldso_arch = "x86_64"
     elif re.search("i.86", targetarch):
Signature · 1 line
2.30.1
author
#2 lore raw

PATCH 3/4 musl: Install /lib directory

In reply to Khem Raj

loader is installed into /lib and ${base_libdir} may not be always pointing to /lib, while here we want to create the directory where ldso will reside

---
 meta/recipes-core/musl/musl_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/musl/musl_git.bb +1 -1
index 562e80ae43..e6f9e2441e 100644
@@ -62,7 +62,7 @@ do_compile() {
 
 do_install() {
 	oe_runmake install DESTDIR='${D}'
-	install -d ${D}${bindir} ${D}${base_libdir} ${D}${sysconfdir}
+	install -d ${D}${bindir} ${D}/lib ${D}${sysconfdir}
         echo "${base_libdir}" > ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path
         echo "${libdir}" >> ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path
 	rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO}
Signature · 1 line
2.30.1
author
#3 lore raw

PATCH 4/4 goarch.bbclass: Fix ppc64le detection

In reply to Khem Raj

ppc64le should go above ppc64 in checks otherwise it gets subsumed wrongly with ppc64 check

---
 meta/classes/goarch.bbclass | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
meta/classes/goarch.bbclass +2 -5
index 1099b95769..73e13c0afe 100644
@@ -47,7 +47,6 @@ COMPATIBLE_HOST_linux-gnux32 = "null"
 COMPATIBLE_HOST_linux-muslx32 = "null"
 COMPATIBLE_HOST_powerpc = "null"
 COMPATIBLE_HOST_powerpc64 = "null"
-COMPATIBLE_HOST_powerpc64le = "null"
 COMPATIBLE_HOST_mipsarchn32 = "null"
 
 ARM_INSTRUCTION_SET_armv4 = "arm"
@@ -79,10 +78,10 @@ def go_map_arch(a, d):
         return 'mips'
     elif a == 'mipsel':
         return 'mipsle'
+    elif re.match('p(pc|owerpc)(64le)', a):
+        return 'ppc64le'
     elif re.match('p(pc|owerpc)(64)', a):
         return 'ppc64'
-    elif re.match('p(pc|owerpc)(64el)', a):
-        return 'ppc64le'
     elif a == 'riscv64':
         return 'riscv64'
     else:
@@ -115,5 +114,3 @@ def go_map_os(o, d):
     if o.startswith('linux'):
         return 'linux'
     return o
-
-
Signature · 1 line
2.30.1
#4 lore raw
In reply to Khem Raj

I don't think this is right. You might want to use -nographic, but still keep an emulated graphical device inside the guest for testing the userspace applications without seeing their output. It's better to set -vga none via a dedicated runqemu option.

Alex

Quoted 34 lines · Khem Raj

When using nographic, explicitly disable vga since some qemu firmware ( OpenFirmware ) defaults to std vga, and when vga is enabled then it disables output to serial and redirects that to vga which is by design, hwoever we expect the console output to go to serial when using nographic, therefore its important to disable vga with nographic especially on qemu based ppc platforms

---
 scripts/runqemu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runqemu +1 -1
index dd92a64553..2e31338d8e 100755
@@ -462,7 +462,7 @@ class BaseConfig(object):
                     raise RunQemuError('Option nographic makes no sense
 alongside the sdl option.' % (arg))
                 if ('gtk' in sys.argv):
                     raise RunQemuError('Option nographic makes no sense
 alongside the gtk option.' % (arg))
-                self.qemu_opt_script += ' -nographic'
+                self.qemu_opt_script += ' -nographic -vga none'
                 self.kernel_cmdline_script += ' console=ttyS0'
             elif arg == 'sdl':
                 if 'gl' in sys.argv[1:]:

--
2.30.1

author
#5 lore raw
Quoted 2 lines · Alexander Kanavin

I don't think this is right. You might want to use -nographic, but still keep an emulated graphical device inside the guest for testing the userspace applications without seeing their output. It's better to set -vga none via a dedicated runqemu option.

using -display none is better way to control this kind of behaviour where you still want graphic card to be emulated but not display the output. perhaps such an option would be better suited and nographic runqemu option can be used for qemu being a simple cmdline app.

Quoted 38 lines

Alex

On Sat, 20 Feb 2021 at 20:09, Khem Raj <[email protected] <mailto:[email protected]>> wrote:

    When using nographic, explicitly disable vga since some qemu firmware (
    OpenFirmware ) defaults to std vga, and when vga is enabled then it
    disables output to serial and redirects that to vga which is by design,
    hwoever we expect the console output to go to serial when using
    nographic, therefore its important to disable vga with nographic
    especially on qemu based ppc platforms

    Signed-off-by: Khem Raj <[email protected] <mailto:[email protected]>>
    ---
      scripts/runqemu | 2 +-
      1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/scripts/runqemu b/scripts/runqemu
    index dd92a64553..2e31338d8e 100755
    --- a/scripts/runqemu
    +++ b/scripts/runqemu
    @@ -462,7 +462,7 @@ class BaseConfig(object):
                          raise RunQemuError('Option nographic makes no
    sense alongside the sdl option.' % (arg))
                      if ('gtk' in sys.argv):
                          raise RunQemuError('Option nographic makes no
    sense alongside the gtk option.' % (arg))
    -                self.qemu_opt_script += ' -nographic'
    +                self.qemu_opt_script += ' -nographic -vga none'
                      self.kernel_cmdline_script += ' console=ttyS0'
                  elif arg == 'sdl':
                      if 'gl' in sys.argv[1:]:
    -- 
    2.30.1
#6 lore raw

What I am saying is that -nographic (where the output goes on the host) and -vga none (what hardware gets emulated in the guest) are independent, orthogonal options, and you should not bundle them together. It is a valid use case to have -nographic with emulated graphical hardware still enabled.

Alex

Quoted 56 lines · Khem Raj
Quoted 4 lines · Alexander Kanavin

I don't think this is right. You might want to use -nographic, but still keep an emulated graphical device inside the guest for testing the userspace applications without seeing their output. It's better to set -vga none via a dedicated runqemu option.

using -display none is better way to control this kind of behaviour where you still want graphic card to be emulated but not display the output. perhaps such an option would be better suited and nographic runqemu option can be used for qemu being a simple cmdline app.

Quoted 7 lines

Alex

On Sat, 20 Feb 2021 at 20:09, Khem Raj <[email protected] <mailto:[email protected]>> wrote:

When using nographic, explicitly disable vga since some qemu

firmware (

Quoted 2 lines

OpenFirmware ) defaults to std vga, and when vga is enabled then it disables output to serial and redirects that to vga which is by

design,

Quoted 5 lines

hwoever we expect the console output to go to serial when using nographic, therefore its important to disable vga with nographic especially on qemu based ppc platforms

[email protected]>>

Quoted 25 lines
    ---
      scripts/runqemu | 2 +-
      1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/scripts/runqemu b/scripts/runqemu
    index dd92a64553..2e31338d8e 100755
    --- a/scripts/runqemu
    +++ b/scripts/runqemu
    @@ -462,7 +462,7 @@ class BaseConfig(object):
                          raise RunQemuError('Option nographic makes no
    sense alongside the sdl option.' % (arg))
                      if ('gtk' in sys.argv):
                          raise RunQemuError('Option nographic makes no
    sense alongside the gtk option.' % (arg))
    -                self.qemu_opt_script += ' -nographic'
    +                self.qemu_opt_script += ' -nographic -vga none'
                      self.kernel_cmdline_script += ' console=ttyS0'
                  elif arg == 'sdl':
                      if 'gl' in sys.argv[1:]:
    --
    2.30.1
author
#7 lore raw
Quoted 1 line · Alexander Kanavin

What I am saying is that -nographic (where the output goes on the host) and -vga none (what hardware gets emulated in the guest) are independent, orthogonal options, and you should not bundle them together. It is a valid use case to have -nographic with emulated graphical hardware still enabled.

I think I understood what you mean, I was suggesting to not translate runqemu option 'nographic' one to one to qemu option -nographic but still address the usecase you are bringing up with another option on the line like sdl, gtk options we have

Quoted 68 lines

Alex

On Sat, 20 Feb 2021 at 21:03, Khem Raj <[email protected] <mailto:[email protected]>> wrote:

On 2/20/21 11:20 AM, Alexander Kanavin wrote:
> I don't think this is right. You might want to use -nographic,
but still
> keep an emulated graphical device inside the guest for testing the > userspace applications without seeing their output. It's better
to set
> -vga none via a dedicated runqemu option.

using -display none is better way to control this kind of behaviour where you still want graphic card to be emulated but not display the output. perhaps such an option would be better suited and nographic runqemu option can be used for qemu being a simple cmdline app.

>
> Alex
>
> On Sat, 20 Feb 2021 at 20:09, Khem Raj <[email protected]
<mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>
>     When using nographic, explicitly disable vga since some qemu
firmware (
>     OpenFirmware ) defaults to std vga, and when vga is enabled
then it
>     disables output to serial and redirects that to vga which is
by design,
>     hwoever we expect the console output to go to serial when using >     nographic, therefore its important to disable vga with nographic >     especially on qemu based ppc platforms
>
>     Signed-off-by: Khem Raj <[email protected]
<mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>>
>     ---
>       scripts/runqemu | 2 +-
>       1 file changed, 1 insertion(+), 1 deletion(-)
>
>     diff --git a/scripts/runqemu b/scripts/runqemu
>     index dd92a64553..2e31338d8e 100755
>     --- a/scripts/runqemu
>     +++ b/scripts/runqemu
>     @@ -462,7 +462,7 @@ class BaseConfig(object):
>                           raise RunQemuError('Option nographic
makes no
>     sense alongside the sdl option.' % (arg))
>                       if ('gtk' in sys.argv):
>                           raise RunQemuError('Option nographic
makes no
>     sense alongside the gtk option.' % (arg))
>     -                self.qemu_opt_script += ' -nographic' >     +                self.qemu_opt_script += ' -nographic -vga none' >                       self.kernel_cmdline_script += ' console=ttyS0' >                   elif arg == 'sdl':
>                       if 'gl' in sys.argv[1:]:
>     --
>     2.30.1
>
>
>
>

#8 lore raw

How about you simply add novga option to runqemu?

Alex

Quoted 88 lines · Khem Raj
Quoted 5 lines · Alexander Kanavin

What I am saying is that -nographic (where the output goes on the host) and -vga none (what hardware gets emulated in the guest) are independent, orthogonal options, and you should not bundle them together. It is a valid use case to have -nographic with emulated graphical hardware still enabled.

I think I understood what you mean, I was suggesting to not translate runqemu option 'nographic' one to one to qemu option -nographic but still address the usecase you are bringing up with another option on the line like sdl, gtk options we have

Quoted 21 lines

Alex

On Sat, 20 Feb 2021 at 21:03, Khem Raj <[email protected] <mailto:[email protected]>> wrote:

On 2/20/21 11:20 AM, Alexander Kanavin wrote:
> I don't think this is right. You might want to use -nographic,
but still
> keep an emulated graphical device inside the guest for testing the > userspace applications without seeing their output. It's better
to set
> -vga none via a dedicated runqemu option.

using -display none is better way to control this kind of behaviour where you still want graphic card to be emulated but not display the output. perhaps such an option would be better suited and nographic runqemu option can be used for qemu being a simple cmdline app.

Quoted 14 lines

>
> Alex
>
> On Sat, 20 Feb 2021 at 20:09, Khem Raj <[email protected]
<mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>
> When using nographic, explicitly disable vga since some qemu
firmware (
> OpenFirmware ) defaults to std vga, and when vga is enabled
then it
> disables output to serial and redirects that to vga which is
by design,
> hwoever we expect the console output to go to serial when

using

Quoted 1 line

> nographic, therefore its important to disable vga with

nographic

Quoted 15 lines

> especially on qemu based ppc platforms
>
> Signed-off-by: Khem Raj <[email protected]
<mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>>
> ---
> scripts/runqemu | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index dd92a64553..2e31338d8e 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -462,7 +462,7 @@ class BaseConfig(object):
> raise RunQemuError('Option nographic

Quoted 8 lines

makes no
> sense alongside the sdl option.' % (arg))
> if ('gtk' in sys.argv):
> raise RunQemuError('Option nographic
makes no
> sense alongside the gtk option.' % (arg))
> - self.qemu_opt_script += ' -nographic'
> + self.qemu_opt_script += ' -nographic -vga

none'

Quoted 1 line
     >                       self.kernel_cmdline_script += '

console=ttyS0'

Quoted 9 lines
     >                   elif arg == 'sdl':
     >                       if 'gl' in sys.argv[1:]:
     >     --
     >     2.30.1
     >
     >
     >     
     >