install:
install -D -m 755 swup.py ${DESTDIR}/usr/bin/swup
install -D -m 755 system-update.sh ${DESTDIR}/usr/bin/system-update
- install -D -m 644 system-update.service ${DESTDIR}/usr/lib/systemd/system/system-update.service
+ install -D -m 644 system-update@.service ${DESTDIR}/usr/lib/systemd/system/system-update@.service
install -D -m 644 system-restore.target ${DESTDIR}/usr/lib/systemd/system/system-restore.target
- install -D -m 644 system-update.service ${DESTDIR}/usr/lib/systemd/system/factory-reset.target
+ install -D -m 644 factory-reset.target ${DESTDIR}/usr/lib/systemd/system/factory-reset.target
%install
%make_install
-%install_service system-update.target.wants system-update.service
-%install_service system-restore.target.wants system-update.service
-%install_service factory-reset.target.wants system-update.service
-
+%install_service system-update.target.wants system-update@update.service
+%install_service system-restore.target.wants system-update@system.service
+%install_service factory-reset.target.wants system-update@factory.service
+# fix symlinks
+ln -sf ../system-update@.service %{buildroot}/%{_unitdir}/system-update.target.wants/system-update@update.service
+ln -sf ../system-update@.service %{buildroot}/%{_unitdir}/system-restore.target.wants/system-update@system.service
+ln -sf ../system-update@.service %{buildroot}/%{_unitdir}/factory-reset.target.wants/system-update@factory.service
%files
%defattr(-,root,root)
%{_bindir}/swup
%{_bindir}/system-update
-%{_unitdir}/system-update.service
+%{_unitdir}/system-update@.service
%{_unitdir}/system-restore.target
%{_unitdir}/factory-reset.target
-%{_unitdir}/system-update.target.wants/system-update.service
-%{_unitdir}/system-restore.target.wants/system-update.service
-%{_unitdir}/factory-reset.target.wants/system-update.service
-
-%changelog
-
+%{_unitdir}/system-update.target.wants/system-update@update.service
+%{_unitdir}/system-restore.target.wants/system-update@system.service
+%{_unitdir}/factory-reset.target.wants/system-update@factory.service
snapper undochange 1..0
}
-if [ -f /var/lib/snapshot-restore ]; then
+if [[ "$1" = "system" && -f /var/lib/snapshot-restore ]]; then
system_restore
-elif [ -f /var/lib/factory-restore ]; then
+elif [[ "$1" = "factory" && -f /var/lib/factory-restore ]]; then
factory_restore
-elif [ -e /system-update ]; then
+elif [[ "$1" = "update" ]]; then
system_update
fi
[Unit]
-Description=Tizen System Updater
+Description=Tizen System Updater for %i
DefaultDependencies=no
OnFailure=reboot.target
Requires=systemd-remount-fs.service plymouth-update.service dbus.service
#StandardInput=tty-force
StandardOutput=tty-force
RemainAfterExit=no
-ExecStart=/usr/bin/system-update
+ExecStart=/usr/bin/system-update %i