/
mount-cryptosd-luks@.service
27 lines (25 loc) · 1.24 KB
/
mount-cryptosd-luks@.service
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
[Unit]
Description=Mount /dev/mapper/%I per udisks2
Documentation=https://github.com/Olf0/crypto-sdcard
After=udisks2.service cryptosd-luks@%i.service dev-mapper-%i.device start-user-session.service
Requires=udisks2.service cryptosd-luks@%i.service
# "Requisite=dev-mapper-%i.device" here would prevent this unit from
# auto-starting its dependencies, when started manually:
PartOf=dev-mapper-%i.device
# Also conflict with umount.target (see man 7 systemd.special), as
# this is a mounting unit, though not a mount unit:
Conflicts=umount.target rescue.target actdead.target factory-test.target
# Ensure that this Unit is processed before alien-service-manager
# is started (and even more importantly that it is shut down, *after*
# alien-service-manager is shut down), to allow for e.g. (and more),
# android_storage on encrypted SD-card:
Before=alien-service-manager.service umount.target
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/systemd/system/cryptosd.conf
EnvironmentFile=-/etc/crypto-sdcard/cryptosd.conf
EnvironmentFile=-/etc/crypto-sdcard/cryptosd@%I.conf
ExecStart=/usr/bin/udisksctl-user mount $UDISKS2_MOUNT_OPTIONS -b /dev/mapper/%I
ExecStop=/usr/bin/udisksctl unmount -b /dev/mapper/%I
ExecStopPost=-/bin/umount -vrq /dev/mapper/%I