diff --git a/vm-init.d/qubes_core b/vm-init.d/qubes_core index 5050816..eb02e77 100755 --- a/vm-init.d/qubes_core +++ b/vm-init.d/qubes_core @@ -29,6 +29,13 @@ start() (grep -v "\<$name\>" /etc/hosts; echo "127.0.0.1 $name") > /etc/hosts fi + timezone=`/usr/bin/xenstore-read qubes-timezone 2> /dev/null` + if [ -n "$timezone" ]; then + ln -f /usr/share/zoneinfo/$timezone /etc/localtime + echo "# Clock configuration autogenerated based on Qubes dom0 settings" > /etc/sysconfig/clock + echo "ZONE=\"$timezone\"" >> /etc/sysconfig/clock + fi + # Set IP address again (besides action in udev rules); this is needed by # DispVM (to override DispVM-template IP) and in case when qubes_ip was # called by udev before loading evtchn kernel module - in which case diff --git a/vm-systemd/qubes-sysinit.sh b/vm-systemd/qubes-sysinit.sh index 32d9a1a..da13faf 100755 --- a/vm-systemd/qubes-sysinit.sh +++ b/vm-systemd/qubes-sysinit.sh @@ -48,3 +48,9 @@ if [ -n "$name" ]; then (grep -v "\<$name\>" /etc/hosts; echo "127.0.0.1 $name") > /etc/hosts fi +timezone=`$XS_READ qubes-timezone 2> /dev/null` +if [ -n "$timezone" ]; then + ln -f /usr/share/zoneinfo/$timezone /etc/localtime + echo "# Clock configuration autogenerated based on Qubes dom0 settings" > /etc/sysconfig/clock + echo "ZONE=\"$timezone\"" >> /etc/sysconfig/clock +fi