diff --git a/src/hibernate-resume/hibernate-resume-generator.c b/src/hibernate-resume/hibernate-resume-generator.c index 3f49f564d..5e40933fd 100644 --- a/src/hibernate-resume/hibernate-resume-generator.c +++ b/src/hibernate-resume/hibernate-resume-generator.c @@ -5,6 +5,7 @@ #include #include "alloc-util.h" +#include "dropin.h" #include "fstab-util.h" #include "generator.h" #include "log.h" @@ -68,18 +69,18 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat } static int process_resume(void) { - _cleanup_free_ char *name = NULL, *lnk = NULL; - const char *opts; + _cleanup_free_ char *service_unit = NULL, *device_unit = NULL, *lnk = NULL; int r; if (!arg_resume_device) return 0; - r = unit_name_from_path_instance("systemd-hibernate-resume", arg_resume_device, ".service", &name); + r = unit_name_from_path_instance("systemd-hibernate-resume", arg_resume_device, ".service", + &service_unit); if (r < 0) return log_error_errno(r, "Failed to generate unit name: %m"); - lnk = strjoin(arg_dest, "/" SPECIAL_SYSINIT_TARGET ".wants/", name); + lnk = strjoin(arg_dest, "/" SPECIAL_SYSINIT_TARGET ".wants/", service_unit); if (!lnk) return log_oom(); @@ -87,12 +88,21 @@ static int process_resume(void) { if (symlink(SYSTEM_DATA_UNIT_PATH "/systemd-hibernate-resume@.service", lnk) < 0) return log_error_errno(errno, "Failed to create symlink %s: %m", lnk); - if (arg_resume_options) - opts = arg_resume_options; - else - opts = arg_root_options; + r = unit_name_from_path(arg_resume_device, ".device", &device_unit); + if (r < 0) + return log_error_errno(r, "Failed to generate unit name: %m"); - r = generator_write_timeouts(arg_dest, arg_resume_device, arg_resume_device, opts, NULL); + r = write_drop_in(arg_dest, device_unit, 40, "device-timeout", + "# Automatically generated by systemd-cryptsetup-generator\n\n" + "[Unit]\nJobTimeoutSec=0"); + if (r < 0) + log_warning_errno(r, "Failed to write device timeout drop-in: %m"); + + r = generator_write_timeouts(arg_dest, + arg_resume_device, + arg_resume_device, + arg_resume_options ?: arg_root_options, + NULL); if (r < 0) return r; diff --git a/src/login/71-seat.rules.in b/src/login/71-seat.rules.in index 2a9ddb93a..2bbd18363 100644 --- a/src/login/71-seat.rules.in +++ b/src/login/71-seat.rules.in @@ -32,12 +32,9 @@ SUBSYSTEM=="pci", ENV{ID_PCI_CLASS_FROM_DATABASE}=="Display controller", \ SUBSYSTEM=="drm", KERNEL=="card[0-9]*", TAG+="seat", TAG+="master-of-seat" SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat" -# 'Plugable UD-160' USB hub, sound, network, graphics adapter +# 'Plugable' USB hub, sound, network, graphics adapter SUBSYSTEM=="usb", ATTR{idVendor}=="2230", ATTR{idProduct}=="000[13]", ENV{ID_AUTOSEAT}="1" -# 'Plugable UD-PRO8' USB hub, sound, network, graphics adapter -SUBSYSTEM=="usb", ATTR{idVendor}=="1a40", ATTR{idProduct}=="0201", ENV{ID_AUTOSEAT}="1" - # qemu (version 2.4+) has a PCI-PCI bridge (-device pci-bridge-seat) to group # devices belonging to one seat. See: # http://git.qemu.org/?p=qemu.git;a=blob;f=docs/multiseat.txt