Currently in initrd, hardware clock is always considered to use UTC time format and system time zone is also UTC. Thus system time isn't correct if hw clock is localtime or we're using other time zone in real root.
To fix this, install /etc/adjtime and /etc/localtime to initrd.
Previously, this functionality was implemented in dracut base module:
commit 77364fd Author: WANG Chao chaowang@redhat.com
base: setup correct system time and time zone in initrd
But some people complains about a normal boot initrd needs to rebuild every time if time zone is changed. So let's fix it on our side.
Signed-off-by: WANG Chao chaowang@redhat.com --- dracut-module-setup.sh | 1 + 1 file changed, 1 insertion(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 725eecf..3c64d00 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -403,6 +403,7 @@ install() { if is_ssh_dump_target; then dracut_install /var/lib/random-seed || exit $? fi + dracut_install -o /etc/adjtime /etc/localtime inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress" chmod +x ${initdir}/kdumpscripts/monitor_dd_progress inst "/bin/dd" "/bin/dd"
On Mon, Jul 29, 2013 at 04:19:46PM +0800, WANG Chao wrote:
Currently in initrd, hardware clock is always considered to use UTC time format and system time zone is also UTC. Thus system time isn't correct if hw clock is localtime or we're using other time zone in real root.
To fix this, install /etc/adjtime and /etc/localtime to initrd.
Previously, this functionality was implemented in dracut base module:
What does /etc/adjtime and /etc/localtime do? How does systemd gets right time stamps in journal in this case?
Thanks Vivek
commit 77364fd Author: WANG Chao chaowang@redhat.com
base: setup correct system time and time zone in initrd
But some people complains about a normal boot initrd needs to rebuild every time if time zone is changed. So let's fix it on our side.
Signed-off-by: WANG Chao chaowang@redhat.com
dracut-module-setup.sh | 1 + 1 file changed, 1 insertion(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 725eecf..3c64d00 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -403,6 +403,7 @@ install() { if is_ssh_dump_target; then dracut_install /var/lib/random-seed || exit $? fi
- dracut_install -o /etc/adjtime /etc/localtime inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress" chmod +x ${initdir}/kdumpscripts/monitor_dd_progress inst "/bin/dd" "/bin/dd"
-- 1.8.3.1
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 07/30/13 at 03:45pm, Vivek Goyal wrote:
On Mon, Jul 29, 2013 at 04:19:46PM +0800, WANG Chao wrote:
Currently in initrd, hardware clock is always considered to use UTC time format and system time zone is also UTC. Thus system time isn't correct if hw clock is localtime or we're using other time zone in real root.
To fix this, install /etc/adjtime and /etc/localtime to initrd.
Previously, this functionality was implemented in dracut base module:
What does /etc/adjtime and /etc/localtime do? How does systemd gets right time stamps in journal in this case?
/etc/adjtime is mainly used to determine whether RTC (hareware clock) is configured in UTC or localtime standard/format. Without this file, RTC is considered to store time in UTC standard.
/etc/localtime is used for system clock to determine the timezone. It's usually a symbolic link to a tz info file under /usr/share/zoneinfo/.
For example in my desktop: # ll /etc/localtime lrwxrwxrwx. 1 root root 35 Apr 18 19:27 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai
Thanks WANG Chao
On Mon, Jul 29, 2013 at 04:19:46PM +0800, WANG Chao wrote:
Currently in initrd, hardware clock is always considered to use UTC time format and system time zone is also UTC. Thus system time isn't correct if hw clock is localtime or we're using other time zone in real root.
To fix this, install /etc/adjtime and /etc/localtime to initrd.
Previously, this functionality was implemented in dracut base module:
commit 77364fd Author: WANG Chao chaowang@redhat.com
base: setup correct system time and time zone in initrd
But some people complains about a normal boot initrd needs to rebuild every time if time zone is changed. So let's fix it on our side.
Signed-off-by: WANG Chao chaowang@redhat.com
Acked-by: Vivek Goyal vgoyal@redhat.com
Vivek
dracut-module-setup.sh | 1 + 1 file changed, 1 insertion(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 725eecf..3c64d00 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -403,6 +403,7 @@ install() { if is_ssh_dump_target; then dracut_install /var/lib/random-seed || exit $? fi
- dracut_install -o /etc/adjtime /etc/localtime inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress" chmod +x ${initdir}/kdumpscripts/monitor_dd_progress inst "/bin/dd" "/bin/dd"
-- 1.8.3.1
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec