feat(systemd-coredump): introducing systemd-coredump module
This pull request introduces systemd-coredump as a seperated module and adds the systemdutilconfdir global variable.master
parent
9553a679f6
commit
939b7e11d5
|
@ -27,6 +27,7 @@ dbussystemservicesconfdir=/etc/dbus-1/system-services
|
|||
sysctld=/usr/lib/sysctl.d
|
||||
sysctldconfdir=/etc/sysctl.d
|
||||
systemdutildir=/usr/lib/systemd
|
||||
systemdutilconfdir=/etc/systemd
|
||||
systemdcatalog=/usr/lib/systemd/catalog
|
||||
systemdntpunits=/usr/lib/systemd/ntp-units.d
|
||||
systemdntpunitsconfdir=/etc/systemd/ntp-units.d
|
||||
|
|
|
@ -1109,6 +1109,10 @@ if ! [[ -d "$dracutsysrootdir$systemdutildir" ]]; then
|
|||
[[ -e $dracutsysrootdir/usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd
|
||||
fi
|
||||
|
||||
[[ -d $dracutsysrootdir$systemdutilconfdir ]] \
|
||||
|| systemdutilconfdir=$(pkg-config systemd --variable=systemdutilconfdir 2>/dev/null)
|
||||
|
||||
[[ -d "$dracutsysrootdir$systemdutilconfdir" ]] || systemdutilconfdir=/etc/systemd
|
||||
|
||||
if [[ $no_kernel != yes ]] && [[ -d $srcmods ]]; then
|
||||
if ! [[ -f $srcmods/modules.dep ]]; then
|
||||
|
@ -1600,8 +1604,8 @@ export initdir dracutbasedir \
|
|||
dbusservices dbusservicesconfdir dbussession dbussessionconfdir \
|
||||
dbussystem dbussystemconfdir dbussystemservices dbussystemservicesconfdir \
|
||||
environment environmentconfdir sysctl sysctlconfdir sysusers sysusersconfdir \
|
||||
systemdutildir systemdcatalog systemdntpunits systemdntpunitsconfdir \
|
||||
systemdsystemunitdir systemdsystemconfdir \
|
||||
systemdutildir systemdutilconfdir systemdcatalog systemdntpunits \
|
||||
systemdntpunitsconfdir systemdsystemunitdir systemdsystemconfdir \
|
||||
hostonly_cmdline loginstall \
|
||||
tmpfilesdir
|
||||
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
#!/bin/sh
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Prerequisite check(s) for module.
|
||||
check() {
|
||||
|
||||
# If the binary(s) requirements are not fulfilled
|
||||
# return 1 to not include the binary.
|
||||
require_binaries coredumpctl || return 1
|
||||
require_binaries $systemdutildir/systemd-coredump || return 1
|
||||
|
||||
# If the module dependency requirements are not fulfilled
|
||||
# return 1 to not include the required module(s).
|
||||
if ! dracut_module_included "systemd"; then
|
||||
derror "systemd-coredump needs systemd in the initramfs."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! dracut_module_included "systemd-journald"; then
|
||||
derror "systemd-coredump needs systemd-journald in the initramfs."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! dracut_module_included "systemd-sysctl"; then
|
||||
derror "systemd-coredump needs systemd-sysctl in the initramfs."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Return 255 to only include the module, if another module requires it.
|
||||
return 255
|
||||
|
||||
}
|
||||
|
||||
# Module dependency requirements.
|
||||
depends() {
|
||||
|
||||
# This module has external dependency on the systemd module.
|
||||
echo systemd systemd-journald systemd-sysctl
|
||||
# Return 0 to include the dependent systemd module in the initramfs.
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
# Install the required file(s) for the module in the initramfs.
|
||||
install() {
|
||||
|
||||
# Install the required directories.
|
||||
inst_dir /var/lib/systemd/coredump
|
||||
# Install the required file(s.
|
||||
inst_multiple -o \
|
||||
# Install the kernel configuration parameters for coredump.
|
||||
$sysctld/50-coredump.conf \
|
||||
# Install vendor configuration files.
|
||||
$systemdutildir/coredump.conf \
|
||||
# Install the systemd type service unit for coredump.
|
||||
$systemdsystemunitdir/systemd-coredump \
|
||||
$systemdsystemunitdir/systemd-coredump.socket \
|
||||
$systemdsystemunitdir/systemd-coredump@.service\
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-coredump.socket
|
||||
# Install the binary executable(s) for sysusers.
|
||||
coredumpctl
|
||||
|
||||
# Install the hosts local user configurations if enabled.
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
$systemdutilconfdir/coredump.conf \
|
||||
$systemdsystemconfdir/coredump.conf.d/*.conf \
|
||||
$systemdsystemconfdir/systemd-coredump.socket \
|
||||
$systemdsystemconfdir/systemd-coredump.socket.d/*.conf \
|
||||
$systemdsystemconfdir/systemd-coredump@.service \
|
||||
$systemdsystemconfdir/systemd-coredump@.service.d/*.conf \
|
||||
$systemdsystemconfdir/sockets.target.wants/systemd-coredump.socket
|
||||
${NULL}
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue