Skip to contentSkip to conversation

rpm: resolve a host contamination issue for mono packaging

PATCH In review Alexander Kanavin 2 participants 6 messages Aug 28, 2019 – Aug 30, 2019 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 rpm: resolve a host contamination issue for mono packaging

This is perhaps not the most elegant patch but it be dropped once rpm is updated to the soon-to-be-released version 4.15 where upstream has removed mono dependency resolution altogether.

---
 ...es-requires-do-not-use-monodis-from-.patch | 58 +++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_4.14.2.1.bb     |  1 +
 2 files changed, 59 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm/files/0001-mono-find-provides-requires-do-not-use-monodis-from-.patch
meta/recipes-devtools/rpm/files/0001-mono-find-provides-requires-do-not-use-monodis-from-.patch new file +58 -0
new file mode 100644
index 00000000000..24aa4c7ffff
@@ -0,0 +1,58 @@
+From 43fbc3f53302a395463e8450ac81c53f623eec3f Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Tue, 27 Aug 2019 17:42:34 +0200
+Subject: [PATCH] mono-find-provides/requires: do not use monodis from the host
+
+There was a host contamination issue here: if monodis was installed
+on the host, do_package would use that to resolve dependencies
+of mono libraries (and often fail in that). Without monodis,
+no dependencies are resolved, which is seemingly how things
+are supposed to work.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <[email protected]>
+---
+ scripts/mono-find-provides | 8 ++++----
+ scripts/mono-find-requires | 8 ++++----
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/scripts/mono-find-provides b/scripts/mono-find-provides
+index 9348457d3..b28872ffb 100644
+--- a/scripts/mono-find-provides
++++ b/scripts/mono-find-provides
+@@ -18,11 +18,11 @@ monolist=($(printf "%s\n" "${filelist[@]}" | grep -E "\\.(exe|dll)\$"))
+ build_bindir="$2/usr/bin"
+ build_libdir="$2$3"
+ 
+-if [ -x $build_bindir/monodis ]; then
+-    monodis="$build_bindir/monodis"
++if [ -x $build_bindir/monodis.bogus ]; then
++    monodis="$build_bindir/monodis.bogus"
+     export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+-elif [ -x /usr/bin/monodis ]; then
+-    monodis="/usr/bin/monodis"
++elif [ -x /usr/bin/monodis.bogus ]; then
++    monodis="/usr/bin/monodis.bogus"
+ else
+     exit 0;
+ fi
+diff --git a/scripts/mono-find-requires b/scripts/mono-find-requires
+index ea58cae48..d270169e1 100644
+--- a/scripts/mono-find-requires
++++ b/scripts/mono-find-requires
+@@ -18,11 +18,11 @@ monolist=($(printf "%s\n" "${filelist[@]}" | grep -E "\\.(exe|dll)\$"))
+ build_bindir="$2/usr/bin"
+ build_libdir="$2$3"
+ 
+-if [ -x $build_bindir/monodis ]; then
+-    monodis="$build_bindir/monodis"
++if [ -x $build_bindir/monodis.bogus ]; then
++    monodis="$build_bindir/monodis.bogus"
+     export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+-elif [ -x /usr/bin/monodis ]; then
+-    monodis="/usr/bin/monodis"
++elif [ -x /usr/bin/monodis.bogus ]; then
++    monodis="/usr/bin/monodis.bogus"
+ else
+     exit 0;
+ fi
meta/recipes-devtools/rpm/rpm_4.14.2.1.bb +1 -0
index 063f4269a57..c37330eb4c6 100644
@@ -41,6 +41,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \
            file://0001-perl-disable-auto-reqs.patch \
            file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \
            file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \
+           file://0001-mono-find-provides-requires-do-not-use-monodis-from-.patch \
            "
 
 PE = "1"
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/4 qemu: set default RAM to 256M for all machines

There was a discussion about what amount of RAM is appropriate for a default; the outcome was that for now it is still 256M. Some qemu machine definitions have however set this to 512M so for the sake of treating all architectures fairly, they are reset back to 256M.

Also runqemu is adjusted to use 256M if QB_MEM is not set at all.

http://lists.openembedded.org/pipermail/openembedded-core/2019-August/285900.html

---
 meta/conf/machine/include/qemuboot-mips.inc   | 1 -
 meta/conf/machine/include/riscv/qemuriscv.inc | 1 -
 meta/conf/machine/qemuarm.conf                | 1 -
 meta/conf/machine/qemuarm64.conf              | 1 -
 scripts/runqemu                               | 4 ++--
 5 files changed, 2 insertions(+), 6 deletions(-)
meta/conf/machine/include/qemuboot-mips.inc +0 -1
index a5f9ed821f4..1c2b532b482 100644
@@ -1,6 +1,5 @@
 # For runqemu
 IMAGE_CLASSES += "qemuboot"
-QB_MEM = "-m 256"
 QB_MACHINE = "-machine malta"
 QB_KERNEL_CMDLINE_APPEND = "console=ttyS0 console=tty"
 QB_OPT_APPEND = "-vga cirrus -show-cursor -usb -device usb-tablet"
meta/conf/machine/include/riscv/qemuriscv.inc +0 -1
index f1cb62818b7..952779e98e8 100644
@@ -24,7 +24,6 @@ UBOOT_ENTRYPOINT_riscv64 = "0x80200000"
 
 # qemuboot options
 QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi"
-QB_MEM = "-m 512"
 QB_MACHINE = "-machine virt"
 QB_DEFAULT_BIOS = "fw_jump.elf"
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
meta/conf/machine/qemuarm.conf +0 -1
index 0a2c9953125..26f40b14194 100644
@@ -11,7 +11,6 @@ SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0"
 
 # For runqemu
 QB_SYSTEM_NAME = "qemu-system-arm"
-QB_MEM = "-m 512"
 QB_MACHINE = "-machine virt"
 QB_CPU = "-cpu cortex-a15"
 # Standard Serial console
meta/conf/machine/qemuarm64.conf +0 -1
index 353ac927d94..ec2a887bddf 100644
@@ -11,7 +11,6 @@ SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0"
 
 # For runqemu
 QB_SYSTEM_NAME = "qemu-system-aarch64"
-QB_MEM = "-m 512"
 QB_MACHINE = "-machine virt"
 QB_CPU = "-cpu cortex-a57"
 QB_CPU_KVM = "-cpu host"
scripts/runqemu +2 -2
index e9b83737cbf..7705b2b60e3 100755
@@ -755,8 +755,8 @@ class BaseConfig(object):
         if s:
             self.set('QB_MEM', '-m %s' % s.group(1))
         elif not self.get('QB_MEM'):
-            logger.info('QB_MEM is not set, use 512M by default')
-            self.set('QB_MEM', '-m 512')
+            logger.info('QB_MEM is not set, use 256M by default')
+            self.set('QB_MEM', '-m 256')
 
         # Check and remove M or m suffix
         qb_mem = self.get('QB_MEM')
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/4 qemu: switch to '-vga std' emulated hardware from vmware/cirrus for x86/mips

In reply to Alexander Kanavin

This is the qemu default since qemu 2.2, is generally supported better, and is recommended by upstream. It also has already been in use for arm/risc and ovmf.

Additional information:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13466
https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/

'-vga virtio' emulated hardware remains in use when virgl is enabled via a runqemu override.

Also, adjust the error whitelist, as there is a number of new messages coming from the drivers that are not actual errors.

---
 meta/conf/machine/include/qemuboot-mips.inc | 2 +-
 meta/conf/machine/include/qemuboot-x86.inc  | 2 +-
 meta/conf/machine/qemuarm.conf              | 2 +-
 meta/conf/machine/qemuarm64.conf            | 2 +-
 meta/conf/machine/qemux86-64.conf           | 1 +
 meta/conf/machine/qemux86.conf              | 1 +
 meta/lib/oeqa/runtime/cases/parselogs.py    | 6 +++++-
 scripts/runqemu                             | 6 ------
 8 files changed, 11 insertions(+), 11 deletions(-)
meta/conf/machine/include/qemuboot-mips.inc +1 -1
index 1c2b532b482..978820a2e0b 100644
@@ -2,6 +2,6 @@
 IMAGE_CLASSES += "qemuboot"
 QB_MACHINE = "-machine malta"
 QB_KERNEL_CMDLINE_APPEND = "console=ttyS0 console=tty"
-QB_OPT_APPEND = "-vga cirrus -show-cursor -usb -device usb-tablet"
+QB_OPT_APPEND = "-show-cursor -usb -device usb-tablet"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
meta/conf/machine/include/qemuboot-x86.inc +1 -1
index 3931b0f0fb3..495418fa04b 100644
@@ -9,7 +9,7 @@ QB_CPU_KVM_x86-64 = "-cpu core2duo"
 QB_AUDIO_DRV = "alsa"
 QB_AUDIO_OPT = "-soundhw ac97,es1370"
 QB_KERNEL_CMDLINE_APPEND = "vga=0 uvesafb.mode_option=${UVESA_MODE} oprofile.timer=1 uvesafb.task_timeout=-1"
-QB_OPT_APPEND = "-vga vmware -show-cursor -usb -device usb-tablet"
+QB_OPT_APPEND = "-show-cursor -usb -device usb-tablet"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
 
meta/conf/machine/qemuarm.conf +1 -1
index 26f40b14194..49daa7c6ef6 100644
@@ -16,7 +16,7 @@ QB_CPU = "-cpu cortex-a15"
 # Standard Serial console
 QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0"
 # For graphics to work we need to define the VGA device as well as the necessary USB devices
-QB_OPT_APPEND = "-show-cursor -device VGA,edid=on"
+QB_OPT_APPEND = "-show-cursor"
 QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Add the virtio RNG
 QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
meta/conf/machine/qemuarm64.conf +1 -1
index ec2a887bddf..05f0ee5e66f 100644
@@ -17,7 +17,7 @@ QB_CPU_KVM = "-cpu host"
 # Standard Serial console
 QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0"
 # For graphics to work we need to define the VGA device as well as the necessary USB devices
-QB_OPT_APPEND = "-show-cursor -device VGA,edid=on"
+QB_OPT_APPEND = "-show-cursor"
 QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
meta/conf/machine/qemux86-64.conf +1 -0
index 4b50e664e42..7c70dbddf52 100644
@@ -24,6 +24,7 @@ XSERVER = "xserver-xorg \
            xf86-video-fbdev \
            xf86-video-vmware \
            xf86-video-modesetting \
+           xf86-video-vesa \
            xserver-xorg-module-libint10 \
            "
 
meta/conf/machine/qemux86.conf +1 -0
index 3832302f07b..8e0da820761 100644
@@ -24,6 +24,7 @@ XSERVER = "xserver-xorg \
            xf86-video-fbdev \
            xf86-video-vmware \
            xf86-video-modesetting \
+           xf86-video-vesa \
            xserver-xorg-module-libint10 \
            "
 
meta/lib/oeqa/runtime/cases/parselogs.py +5 -1
index 19c9c52a0a9..0002730d46f 100644
@@ -55,7 +55,11 @@ common_errors = [
     "Failed to read /var/lib/nfs/statd/state: Success",
     "error retry time-out =",
     "logind: cannot setup systemd-logind helper (-61), using legacy fallback",
-    "Error changing net interface name 'eth0' to "
+    "Error changing net interface name 'eth0' to ",
+    "modeset(0): Failed to initialize the DRI2 extension",
+    "uvesafb: cannot reserve video memory at",
+    "uvesafb: probe of uvesafb.0 failed with error",
+    "glamor initialization failed"
     ]
 
 video_related = [
scripts/runqemu +0 -6
index 7705b2b60e3..b5200106244 100755
@@ -145,8 +145,6 @@ class BaseConfig(object):
         # to be added with -drive if=pflash.
         # Found in the same places as the rootfs, with or without one of
         # these suffices: qcow2, bin.
-        # Setting one also adds "-vga std" because that is all that
-        # OVMF supports.
         self.ovmf_bios = []
         # When enrolling default Secure Boot keys, the hypervisor
         # must provide the Platform Key and the first Key Exchange Key
@@ -1283,10 +1281,6 @@ class BaseConfig(object):
         for ovmf in self.ovmf_bios:
             format = ovmf.rsplit('.', 1)[-1]
             self.qemu_opt += ' -drive if=pflash,format=%s,file=%s' % (format, ovmf)
-        if self.ovmf_bios:
-            # OVMF only supports normal VGA, i.e. we need to override a -vga vmware
-            # that gets added for example for normal qemux86.
-            self.qemu_opt += ' -vga std'
 
         self.qemu_opt += ' ' + self.qemu_opt_script
 
Signature · 1 line
2.17.1
#3 lore raw

Re: [PATCH 3/4] qemu: switch to '-vga std' emulated hardware from vmware/cirrus for x86/mips

Hi Alex,

On Wed, 2019-08-28 at 17:24 +0200, Alexander Kanavin wrote:
...

meta/conf/machine/qemuarm64.conf

Quoted 12 lines
meta/conf/machine/qemuarm64.conf +0 -0
index ec2a887bddf..05f0ee5e66f 100644
@@ -17,7 +17,7 @@ QB_CPU_KVM = "-cpu host"
 # Standard Serial console
 QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0"
 # For graphics to work we need to define the VGA device as well as

the necessary USB devices

meta/conf/machine/qemuarm64.conf +1 -1
-QB_OPT_APPEND = "-show-cursor -device VGA,edid=on"
+QB_OPT_APPEND = "-show-cursor"

Was this intentional? This is reverting an earlier fix:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/conf/machine/qemuarm64.conf?h=master-next&id=b181bf92e2bc51a808478c12fe62177d966f2a85

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/conf/machine/qemuarm64.conf?h=master-next&id=ff35b6c57a380ca4dc158c5104a6137f8faea5cd

I'm not sure if this is the reason but master-next build is also showing problems when running X with qemuarm:

https://autobuilder.yoctoproject.org/typhoon/#/builders/38/builds/978/steps/8/logs/step1c

...

Quoted 8 lines
meta/lib/oeqa/runtime/cases/parselogs.py +0 -0
index 19c9c52a0a9..0002730d46f 100644
@@ -55,7 +55,11 @@ common_errors = [
     "Failed to read /var/lib/nfs/statd/state: Success",
     "error retry time-out =",

meta/lib/oeqa/runtime/cases/parselogs.py common_errors = [ · line 65

Quoted 10 lines
meta/lib/oeqa/runtime/cases/parselogs.py +5 -1
     "logind: cannot setup systemd-logind helper (-61), using legacy
 fallback",
-    "Error changing net interface name 'eth0' to "
+    "Error changing net interface name 'eth0' to ",
+    "modeset(0): Failed to initialize the DRI2 extension",
+    "uvesafb: cannot reserve video memory at",
+    "uvesafb: probe of uvesafb.0 failed with error",
+    "glamor initialization failed"
     ]
 

parselogs test is used not only for qemu but for other MACHINES as well including genericx86 on actual hardware where glamor initialization error might need looking into. Perhaps this should be added to qemu specific parts of this test only?

Thanks,

Anuj

#4 lore raw

Re: [PATCH 3/4] qemu: switch to '-vga std' emulated hardware from vmware/cirrus for x86/mips

Quoted 9 lines · Anuj

Review

Quoted 2 lines
(quoted diff) +1 -1
-QB_OPT_APPEND = "-show-cursor -device VGA,edid=on"
+QB_OPT_APPEND = "-show-cursor"

Was this intentional? This is reverting an earlier fix:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/conf/machine/qemuarm64.conf?h=master-next&id=b181bf92e2bc51a808478c12fe62177d966f2a85

Quoted 8 lines

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/conf/machine/qemuarm64.conf?h=master-next&id=ff35b6c57a380ca4dc158c5104a6137f8faea5cd

I'm not sure if this is the reason but master-next build is also showing problems when running X with qemuarm:

https://autobuilder.yoctoproject.org/typhoon/#/builders/38/builds/978/steps/8/logs/step1c

Thanks, I wasn't aware that qemu's list of supported graphical hardware (and what the default selection is) differs between architectures and machines.
The documentation erroneously claims that '-vga std' is the default everywhere where in reality it is the default only on x86.

Patch will be reworked to not touch arm bits.

...

Quoted 16 lines
Quoted 16 lines
meta/lib/oeqa/runtime/cases/parselogs.py +4 -1
index 19c9c52a0a9..0002730d46f 100644
@@ -55,7 +55,11 @@ common_errors = [
     "Failed to read /var/lib/nfs/statd/state: Success",
     "error retry time-out =",
     "logind: cannot setup systemd-logind helper (-61), using legacy
 fallback",
-    "Error changing net interface name 'eth0' to "
+    "Error changing net interface name 'eth0' to ",
+    "modeset(0): Failed to initialize the DRI2 extension",
+    "uvesafb: cannot reserve video memory at",
+    "uvesafb: probe of uvesafb.0 failed with error",
Quoted 9 lines

meta/lib/oeqa/runtime/cases/parselogs.py common_errors = [ · line 64

Quoted 3 lines
meta/lib/oeqa/runtime/cases/parselogs.py +1 -0
+    "glamor initialization failed"
     ]
 

parselogs test is used not only for qemu but for other MACHINES as well including genericx86 on actual hardware where glamor initialization error might need looking into. Perhaps this should be added to qemu specific parts of this test only?

That's right as well. Let's add the messages to qemux86 parts, and see if
other qemu targets need this as well.

Alex

#5 lore raw

PATCH 4/4 mesa: disable gallium swrast driver on x86 x32

In reply to Alexander Kanavin

It was found to crash the X server on startup under qemu.

---
 meta/conf/machine/qemux86-64.conf   | 5 ++++-
 meta/recipes-graphics/mesa/mesa.inc | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
meta/conf/machine/qemux86-64.conf +4 -1
index 7c70dbddf52..648cf2fe8f6 100644
@@ -18,8 +18,11 @@ KERNEL_IMAGETYPE = "bzImage"
 
 SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
 
+# Install swrast and glx if opengl is in DISTRO_FEATURES and x32 is not in use.
+# This is because gallium swrast driver was found to crash X server on startup in qemu x32.
 XSERVER = "xserver-xorg \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', \
+           bb.utils.contains('TUNE_FEATURES', 'mx32', '', 'mesa-driver-swrast xserver-xorg-extension-glx', d), '', d)} \
            xf86-video-cirrus \
            xf86-video-fbdev \
            xf86-video-vmware \
meta/recipes-graphics/mesa/mesa.inc +3 -0
index fcd19884f54..8040d78992b 100644
@@ -98,6 +98,9 @@ PACKAGECONFIG[vc4] = ""
 PACKAGECONFIG[v3d] = ""
 
 GALLIUMDRIVERS = "swrast"
+# gallium swrast was found to crash Xorg on startup in x32 qemu
+GALLIUMDRIVERS_x86-x32 = ""
+
 GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
 GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}"
 GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}"
Signature · 1 line
2.17.1