diff options
author | gaoyi <ymuemc@163.com> | 2021-04-06 10:44:33 +0800 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-04-09 17:18:09 +0200 |
commit | 5b1375035b617bbee8b22a997be527d1b7a392f8 (patch) | |
tree | 862eabaf61860b61f174f4f55a7c0d2cd439bf72 /src/gpt-auto-generator | |
parent | 22344fcfb9899ef3c8ccb9dfb52dbcfa645f0056 (diff) | |
download | systemd-5b1375035b617bbee8b22a997be527d1b7a392f8.tar.gz |
gpt-auto-generator: don't generate systemd-cryptsetup@.service when --Dlibcryptsetup=false
Diffstat (limited to 'src/gpt-auto-generator')
-rw-r--r-- | src/gpt-auto-generator/gpt-auto-generator.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index dda9b18815..42549a2cd8 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -105,6 +105,7 @@ static int open_parent_block_device(dev_t devnum, int *ret_fd) { } static int add_cryptsetup(const char *id, const char *what, bool rw, bool require, char **device) { +#if HAVE_LIBCRYPTSETUP _cleanup_free_ char *e = NULL, *n = NULL, *d = NULL; _cleanup_fclose_ FILE *f = NULL; int r; @@ -182,6 +183,9 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, bool requir } return 0; +#else + return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "Partition is encrypted, but the project was compiled without libcryptsetup support"); +#endif } static int add_mount( |