[systemd-devel] date/time set to epoch when using readonly rootfs

Lennart Poettering lennart at poettering.net
Fri Oct 23 11:00:51 UTC 2020


On Fr, 23.10.20 10:37, Belisko Marek (marek.belisko at gmail.com) wrote:

> > > Sorry I mixed up things. Can you pls guide where can I find code which
> > > set date/time from timestamp? Thanks
> >
> > This is the stuff PID 1 calls during earliest boot:
> >
> > https://github.com/systemd/systemd/blob/master/src/shared/clock-util.c#L147
> Thanks a lot. I found an issue. The build system set config flag
> -time-epoch=0 (reason was to avoid performing fsck on every boot when
> inavlid date/time is detected for boards which don't have rtc [0])
> and this resulted in date 1.1.1970.

All RH-based distro have patched the time check out of e2fsck since a
long time. In particular in RTC-less systems it sounds like a very
poor idea to leave that in. The right fix is certainly to remove this
behaviour from fsck, and not to force an unnecessarily wrong time.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list