Skip to content

Commit

Permalink
emulator: Move qemux86-specific changes into separate machine meta layer
Browse files Browse the repository at this point in the history
Previously, qemux86-related changes were strewn all over meta-asteroid,
which went against the way all other machines are handled.

This change creates a new "smartwatch" machine, called emulator. It inherits
most machine configuration from openembedded's qemux86 machine.

The patches, configs etc. are basically the same as they were in meta-asteroid,
the interesting change is the creation of a dedicated machine.conf.
  • Loading branch information
casept committed Feb 13, 2024
1 parent cb12312 commit 435dcae
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 0 deletions.
7 changes: 7 additions & 0 deletions meta-emulator/conf/layer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"
BBFILES += "${LAYERDIR}/recipes*/*/*/*.bb ${LAYERDIR}/recipes*/*/*/*.bbappend"
BBFILE_COLLECTIONS += "emulator-layer"
BBFILE_PATTERN_emulator-layer := "^${LAYERDIR}/"
BBFILE_PRIORITY_emulator-layer = "8"
LAYERSERIES_COMPAT_emulator-layer = "mickledore"
23 changes: 23 additions & 0 deletions meta-emulator/conf/machine/emulator.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

#@TYPE: Machine
#@NAME: emulator
#@DESCRIPTION: Machine configuration for the Qemu-based emulator.

require conf/machine/qemux86.conf
# So we can re-use any qemux86-specific overrides in openembedded layers
MACHINEOVERRIDES:append = " qemuall: qemux86:"

MACHINE_FEATURES:append = " alsa ext2 "

IMAGE_FSTYPES:append = " ext4 "
IMAGE_ROOTFS_ALIGNMENT = "4"

MACHINE_DISPLAY_ROUND = "false"
MACHINE_HAS_WLAN = "false"
MACHINE_HAS_SPEAKER = "true"
MACHINE_HAS_MICROPHONE = "false"

KMACHINE = "qemux86"
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = " kernel-modules "
MACHINE_ESSENTIAL_EXTRA_RECOMMENDS:append = " kernel-modules "
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"device": "/dev/dri/card0",
"outputs": [
{ "name": "Virtual1", "mode": "800x800" }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
QT_QPA_PLATFORM=eglfs
QT_QPA_EGLFS_INTEGRATION=eglfs_kms
QT_IM_MODULE=qtvirtualkeyboard
QT_QPA_EGLFS_KMS_CONFIG=/var/lib/environment/compositor/kms-qemu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FILESEXTRAPATHS:prepend:emulator := "${THISDIR}/asteroid-launcher-configs:"
SRC_URI:append:emulator = " file://qemu.conf file://kms-qemu.json"

do_install:append:emulator() {
# Overwrite the default config.
install -m 0644 ${WORKDIR}/qemu.conf ${D}/var/lib/environment/compositor/default.conf
install -m 0644 ${WORKDIR}/kms-qemu.json ${D}/var/lib/environment/compositor/
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 72ce1af1dda062594003083494e0c99111649234 Mon Sep 17 00:00:00 2001
From: Florent Revest <[email protected]>
Date: Sun, 3 Dec 2017 00:37:37 +0100
Subject: [PATCH] Spinners: Disable shaders which cause all sorts of problems
on tetra

---
src/controls/qml/CircularSpinner.qml | 2 +-
src/controls/qml/Spinner.qml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/controls/qml/CircularSpinner.qml b/src/controls/qml/CircularSpinner.qml
index 2dc3c6b..db19f83 100644
--- a/src/controls/qml/CircularSpinner.qml
+++ b/src/controls/qml/CircularSpinner.qml
@@ -45,7 +45,7 @@ PathView {
visible: false
}

- layer.enabled: true
+ layer.enabled: false
layer.effect: ShaderEffect {
fragmentShader: "
precision mediump float;
diff --git a/src/controls/qml/Spinner.qml b/src/controls/qml/Spinner.qml
index b7cd76b..62be3ec 100644
--- a/src/controls/qml/Spinner.qml
+++ b/src/controls/qml/Spinner.qml
@@ -40,7 +40,7 @@ ListView {
visible: false
}

- layer.enabled: true
+ layer.enabled: false
layer.effect: ShaderEffect {
fragmentShader: "
precision mediump float;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend:emulator := "${THISDIR}/qml-asteroid:"
SRC_URI:append:emulator = " file://0001-Spinners-Disable-shaders-which-cause-all-sorts-of-pr.patch"
2 changes: 2 additions & 0 deletions meta-emulator/recipes-graphics/mesa/mesa_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PACKAGECONFIG:append:emulator = " gallium"
GALLIUMDRIVERS:append:emulator = ",virgl"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_DRM_VIRTIO_GPU=y
5 changes: 5 additions & 0 deletions meta-emulator/recipes-kernel/linux/linux-yocto_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FILESEXTRAPATHS:prepend:emulator := "${THISDIR}/linux-yocto:"
SRC_URI:append:emulator = " file://drm-virtio-gpu.cfg "

KERNEL_CONFIG_FRAGMENTS:append:emulator = " ${WORKDIR}/drm-virtio-gpu.cfg "
COMPATIBLE_MACHINE = "emulator"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From fb115fc533b8e1072d1b9c5b06e5f926ec99dac1 Mon Sep 17 00:00:00 2001
From: Florent Revest <[email protected]>
Date: Wed, 21 Feb 2018 15:54:02 +0100
Subject: [PATCH] Keep screen on by default on emulator

---
modules/display.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/display.h b/modules/display.h
index 8bd4513..43a0ae5 100644
--- a/modules/display.h
+++ b/modules/display.h
@@ -434,7 +434,7 @@ typedef enum {
* logic without modifying the timeout values.
*/
# define MCE_SETTING_BLANKING_INHIBIT_MODE MCE_SETTING_DISPLAY_PATH "/inhibit_blank_mode"
-# define MCE_DEFAULT_BLANKING_INHIBIT_MODE 0 // = INHIBIT_OFF
+# define MCE_DEFAULT_BLANKING_INHIBIT_MODE 1 // = INHIBIT_ON

/** Kbd slide inhibit type */
typedef enum {
2 changes: 2 additions & 0 deletions meta-emulator/recipes-nemomobile/mce/mce_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend:emulator := "${THISDIR}/mce:"
SRC_URI:append:emulator = " file://0001-Keep-screen-on-by-default-on-emulator.patch "

0 comments on commit 435dcae

Please sign in to comment.