3
# This file should be present in the root file system directory
4
# /usr/lib/dracut/modules.d/90mandos. When dracut creates the
5
# initramfs image, dracut will run the "module-setup.sh" file in the
6
# same directory, which (when using the "systemd" dracut module) will
7
# copy this file ("cmdline-mandos-systemd.sh") into the initramfs as
8
# "/lib/dracut/hooks/cmdline/20-cmdline-mandos-systemd.sh".
10
# Despite the above #!/bin/sh line and the executable flag, this file
11
# is not executed; this file is sourced by the /init script in the
12
# initramfs image created by dracut.
14
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
16
if getargbool 1 mandos && [ -e /lib/dracut-crypt-lib.sh ]; then
17
if mandos=$(getarg mandos); then
19
connect:*) mandos_connect="${mandos#connect:}" ;;
21
if [ -n "$mandos_connect" ]; then
23
# systemctl edit --runtime ask-password-mandos.service --stdin <<-EOF
26
mkdir --parents /run/systemd/system/ask-password-mandos.service.d
27
cat > /run/systemd/system/ask-password-mandos.service.d/connect.conf <<-EOF
29
Environment="MANDOS_CLIENT_CONNECT=--connect=$mandos_connect"
31
systemctl daemon-reload