kdump-steamos: Move configuration file out of /etc

This patch main goal is to "un-Debianize" the configuration file
for kdump-steamos - thanks Emil (@xexaxo) for the discussions; it
is with a bit of a heavy heart I do that, but let's comply with the
modern distros ;-)

We hereby put the config file in a more standard path: /usr/share.
Usually users could override that with /etc/ file, but not in this
case, or at least, not for now. Kdump/pstore is expected to work
quietly, with no users' interference. Advanced users might want to
play with the configs though; and those can just go ahead and edit
the /usr/share/kdump/kdump.conf - it's all documented in the README.

In the future we can improve that by having the override mechanism
with the /etc file, let's see if we have a demand for that.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
This commit is contained in:
Guilherme G. Piccoli
2022-02-23 18:33:38 -03:00
parent 6ae626f17c
commit 5c1cc98502
7 changed files with 19 additions and 19 deletions

View File

@ -1,7 +1,7 @@
prefix := /usr
sysconfdir := /etc
libdir := $(prefix)/lib
sharedir := $(prefix)/share
systemdunitsdir := $(shell pkg-config --define-variable=prefix=$(prefix) --variable=systemdsystemunitdir systemd 2>/dev/null \
|| echo $(libdir)/systemd/system/)
@ -13,7 +13,6 @@ dracutmodulesdir := $(shell pkg-config --define-variable=prefix=$(prefix) --vari
all:
install: all
install -D -m0644 kdump.etc $(DESTDIR)$(sysconfdir)/default/kdump
install -D -m0644 kdump-steamos.service $(DESTDIR)$(systemdunitsdir)/kdump-steamos.service
install -D -m0644 20-kdump-steamos.conf $(DESTDIR)$(sysctldir)/20-kdump-steamos.conf
install -D -m0755 kdump-collect.sh $(DESTDIR)$(dracutmodulesdir)/55kdump/kdump-collect.sh
@ -22,3 +21,4 @@ install: all
install -D -m0755 kdump-load.sh $(DESTDIR)$(libdir)/kdump/kdump-load.sh
install -D -m0755 submit-report.sh $(DESTDIR)$(libdir)/kdump/submit-report.sh
install -D -m0755 submitter-load.sh $(DESTDIR)$(libdir)/kdump/submitter-load.sh
install -D -m0644 kdump.conf $(DESTDIR)$(sharedir)/kdump/kdump.conf

View File

@ -47,7 +47,7 @@
# This action will trigger a dummy crash and reboot the system; check if
# there is a ZIP file with the crash logs in the directory described in (3).
#
# 5. Some tunings are available at "/etc/default/kdump"; for example users
# 5. Some tunings are available at "/usr/share/kdump/kdump.conf"; e.g. users
# can choose Kdump instead of Pstore (USE_PSTORE_RAM), and if using Kdump,
# collect the full vmcore (FULL_COREDUMP). The vmcore is not stored in the
# ZIP file, but it's saved in "/home/.steamos/offload/var/kdump/crash/".
@ -137,9 +137,9 @@
# but they provide valuable data to Valve in order to determine issue in the
# field, and hopefully fix them, so users are happy. Hence, the kdump-steamos
# is capable to submit logs to Valve servers, through an API. If users wish
# to disable this feature, just set LOG_SUBMISSION=0 in /etc/default/kdump.
# Below such API is described, but first worth to mention some assumptions
# and decisions made in the log submission mechanism:
# to disable this feature, just set LOG_SUBMISSION=0 in the config file
# "/usr/share/kdump/kdump.conf". Below such API is described, but first worth
# to mention some assumptions / decisions made in the log submission mechanism:
#
# * First of all, we attempt to verify network connectivity by pinging the
# URL "steampowered.com" - quick pings (2 packets, 0.5s between each one)

View File

@ -11,7 +11,7 @@
# and get stuck in this minimal initramfs with no output for the user.
#
. /usr/lib/kdump/kdump.etc
. /usr/lib/kdump/kdump.conf
VMCORE="/proc/vmcore"
KDUMP_TIMESTAMP=$(date -u +"%Y%m%d%H%M")

View File

@ -46,12 +46,12 @@ grub_update() {
fi
}
if [ ! -s "/etc/default/kdump" ]; then
logger "kdump-steamos: /etc/default/kdump not present - aborting..."
if [ ! -s "/usr/share/kdump/kdump.conf" ]; then
logger "kdump-steamos: /usr/share/kdump/kdump.conf is missing, aborting."
exit 0
fi
. /etc/default/kdump
. /usr/share/kdump/kdump.conf
# Find the proper mount point for /home:
DEVN_MOUNTED="$(findmnt "${MOUNT_DEVNODE}" -fno TARGET)"
@ -77,7 +77,7 @@ if [ "$1" = "clear" ]; then
exit 0
fi
# Pstore-RAM load; if it is configured via /etc/default/kdump and fails
# Pstore-RAM load; if it is configured via /usr/share/kdump/kdump.conf and fails
# to configure pstore, we still try to load the kdump. We try to reserve
# here a 5MiB memory region.
# Notice that we assume ramoops is a module here - if built-in, we should

View File

@ -18,12 +18,12 @@ installkernel() {
}
install() {
# Having a valid /etc/default/kdump is essential for kdump.
if [ ! -s "/etc/default/kdump" ]; then
# Having a valid /usr/share/kdump/kdump.conf is essential for kdump.
if [ ! -s "/usr/share/kdump/kdump.conf" ]; then
return 1
fi
. /etc/default/kdump
. /usr/share/kdump/kdump.conf
# First clear all unnecessary firmwares/drivers added by drm in order to
# reduce the size of this minimal initramfs being created. This should
@ -45,7 +45,7 @@ install() {
echo "${DEVN}" > "$initdir"/usr/lib/kdump/kdump.devnode
cp -LR --preserve=all /usr/lib/kdump/* "$initdir"/usr/lib/kdump/
cp -LR --preserve=all /etc/default/kdump "$initdir"/usr/lib/kdump/kdump.etc
cp -LR --preserve=all /usr/share/kdump/kdump.conf "$initdir"/usr/lib/kdump/kdump.conf
inst_hook pre-mount 01 "$moddir/kdump-collect.sh"
}

View File

@ -67,13 +67,13 @@ get_steam_account_id() {
# We do some validation to be sure KDUMP_MNT pointed path is valid...
# That and having a valid /etc/default/kdump are essential conditions.
if [ ! -s "/etc/default/kdump" ]; then
logger "kdump-steamos: /etc/default/kdump not present - aborting..."
# That and having a valid /usr/share/kdump/kdump.conf are essential conditions.
if [ ! -s "/usr/share/kdump/kdump.conf" ]; then
logger "kdump-steamos: /usr/share/kdump/kdump.conf is missing, aborting."
exit 0
fi
. /etc/default/kdump
. /usr/share/kdump/kdump.conf
KDUMP_MAIN_FOLDER="$(cat "${KDUMP_MNT}")"
rm -f "${KDUMP_MNT}"