- if (arg_proc_cmdline_disks) {
- /*
- If luks UUIDs are specified on the kernel command line, use them as a filter
- for /etc/crypttab and only generate units for those.
- */
- STRV_FOREACH(i, arg_proc_cmdline_disks) {
- char *proc_device, *proc_name;
- const char *p = *i;
-
- if (startswith(p, "luks-"))
- p += 5;
-
- proc_name = strappend("luks-", p);
- proc_device = strappend("UUID=", p);
-
- if (!proc_name || !proc_device) {
- log_oom();
- r = EXIT_FAILURE;
- free(proc_name);
- free(proc_device);
- goto finish;
- }
- if (streq(proc_device, device) || streq(proc_name, name)) {
- char **t;
-
- if (create_disk(name, device, password, options) < 0)
- r = EXIT_FAILURE;
-
- t = strv_append(arg_proc_cmdline_disks_done, p);
- if (!t) {
- r = log_oom();
- goto finish;
- }
- strv_free(arg_proc_cmdline_disks_done);
- arg_proc_cmdline_disks_done = t;
- }
-
- free(proc_device);
- free(proc_name);
- }
- } else {
- if (create_disk(name, device, password, options) < 0)
- r = EXIT_FAILURE;
- }
+ HASHMAP_FOREACH(d, arg_disks, i) {
+ const char *options;
+ _cleanup_free_ char *device = NULL;