systemd: add missing systemd recipes

These have been ported directly from NXP's meta-fsl-bsp-release layer.

https://jira.digi.com/browse/DEL-6415

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2019-01-29 18:06:45 +01:00
parent ff34c08568
commit c1c8a9a7c7
7 changed files with 179 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,8 @@
[Unit]
Description=Configuration for i.MX GPU (Former rc_gpu.S)
[Service]
ExecStart=/etc/gpuconfig
[Install]
WantedBy=multi-user.target

View File

@ -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")
}

View File

@ -0,0 +1,28 @@
From 8745e605135fed3e556558a8ddb783a96765b6e7 Mon Sep 17 00:00:00 2001
From: Vito Caputo <vcaputo@pengaru.com>
Date: Sat, 3 Feb 2018 03:09:08 -0800
Subject: [PATCH] socket-util: fix getpeergroups() assert(fd) (#8080)
Don't assert on zero-value fds.
Fixes #8075.
---
src/basic/socket-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
index 2c70cad..bd3cf6f 100644
--- a/src/basic/socket-util.c
+++ b/src/basic/socket-util.c
@@ -1008,7 +1008,7 @@ int getpeergroups(int fd, gid_t **ret) {
socklen_t n = sizeof(gid_t) * 64;
_cleanup_free_ gid_t *d = NULL;
- assert(fd);
+ assert(fd >= 0);
assert(ret);
for (;;) {
--
2.7.4

View File

@ -0,0 +1,30 @@
From ef9f6626d08d6d19767d20845c8d6f374f05465d Mon Sep 17 00:00:00 2001
From: Tom Hochstein <tom.hochstein@nxp.com>
Date: Tue, 3 Apr 2018 14:07:32 -0500
Subject: [PATCH] logind.conf: Set HandlePowerKey to ignore
For i.MX, we don't want systemd to handle the power key.
Upstream-Status: Inappropriate [i.MX-specific]
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
---
src/login/logind.conf.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/login/logind.conf.in b/src/login/logind.conf.in
index 6f720b7..043191f 100644
--- a/src/login/logind.conf.in
+++ b/src/login/logind.conf.in
@@ -19,6 +19,8 @@
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
+# i.MX-specific
+HandlePowerKey=ignore
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
--
2.7.4

View File

@ -0,0 +1,38 @@
From 63a29080c6a2f6e235d19e2ed303e52706c2c74e Mon Sep 17 00:00:00 2001
From: Jun Zhu <junzhu@nxp.com>
Date: Thu, 26 Apr 2018 15:43:45 +0800
Subject: [PATCH] systemd-udevd.service.in: Set MountFlags as shared to fix the
automount problem
Use "shared" mode to ensure that mounts and unmounts
are propagated from systemd's namespace to the service's namespace.
It will fix the automount problem from v234
The original commit to set the mode to "slave" is
the commit c2c13f2df42e0691aecabe3979ea81cd7faa35c7
"unit: turn off mount propagation for udevd"
Upstream-Status: Inappropriate [i.MX specific]
Signed-off-by: Jun Zhu <junzhu@nxp.com>
---
units/systemd-udevd.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/units/systemd-udevd.service.in b/units/systemd-udevd.service.in
index fc037b5..f65b77c 100644
--- a/units/systemd-udevd.service.in
+++ b/units/systemd-udevd.service.in
@@ -24,7 +24,7 @@ ExecStart=@rootlibexecdir@/systemd-udevd
KillMode=mixed
WatchdogSec=3min
TasksMax=infinity
-MountFlags=slave
+MountFlags=shared
MemoryDenyWriteExecute=yes
RestrictRealtime=yes
RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6
--
2.7.4

View File

@ -0,0 +1,24 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI += "file://0020-logind.conf-Set-HandlePowerKey-to-ignore.patch \
file://0021-systemd-udevd.service.in-Set-MountFlags-as-shared-to.patch \
file://0001-socket-util-fix-getpeergroups-assert-fd-8080.patch \
"
#FIX-it: Workaround as missing ending slash in FIRMWARE_PATH [YOCIMX-2831]
EXTRA_OEMESON_remove = "-Dfirmware-path=${nonarch_base_libdir}/firmware "
EXTRA_OEMESON += "-Dfirmware-path=${nonarch_base_libdir}/firmware/ "
do_install_append () {
# Disable the assignment of the fixed network interface name
install -d ${D}${sysconfdir}/systemd/network
ln -s /dev/null ${D}${sysconfdir}/systemd/network/99-default.link
# Add special touchscreen rules
if [ -e ${D}${sysconfdir}/udev/rules.d/touchscreen.rules ]; then
cat <<EOF >>${D}${sysconfdir}/udev/rules.d/touchscreen.rules
# i.MX specific touchscreen rules
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0"
EOF
fi
}