tools: acrn-crashlog: add service/config files and scripts

This patch adds the service files, config files and script
to run automatically at boot. And it adds install/uninstall
part in Makefile. Compatiblity code for libsystemd.so and
libsystemd-journal.so is added in Makefile also.

Signed-off-by: Jin Zhi <zhi.jin@intel.com>
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhang Yanmin <yanmin.zhang@intel.com>
Reviewed-by: Liu Chuansheng <chuansheng.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
This commit is contained in:
CHEN Gang
2018-05-18 16:38:19 +08:00
committed by lijinxia
parent df6019aa26
commit a9e36bdb4e
8 changed files with 155 additions and 8 deletions

View File

@@ -0,0 +1,42 @@
#!/bin/bash
#
# Copyright (C) <2018> Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
# modify the core_pattern
echo "|/usr/bin/usercrash_c %p %e %s" > /proc/sys/kernel/core_pattern
conf="/usr/share/defaults/telemetrics/telemetrics.conf"
grep -q "record_server_delivery_enabled=false" $conf
if [ "$?" -eq "0" ];then
exit;
fi
telemd_services=(
hprobe.timer
telemd-update-trigger.service
pstore-clean.service
pstore-probe.service
oops-probe.service
klogscanner.service
journal-probe.service
bert-probe.service
)
for ((i=0;i<${#telemd_services[*]};i++))
do
if [ ! -L "/etc/systemd/system/${telemd_services[$i]}" ];then
systemctl mask ${telemd_services[$i]} --now
fi
done
# modify the configure file
sed -i "s/server_delivery_enabled=true/server_delivery_enabled=false/g" $conf
sed -i "s/record_retention_enabled=false/record_retention_enabled=true/g" $conf
# restart telemd
sleep 3
systemctl restart telemd.service