]> code.ossystems Code Review - meta-freescale.git/commitdiff
weston: Replace copies of weston.ini with logic
authorTom Hochstein <tom.hochstein@nxp.com>
Sun, 17 Nov 2019 15:25:11 +0000 (09:25 -0600)
committerOtavio Salvador <otavio@ossystems.com.br>
Mon, 18 Nov 2019 13:16:54 +0000 (10:16 -0300)
Install a common base weston.ini and then customize
it in the recipe by specifying custom options.

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
recipes-graphics/wayland/weston-init.bbappend
recipes-graphics/wayland/weston-init/mx7ulp/weston.ini [deleted file]
recipes-graphics/wayland/weston-init/mx8mm/weston.ini [deleted file]
recipes-graphics/wayland/weston-init/mx8mq/weston.ini [deleted file]

index 13818bc385510a3527b5e310bf739769b48cce53..ce6c4c7caf3e1f971335faa071d62cad66ed25d4 100644 (file)
@@ -11,10 +11,35 @@ SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd wayland x11', 'file
 HAS_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
 HAS_XWAYLAND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland x11', 'true', 'false', d)}"
 
+# To customize weston.ini, start by setting the desired assignment in weston.ini,
+# commented out. Then add the assignment to INI_UNCOMMENT_ASSIGNMENTS.
+INI_UNCOMMENT_ASSIGNMENTS = ""
+INI_UNCOMMENT_ASSIGNMENTS_append_mx7ulp = " \
+    use-g2d=1 \
+"
+INI_UNCOMMENT_ASSIGNMENTS_append_mx8mm = " \
+    use-g2d=1 \
+"
+INI_UNCOMMENT_ASSIGNMENTS_append_mx8mq = " \
+    gbm-format=argb8888 \
+    \\[shell\\] \
+    size=1920x1080 \
+"
+
+uncomment() {
+    if ! (grep "^#$1" $2); then
+        bbfatal "Commented setting '#$1' not found in file $2"
+    fi
+    sed -i -e 's,^#'"$1"','"$1"',g' $2
+}
+
 do_install_append() {
     if ${HAS_SYSTEMD}; then
         if ${HAS_XWAYLAND}; then
             install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston
         fi
     fi
+    for assignment in ${INI_UNCOMMENT_ASSIGNMENTS}; do
+        uncomment "$assignment" ${D}${sysconfdir}/xdg/weston/weston.ini
+    done
 }
diff --git a/recipes-graphics/wayland/weston-init/mx7ulp/weston.ini b/recipes-graphics/wayland/weston-init/mx7ulp/weston.ini
deleted file mode 100644 (file)
index 390932b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-[core]
-#gbm-format=argb8888
-idle-time=0
-use-g2d=1
-#xwayland=true
-
-#[shell]
-#size=1920x1080
-
-#[output]
-#name=HDMI-A-1
-#mode=1920x1080@60
-#transform=90
-
-#[output]
-#name=HDMI-A-2
-#mode=off
-#      WIDTHxHEIGHT    Resolution size width and height in pixels
-#      off             Disables the output
-#      preferred       Uses the preferred mode
-#      current         Uses the current crt controller mode
-#transform=90
-
-[screen-share]
-command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
diff --git a/recipes-graphics/wayland/weston-init/mx8mm/weston.ini b/recipes-graphics/wayland/weston-init/mx8mm/weston.ini
deleted file mode 100644 (file)
index 390932b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-[core]
-#gbm-format=argb8888
-idle-time=0
-use-g2d=1
-#xwayland=true
-
-#[shell]
-#size=1920x1080
-
-#[output]
-#name=HDMI-A-1
-#mode=1920x1080@60
-#transform=90
-
-#[output]
-#name=HDMI-A-2
-#mode=off
-#      WIDTHxHEIGHT    Resolution size width and height in pixels
-#      off             Disables the output
-#      preferred       Uses the preferred mode
-#      current         Uses the current crt controller mode
-#transform=90
-
-[screen-share]
-command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
diff --git a/recipes-graphics/wayland/weston-init/mx8mq/weston.ini b/recipes-graphics/wayland/weston-init/mx8mq/weston.ini
deleted file mode 100644 (file)
index eceb645..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-[core]
-gbm-format=argb8888
-idle-time=0
-#use-g2d=1
-#xwayland=true
-
-[shell]
-size=1920x1080
-
-#[output]
-#name=HDMI-A-1
-#mode=1920x1080@60
-#transform=90
-
-#[output]
-#name=HDMI-A-2
-#mode=off
-#      WIDTHxHEIGHT    Resolution size width and height in pixels
-#      off             Disables the output
-#      preferred       Uses the preferred mode
-#      current         Uses the current crt controller mode
-#transform=90
-
-[screen-share]
-command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize