On Mon, Mar 03, 2014 at 06:36:47PM +0800, WANG Chao wrote:
On s390x, RTC or hardware clock doesn't exist. s390 is using a
more
precise clock source TOD, which is storing time in UTC format.
The problem is /etc/adjtime installed by anaconda is saying LOCAL (this
is actually a bug in anaconda), which means it's telling the userspace
that RTC is storing time in local time format. This is bug and it
confuses the init system (systemd in this case) particularly when init
is trying to setup the system time.
In a normal boot, this wrong adjtime file makes the system time wrong at
first, but the system time is corrected by NTP daemon later.
Unfortunately, in kdump case, we don't use NTP or any time synchronizing
userspace at all. The result is systemd sets the system clock wrong
(hours drifted regarding the timezone).
To avoid such problem, either /etc/adjtime should be saying UTC at its
third line or /etc/adjtime shouldn't exist.
Given the fact that anaconda has deferred the bug to the next release,
we should first fix this problem in our kdump to avoid this issue by not
installing /etc/adjtime in our kdump initramfs.
I think we should not do anything on kdump side. This is an anaconda issue
and they should generate right /etc/adjtime file and we should include
that file.
I am worried that what if down the line s390 hardware supports both UTC
clock and provides option to also configure clock in local time. Then
kdump is broken again.
So this is an anaconda issue and anaconda should fix it.
Thanks
Vivek
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
Acked-by: Dave Young <dyoung(a)redhat.com>
---
dracut-module-setup.sh | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index bdadf7c..d5951ca 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -460,6 +460,16 @@ kdump_install_random_seed() {
bs=$poolsize count=1 2> /dev/null
}
+# /etc/adjtime is used to determine RTC time format (UTC or localtime)
+# /etc/localtime is used to set system timezone
+kdump_install_time() {
+ # RTC doesn't exist on s390
+ if [ `uname -m` != "s390x" ]; then
+ dracut_install -o /etc/adjtime
+ fi
+ dracut_install -o /etc/localtime
+}
+
install() {
kdump_install_conf
>"$initdir/lib/dracut/no-emergency-shell"
@@ -467,7 +477,7 @@ install() {
if is_ssh_dump_target; then
kdump_install_random_seed
fi
- dracut_install -o /etc/adjtime /etc/localtime
+ kdump_install_time
inst "$moddir/monitor_dd_progress"
"/kdumpscripts/monitor_dd_progress"
chmod +x ${initdir}/kdumpscripts/monitor_dd_progress
inst "/bin/dd" "/bin/dd"
--
1.8.5.3
_______________________________________________
kexec mailing list
kexec(a)lists.fedoraproject.org
https://lists.fedoraproject.org/mailman/listinfo/kexec