41 lines
1.1 KiB
Bash
Executable File
41 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
check () {
|
|
if ! dracut_module_included "systemd"; then
|
|
"fido2luks needs systemd in the initramfs"
|
|
return 1
|
|
fi
|
|
return 255
|
|
}
|
|
|
|
depends () {
|
|
echo "systemd crypt"
|
|
return 0
|
|
}
|
|
|
|
mirror() {
|
|
inst_simple "$1" "$1"
|
|
}
|
|
|
|
install () {
|
|
set -e
|
|
bash -n "$moddir/generator.sh"
|
|
local tmp=$(mktemp -d -t dracut-fido2luks-XXX)
|
|
trap "rm -rf $tmp" EXIT
|
|
$moddir/generator.sh "" "" "$tmp" /etc/fido2luks.conf
|
|
inst "$moddir/generator.sh" "$systemdutildir/system-generators/fido2luks-generator.sh"
|
|
mirror "/usr/bin/fido2luks"
|
|
mirror "/etc/fido2luks.conf"
|
|
for config in /etc/fido2luks.conf.d/*; do
|
|
mirror "$config"
|
|
done
|
|
inst "$systemdutildir/systemd-cryptsetup"
|
|
mkdir -p "$initdir/fido2luks"
|
|
|
|
inst "$moddir/fido2luks.target" "$systemdunitdir/fido2luks.target"
|
|
mkdir -p "$systemdunitdir/fido2luks.target.wants"
|
|
|
|
mkdir -p "$systemdunitdir/sysinit.target.wants"
|
|
ln -sf "$systemdunitdir/fido2luks.target" "$systemdunitdir/sysinit.target.wants/"
|
|
}
|