[meta-freescale] [PATCH 08/14] systemd-gpuconfig: Implement GPU init as systemd service

Tom Hochstein tom.hochstein at nxp.com
Thu Oct 19 11:36:12 PDT 2017


Signed-off-by: Tom Hochstein <tom.hochstein at nxp.com>
---
 recipes-core/systemd/systemd-gpuconfig/gpuconfig   | 19 +++++++++++++
 .../systemd/systemd-gpuconfig/gpuconfig.service    |  8 ++++++
 recipes-core/systemd/systemd-gpuconfig_1.0.bb      | 32 ++++++++++++++++++++++
 3 files changed, 59 insertions(+)
 create mode 100644 recipes-core/systemd/systemd-gpuconfig/gpuconfig
 create mode 100644 recipes-core/systemd/systemd-gpuconfig/gpuconfig.service
 create mode 100644 recipes-core/systemd/systemd-gpuconfig_1.0.bb

diff --git a/recipes-core/systemd/systemd-gpuconfig/gpuconfig b/recipes-core/systemd/systemd-gpuconfig/gpuconfig
new file mode 100644
index 0000000..792ab6c
--- /dev/null
+++ b/recipes-core/systemd/systemd-gpuconfig/gpuconfig
@@ -0,0 +1,19 @@
+#!/bin/sh
+CPUREV=$(cat /sys/devices/soc0/soc_id)
+FILEVG=/usr/lib/libOpenVG.so
+FILEVG3D=/usr/lib/libOpenVG.3d.so
+FILEVG355=/usr/lib/libOpenVG.2d.so
+if  [ -e $FILEVG3D ] && [ -e $FILEVG355 ]
+then
+  if [ -e  $FILEVG ]
+  then
+        rm -f $FILEVG
+  fi
+  if [ $CPUREV == "i.MX6QP" ] || [ $CPUREV == "i.MX6Q" ] || [ $CPUREV == "i.MX6SL" ]
+  then
+        # Use GC355 VG
+        ln -s $FILEVG355 $FILEVG
+  else
+        ln -s $FILEVG3D $FILEVG
+  fi
+fi
diff --git a/recipes-core/systemd/systemd-gpuconfig/gpuconfig.service b/recipes-core/systemd/systemd-gpuconfig/gpuconfig.service
new file mode 100644
index 0000000..9881e7c
--- /dev/null
+++ b/recipes-core/systemd/systemd-gpuconfig/gpuconfig.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Configuration for i.MX GPU (Former rc_gpu.S)
+
+[Service]
+ExecStart=/etc/gpuconfig
+
+[Install]
+WantedBy=multi-user.target
diff --git a/recipes-core/systemd/systemd-gpuconfig_1.0.bb b/recipes-core/systemd/systemd-gpuconfig_1.0.bb
new file mode 100644
index 0000000..0a5a75e
--- /dev/null
+++ b/recipes-core/systemd/systemd-gpuconfig_1.0.bb
@@ -0,0 +1,32 @@
+SUMMARY = "i.MX GPU Configuration for systemd boot mode"
+DESCRIPTION = "Use systemd service to implement the former script rc_gpu.S and other scripts"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI = " file://gpuconfig \
+            file://gpuconfig.service \
+"
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "systemd"
+
+do_install () {
+    install -d ${D}${sysconfdir}
+    install -d ${D}${systemd_unitdir}/system/
+    install -d ${D}${sysconfdir}/systemd/system/multi-user.target.wants/
+
+    install -m 0755 ${WORKDIR}/gpuconfig ${D}${sysconfdir}
+    install -m 0644 ${WORKDIR}/gpuconfig.service ${D}${systemd_unitdir}/system
+
+    # Enable the gpuconfig.service
+    ln -sf ${systemd_unitdir}/system/gpuconfig.service \
+            ${D}${sysconfdir}/systemd/system/multi-user.target.wants/gpuconfig.service
+}
+
+FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}"
+
+# As this package is tied to systemd, only build it when we're also building systemd.
+python () {
+    if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+        raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
+}
-- 
1.9.1



More information about the meta-freescale mailing list