]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
70a5db58 LP |
2 | #pragma once |
3 | ||
1e2f3230 | 4 | #include "cryptsetup-util.h" |
70a5db58 LP |
5 | #include "homework.h" |
6 | #include "user-record.h" | |
7 | ||
c00b2ddc | 8 | int home_setup_luks(UserRecord *h, HomeSetupFlags flags, const char *force_image_path, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_luks_home); |
70a5db58 | 9 | |
6f2c8136 | 10 | int home_activate_luks(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_home); |
fc032ae1 | 11 | int home_deactivate_luks(UserRecord *h, HomeSetup *setup); |
a71a0693 | 12 | int home_trim_luks(UserRecord *h, HomeSetup *setup); |
70a5db58 LP |
13 | |
14 | int home_store_header_identity_luks(UserRecord *h, HomeSetup *setup, UserRecord *old_home); | |
15 | ||
bc5890c6 | 16 | int home_create_luks(UserRecord *h, HomeSetup *setup, const PasswordCache *cache, char **effective_passwords, UserRecord **ret_home); |
70a5db58 | 17 | |
e1ab6635 | 18 | int home_get_state_luks(UserRecord *h, HomeSetup *setup); |
70a5db58 | 19 | |
c00b2ddc | 20 | int home_resize_luks(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_home); |
70a5db58 | 21 | |
d26cdde3 | 22 | int home_passwd_luks(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup, const PasswordCache *cache, char **effective_passwords); |
70a5db58 | 23 | |
fc032ae1 LP |
24 | int home_lock_luks(UserRecord *h, HomeSetup *setup); |
25 | int home_unlock_luks(UserRecord *h, HomeSetup *setup, const PasswordCache *cache); | |
70a5db58 | 26 | |
26191000 LP |
27 | int home_auto_shrink_luks(UserRecord *h, HomeSetup *setup, PasswordCache *cache); |
28 | ||
70a5db58 LP |
29 | static inline uint64_t luks_volume_key_size_convert(struct crypt_device *cd) { |
30 | int k; | |
31 | ||
32 | assert(cd); | |
33 | ||
34 | /* Convert the "int" to uint64_t, which we usually use for byte sizes stored on disk. */ | |
35 | ||
71eceff6 | 36 | k = sym_crypt_get_volume_key_size(cd); |
70a5db58 LP |
37 | if (k <= 0) |
38 | return UINT64_MAX; | |
39 | ||
40 | return (uint64_t) k; | |
41 | } | |
28a7f106 LP |
42 | |
43 | int run_fitrim(int root_fd); | |
28a7f106 LP |
44 | int run_fallocate(int backing_fd, const struct stat *st); |
45 | int run_fallocate_by_path(const char *backing_path); | |
565ac8b1 LP |
46 | int run_mark_dirty(int fd, bool b); |
47 | int run_mark_dirty_by_path(const char *path, bool b); | |
491347bd LP |
48 | |
49 | int wait_for_block_device_gone(HomeSetup *setup, usec_t timeout_usec); |