Commit 06636adb authored by Benoit Rat's avatar Benoit Rat Committed by Adam Wujek

tools/init.d: wr_date: fix back TAI offset in kernel

Fix TAI offset into kernel was done withing get function but this has
been removed in commit #91f4c8d. As it is still needed by slave, we
force its use using -n option. This will only fix tai offset into kernel
without applying ToD to WR/FPGA time.

Conflicts:
	userspace/tools/wr_date.c
parent 3982aea4
#!/bin/sh
# First of all, run wr_date, so to fix tai_offset in the kernel
/wr/bin/wr_date get > /dev/null
# First of all, run wr_date -n set, so to fix tai_offset in the kernel
/wr/bin/wr_date -n set host > /dev/null
F=/etc/wr_date.conf
......
......@@ -427,10 +427,17 @@ int __wrdate_internal_set(struct PPSG_WB *pps, int deep)
if ( deep > 4 )
return 0; /* Avoid stack overflow (recursive function) in case of error */
if ( deep==0 ) {
tai_offset = fix_host_tai();
if (opt_not) {
if (!opt_verbose) return 0;
printf("Nothing done: -n option selected\n");
} else {
if ( deep==0) {
modRemoved=removeClockSourceModule(); // The driver must be removed otherwise the time cannot be set properly
}
tai_offset = fix_host_tai();
usleep(100);
gettimeofday(&tvh, NULL);
......@@ -486,7 +493,7 @@ int __wrdate_internal_set(struct PPSG_WB *pps, int deep)
if ( deep==0 && modRemoved ) {
installClockSourceModule();
}
}
if (opt_verbose && deep==0) {
usleep(100);
gettimeofday(&tvh, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment