8aa72c570bcb40aabc0518bfac16932293e427ac
[AGL/meta-agl.git] / meta-app-framework / recipes-core / systemd / systemd_appfw.inc
1 FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"
2
3 # Ensures systemd runs with label "System"
4 EXTRA_OEMESON:append:with-lsm-smack = " -Dsmack-run-label=System"
5
6 ##################################################################################
7 # Maintaining trivial, non-upstreamable configuration changes as patches
8 # is tedious. But in same cases (like early mounting of special directories)
9 # the configuration has to be in code. We make these changes here directly.
10 ##################################################################################
11 do_patch[prefuncs] += "patch_systemd"
12 do_patch[vardeps] += "patch_systemd"
13 patch_systemd() {
14     # Handling of /run and /sys/fs/cgroup. Make /run a transmuting directory to
15     # enable systemd communications with services in the User domain.
16     # Original patch by Michael Demeter <michael.demeter@intel.com>.
17     #
18     # We simplify the patching by touching only lines which check the result of
19     # mac_smack_use(). Those are the ones which are used when Smack is active.
20     #
21     # smackfsroot=* on /sys/fs/cgroup may be upstreamable, but smackfstransmute=System::Run
22     # is too distro specific (depends on Smack rules) and thus has to remain here.
23     sed -i -e 's;\("/sys/fs/cgroup", *"[^"]*", *"[^"]*\)\(.*mac_smack_use.*\);\1,smackfsroot=*\2;' \
24            -e 's;\("/run", *"[^"]*", *"[^"]*\)\(.*mac_smack_use.*\);\1,smackfstransmute=System::Run\2;' \
25            ${S}/src/core/mount-setup.c
26 }
27
28 ##################################################################################
29 # What follows is temporary.
30 # This is a solution to the Bug-AGL SPEC-539
31 # (see https://jira.automotivelinux.org/browse/SPEC-539).
32 #
33 # It renames the file "touchscreen.rules" to "55-touchscreen.rules"
34 # This comes with the recipe systemd_230/234 of poky (meta/recipes-core/systemd)
35 # It should be removed when poky changes.
36 ##################################################################################
37 do_install:prepend() {
38         mv ${WORKDIR}/touchscreen.rules ${WORKDIR}/55-touchscreen.rules || true
39 }
40