diff --git a/dom0/pm-utils/01qubes-sync-vms-clock b/dom0/pm-utils/01qubes-sync-vms-clock new file mode 100755 index 00000000..47e7c593 --- /dev/null +++ b/dom0/pm-utils/01qubes-sync-vms-clock @@ -0,0 +1,15 @@ +#!/bin/sh + +. "${PM_FUNCTIONS}" + +sync_qubes_vms_wallclock() +{ +DATE=$(date) +echo "Syncing VMs clock to: $DATE" +qvm-run --all -u root "date -s \"$DATE\"" +} + +case "$1" in + thaw|resume) sync_qubes_vms_wallclock ;; + *) exit 0 ;; +esac diff --git a/rpm_spec/core-dom0.spec b/rpm_spec/core-dom0.spec index ed1ca802..3578dfa6 100644 --- a/rpm_spec/core-dom0.spec +++ b/rpm_spec/core-dom0.spec @@ -94,6 +94,10 @@ mkdir -p $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/ cp ../common/qubes_nmhook $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/ mkdir -p $RPM_BUILD_ROOT/etc/sysconfig cp init.d/iptables $RPM_BUILD_ROOT/etc/sysconfig + +mkdir -p $RPM_BUILD_ROOT/usr/lib64/pm-utils/sleep.d +cp pm-utils/01qubes-sync-vms-clock $RPM_BUILD_ROOT/usr/lib64/pm-utils/sleep.d/ + %post if [ "$1" != 1 ] ; then @@ -190,3 +194,4 @@ fi /etc/dhclient.d/qubes_setup_dnat_to_ns.sh /etc/NetworkManager/dispatcher.d/qubes_nmhook /etc/sysconfig/iptables +/usr/lib64/pm-utils/sleep.d/01qubes-sync-vms-clock