summaryrefslogtreecommitdiffstats
path: root/mkinitcpio/ykfde
blob: 5a407f52cd075f194ec405a82f08215e88aacfb9 (about) (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
#!/bin/sh

build() {
	# install basic files to initramfs
	add_binary /usr/lib/udev/ykfde
	add_file /usr/lib/initcpio/udev/20-ykfde.rules /usr/lib/udev/rules.d/20-ykfde.rules
	add_file /etc/ykfde.conf

	# this is required for second factor
	if egrep -qi 'second factor = (yes|true|1)' /etc/ykfde.conf; then
		add_systemd_unit cryptsetup-pre.target
		add_systemd_unit ykfde-2f.service
		add_symlink /usr/lib/systemd/system/sysinit.target.wants/ykfde-2f.service ../ykfde-2f.service
		add_file /usr/lib/systemd/scripts/ykfde-2f
		add_binary systemd-ask-password

		# shell and commands
		local applet
		add_binary /usr/lib/initcpio/busybox /usr/bin/busybox
		for applet in cat kill sh sleep; do
			add_symlink "/usr/bin/${applet}" busybox
		done
	fi
}

help() {
	echo "This hook adds support for opening LUKS devices with Yubico key."
	echo "Read the documentation for additional steps to set this up."
}