SET(deviced-shutdown_LDFLAGS ${pkgs_LDFLAGS})
TARGET_LINK_LIBRARIES(deviced-shutdown ${pkgs_LDFLAGS} "-lrt -ldl -lm" shared)
INSTALL(TARGETS deviced-shutdown DESTINATION /usr/lib/systemd)
- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown@.service DESTINATION /usr/lib/systemd/system)
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown@.service
+ DESTINATION /usr/lib/systemd/system)
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown-reboot.conf
+ DESTINATION /usr/lib/systemd/system/systemd-reboot.service.d)
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown-poweroff.conf
+ DESTINATION /usr/lib/systemd/system/systemd-poweroff.service.d)
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown-halt.conf
+ DESTINATION /usr/lib/systemd/system/systemd-halt.service.d)
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown-exit.conf
+ DESTINATION /usr/lib/systemd/system/systemd-exit.service.d)
ADD_EXECUTABLE(deviced-request-shutdown src/power-command/command.c src/core/common.c src/core/execute.c)
SET(deviced-request-shutdown_LDFLAGS ${pkgs_LDFLAGS})
%install_service basic.target.wants sdb-prestart.service
%endif
-for i in reboot halt poweroff exit; do
- D=%{buildroot}%{_unitdir}/systemd-${i}.service.wants
- mkdir -p $D
- ln -s ../deviced-request-shutdown@.service $D/deviced-request-shutdown@${i}.service
-done
-
mkdir -p %{buildroot}%{TZ_SYS_DUMPGEN}
install -m 775 scripts/dump_pmstate_log.sh %{buildroot}%{TZ_SYS_DUMPGEN}/dump_pmstate_log.sh
# Assume power module is on (-DPOWER_MODULE=on)
%{_unitdir}/deviced-request-shutdown@.service
-%{_unitdir}/systemd-exit.service.wants/deviced-request-shutdown@exit.service
-%{_unitdir}/systemd-halt.service.wants/deviced-request-shutdown@halt.service
-%{_unitdir}/systemd-reboot.service.wants/deviced-request-shutdown@reboot.service
-%{_unitdir}/systemd-poweroff.service.wants/deviced-request-shutdown@poweroff.service
+%{_unitdir}/systemd-reboot.service.d/deviced-request-shutdown-reboot.conf
+%{_unitdir}/systemd-poweroff.service.d/deviced-request-shutdown-poweroff.conf
+%{_unitdir}/systemd-halt.service.d/deviced-request-shutdown-halt.conf
+%{_unitdir}/systemd-exit.service.d/deviced-request-shutdown-exit.conf
%{_prefix}/lib/systemd/deviced-shutdown
%{_sbindir}/deviced-request-shutdown
--- /dev/null
+[Unit]
+Wants=deviced-request-shutdown@exit.service
+After=deviced-request-shutdown@exit.service
--- /dev/null
+[Unit]
+Wants=deviced-request-shutdown@halt.service
+After=deviced-request-shutdown@halt.service
--- /dev/null
+[Unit]
+Wants=deviced-request-shutdown@poweroff.service
+After=deviced-request-shutdown@poweroff.service
--- /dev/null
+[Unit]
+Wants=deviced-request-shutdown@reboot.service
+After=deviced-request-shutdown@reboot.service