stx-extensions: Fix the systemd unitdir and the arguments for kernel.core_pattern
[pti/rtp.git] / meta-stx / recipes-core / stx-utilities / utilities / stx-extensions.inc
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 PACKAGES += " stx-extensions"
17
18 RDEPENDS_stx-extensions  += " systemd"
19 DESCRIPTION_stx-extensions  = "TIS Extensions to thirdparty pkgs"
20 SUMMARY_stx-extensions  = "TIS Extensions to thirdparty pkgs"
21
22 inherit setuptools distutils
23
24 do_configure_append() {
25         :
26 }
27 do_compile_append() {
28         :
29 }
30
31 do_install_append() {
32         cd ${S}/utilities/stx-extensions/files
33
34         install -p -d -m0755 ${D}/${sysconfdir}/sysctl.d
35         install -m0755 coredump-sysctl.conf ${D}/${sysconfdir}/sysctl.d/50-coredump.conf
36
37         # Fix the systemd unitdir and the arguments for kernel.core_pattern
38         sed -i -e 's|${nonarch_libdir}/systemd|${systemd_unitdir}|' \
39                -e 's/%p/%P/' -e 's/%e/%c %h %e/' \
40                ${D}/${sysconfdir}/sysctl.d/50-coredump.conf
41
42         install -p -d -m0755 ${D}/${sysconfdir}/systemd/coredump.conf.d
43         install -m0755 coredump.conf ${D}/${sysconfdir}/systemd/coredump.conf.d/coredump.conf
44
45         install -p -d -m0755 ${D}/${sysconfdir}/modules-load.d
46         install -m0644 modules-load-vfio.conf ${D}/${sysconfdir}/modules-load.d/vfio.conf
47
48 }
49
50 FILES_stx-extensions = "  \
51         ${sysconfdir}/sysctl.d/50-coredump.conf \
52         ${sysconfdir}/systemd/coredump.conf.d/coredump.conf \
53         ${sysconfdir}/modules-load.d/vfio.conf \
54         "