aboutsummaryrefslogtreecommitdiffstats
path: root/dracut/module-setup.sh
blob: 0bdde6f3a689e5898717bc7c228ed30324a84168 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

check() {
	return 0
}

# called by dracut
depends() {
	return 0
}

install() {
	# install basic files to initramfs
	inst_rules "$moddir/20-ykfde.rules"
	inst_hook cmdline 30 "$moddir/parse-mod.sh"
	inst_simple "$moddir/ykfde.sh" /sbin/ykfde.sh
	inst_binary /usr/lib/ykfde/worker
	inst_simple /etc/ykfde.conf
	inst_simple /usr/lib/systemd/system/ykfde-worker.service
	ln_r $systemdsystemunitdir/ykfde-worker.service $systemdsystemunitdir/sysinit.target.wants/ykfde-worker.service

	# this is required for second factor
	if egrep -qi 'second factor = (yes|true|1)' /etc/ykfde.conf; then
		inst_simple /usr/lib/systemd/system/cryptsetup-pre.target
		inst_simple /usr/lib/systemd/system/ykfde-2f.service
		ln_r $systemdsystemunitdir/ykfde-2f.service $systemdsystemunitdir/sysinit.target.wants/ykfde-2f.service
		inst_binary /usr/bin/systemd-ask-password
	fi

	dracut_need_initqueue
}