diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-06-01 18:54:33 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-06-01 19:06:20 +0200 |
commit | deb60ef92e47e35d8124ae8e03deaa914701b9b4 (patch) | |
tree | 80cf3a243e19b030ad69ace4f27836f5216356d8 /src/veritysetup | |
parent | {crypt|verity}setup: mention volume name in some error messages (diff) | |
download | systemd-deb60ef92e47e35d8124ae8e03deaa914701b9b4.tar.xz systemd-deb60ef92e47e35d8124ae8e03deaa914701b9b4.zip |
veritysetup: minor renaming of functions
create_device() and create_disk() so far did very similar things, but
the name didn't give a hint what the difference was.
Hence let's rename them to create_special_device() and
create_veritytab_device() to make this more understandabe, as one
creates /proc/cmdline specified roothash=/usrhash= devices, and the
other one devices for items listed in /etc/veritytab.
No code changes besides renaming.
Diffstat (limited to 'src/veritysetup')
-rw-r--r-- | src/veritysetup/veritysetup-generator.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/veritysetup/veritysetup-generator.c b/src/veritysetup/veritysetup-generator.c index 93aa265ba1..ca2e6401ac 100644 --- a/src/veritysetup/veritysetup-generator.c +++ b/src/veritysetup/veritysetup-generator.c @@ -47,7 +47,7 @@ STATIC_DESTRUCTOR_REGISTER(arg_usr_data_what, freep); STATIC_DESTRUCTOR_REGISTER(arg_usr_hash_what, freep); STATIC_DESTRUCTOR_REGISTER(arg_usr_options, freep); -static int create_device( +static int create_special_device( const char *name, const char *service, const char *roothash, @@ -59,6 +59,8 @@ static int create_device( _cleanup_fclose_ FILE *f = NULL; int r; + /* Creates a systemd-veritysetup@.service instance for the special kernel cmdline specified root + usr devices. */ + assert(name); assert(service); @@ -124,11 +126,11 @@ static int create_device( } static int create_root_device(void) { - return create_device("root", SYSTEMD_VERITYSETUP_SERVICE_ROOT, arg_root_hash, arg_root_data_what, arg_root_hash_what, arg_root_options); + return create_special_device("root", SYSTEMD_VERITYSETUP_SERVICE_ROOT, arg_root_hash, arg_root_data_what, arg_root_hash_what, arg_root_options); } static int create_usr_device(void) { - return create_device("usr", SYSTEMD_VERITYSETUP_SERVICE_USR, arg_usr_hash, arg_usr_data_what, arg_usr_hash_what, arg_usr_options); + return create_special_device("usr", SYSTEMD_VERITYSETUP_SERVICE_USR, arg_usr_hash, arg_usr_data_what, arg_usr_hash_what, arg_usr_options); } static int parse_proc_cmdline_item(const char *key, const char *value, void *data) { @@ -299,7 +301,7 @@ static bool attach_in_initrd(const char *name, const char *options) { STR_IN_SET(name, "root", "usr"); } -static int create_disk( +static int create_veritytab_device( const char *name, const char *data_device, const char *hash_device, @@ -314,6 +316,8 @@ static int create_disk( bool noauto, nofail, netdev, need_loop = false; int r; + /* Creates a systemd-veritysetup@.service instance for volumes specified in /etc/veritytab. */ + assert(name); assert(data_device); assert(hash_device); @@ -475,7 +479,8 @@ static int add_veritytab_devices(void) { if (!hash_uuid) hash_uuid = path_startswith(hash_device, "/dev/disk/by-uuid/"); - r = create_disk(name, + r = create_veritytab_device( + name, data_device, hash_device, roothash, |