units: introduce blockdev@.target for properly ordering mounts/swaps against cryptsetup

Let's hook it into both cryptsetup-generator and gpt-auto-generator with
a shared implementation in generator.c

Fixes: #8472
This commit is contained in:
Lennart Poettering
2019-12-19 17:38:55 +01:00
parent 6bbd539e5e
commit a7e8855879
7 changed files with 188 additions and 85 deletions

13
units/blockdev@.target Normal file
View File

@@ -0,0 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Block Device Preparation for %f
Documentation=man:systemd.special(7)
StopWhenUnneeded=yes