Re: time keeping fallback mechanics during reboot on octeon

2024-01-17 Thread Theo de Raadt
Did anyone try this idea: Theo de Raadt wrote: > Horrible hack that might work: > > Put a big #ifndef BOOT_QUIET inside ffs_sbupdate() to stop it from > doing the writeout. > > That option serves other purposes inside the BOOT kernels, but maybe > we can find another way of abstracting it bet

Re: time keeping fallback mechanics during reboot on octeon

2024-01-15 Thread Christian Gut
This behaved differently some releases ago. Since then the BOOT kernel had been introduced and then because of /dev/random and the upgrade kernel (bsd.upgrade) write access was needed. > On 14. Jan 2024, at 09:32, Alexander Hall wrote: > > I don't have mine (EdgeRouter lite) running anymore, b

Re: time keeping fallback mechanics during reboot on octeon

2024-01-14 Thread Theo de Raadt
Horrible hack that might work: Put a big #ifndef BOOT_QUIET inside ffs_sbupdate() to stop it from doing the writeout. That option serves other purposes inside the BOOT kernels, but maybe we can find another way of abstracting it better.

Re: time keeping fallback mechanics during reboot on octeon

2024-01-14 Thread Otto Moerbeek
On Sun, Jan 14, 2024 at 09:32:10AM +0100, Alexander Hall wrote: > I don't have mine (EdgeRouter lite) running anymore, but IIRC, I had a cron > job poking the root fs to"resolve" this. > > Sth like "mkdir /bump && rmdir /bump && sync". I have no idea how this would solve the "boot sets last mod

Re: time keeping fallback mechanics during reboot on octeon

2024-01-14 Thread Alexander Hall
I don't have mine (EdgeRouter lite) running anymore, but IIRC, I had a cron job poking the root fs to"resolve" this. Sth like "mkdir /bump && rmdir /bump && sync". /Alexander On January 12, 2024 2:35:47 PM GMT+01:00, Christian Gut wrote: >Hi, > >Could somebody point me to documentation or tel

Re: time keeping fallback mechanics during reboot on octeon

2024-01-13 Thread Mark Kettenis
> From: Theo de Raadt > Date: Sat, 13 Jan 2024 07:39:34 -0700 (MST) > > Blocking the timeupdate in ffs_sbupdate() will be difficult. > > It is probably easier to have the BOOT kernel learn the time (from the > true root filesystem), so that ffs_sbupdate() writes back the same > value. > > That

Re: time keeping fallback mechanics during reboot on octeon

2024-01-13 Thread Theo de Raadt
Blocking the timeupdate in ffs_sbupdate() will be difficult. It is probably easier to have the BOOT kernel learn the time (from the true root filesystem), so that ffs_sbupdate() writes back the same value. That means either an ugly way to reach inittodr() or the userland code in the bootblock cou

Re: time keeping fallback mechanics during reboot on octeon

2024-01-13 Thread Theo de Raadt
I think the BOOT kernel has done inittodr() with the stale value in the bootblock file. Stale, because this is never written back. Later it mounts a filesystem onto /mnt, which is the real root. That gets unmounted. It writes the stale time to that filesystem.

Re: time keeping fallback mechanics during reboot on octeon

2024-01-13 Thread Otto Moerbeek
On Sat, Jan 13, 2024 at 11:47:44AM +0100, Christian Gut wrote: > > > > On 13. Jan 2024, at 10:03, Christian Gut wrote: > > > > > > > >> On 13. Jan 2024, at 00:58, Theo de Raadt wrote: > >> > >> I suspect this is due to how powerpc64 and octeon boot. Their bootblocks > >> are > >> a speci

Re: time keeping fallback mechanics during reboot on octeon

2024-01-13 Thread Christian Gut
> On 13. Jan 2024, at 10:03, Christian Gut wrote: > > > >> On 13. Jan 2024, at 00:58, Theo de Raadt wrote: >> >> I suspect this is due to how powerpc64 and octeon boot. Their bootblocks are >> a special kernel called BOOT which mounts the ffs filesystem diretly. I >> suspect >> during t

Re: time keeping fallback mechanics during reboot on octeon

2024-01-13 Thread Otto Moerbeek
On Sat, Jan 13, 2024 at 10:03:20AM +0100, Christian Gut wrote: > > > > On 13. Jan 2024, at 00:58, Theo de Raadt wrote: > > > > I suspect this is due to how powerpc64 and octeon boot. Their bootblocks > > are > > a special kernel called BOOT which mounts the ffs filesystem diretly. I > > su

Re: time keeping fallback mechanics during reboot on octeon

2024-01-13 Thread Christian Gut
> On 13. Jan 2024, at 00:58, Theo de Raadt wrote: > > I suspect this is due to how powerpc64 and octeon boot. Their bootblocks are > a special kernel called BOOT which mounts the ffs filesystem diretly. I > suspect > during the transition to loading GENERIC.MP something wrong happens with t

Re: time keeping fallback mechanics during reboot on octeon

2024-01-13 Thread Christian Gut
> On 12. Jan 2024, at 19:39, Otto Moerbeek wrote: > > On Fri, Jan 12, 2024 at 07:15:43PM +0100, Christian Weisgerber wrote: > >> Otto Moerbeek: >> >>> http://man.openbsd.org/octrtc seems to suggest EdgeRouter does not have >>> an RTC. A dmesg should give more certainty. >> >> I think the or

Re: time keeping fallback mechanics during reboot on octeon

2024-01-12 Thread Theo de Raadt
I suspect this is due to how powerpc64 and octeon boot. Their bootblocks are a special kernel called BOOT which mounts the ffs filesystem diretly. I suspect during the transition to loading GENERIC.MP something wrong happens with the on-disk time information, which misleads the next kernel.

Re: time keeping fallback mechanics during reboot on octeon

2024-01-12 Thread Otto Moerbeek
On Fri, Jan 12, 2024 at 07:15:43PM +0100, Christian Weisgerber wrote: > Otto Moerbeek: > > > http://man.openbsd.org/octrtc seems to suggest EdgeRouter does not have > > an RTC. A dmesg should give more certainty. > > I think the original poster is aware of this. > > If I understand correctly, h

Re: time keeping fallback mechanics during reboot on octeon

2024-01-12 Thread Christian Weisgerber
Otto Moerbeek: > http://man.openbsd.org/octrtc seems to suggest EdgeRouter does not have > an RTC. A dmesg should give more certainty. I think the original poster is aware of this. If I understand correctly, he expects that on reboot the system clock is restored to the last value from before the

Re: time keeping fallback mechanics during reboot on octeon

2024-01-12 Thread Otto Moerbeek
On Fri, Jan 12, 2024 at 04:47:06PM +0100, Christian Gut wrote: > Hi Otto, > > > > On 12. Jan 2024, at 15:52, Otto Moerbeek wrote: > > > > On Fri, Jan 12, 2024 at 02:35:47PM +0100, Christian Gut wrote: > > > >> Hi, > >> > >> Could somebody point me to documentation or tell me where OpenBSD ge

Re: time keeping fallback mechanics during reboot on octeon

2024-01-12 Thread Christian Gut
Hi Otto, > On 12. Jan 2024, at 15:52, Otto Moerbeek wrote: > > On Fri, Jan 12, 2024 at 02:35:47PM +0100, Christian Gut wrote: > >> Hi, >> >> Could somebody point me to documentation or tell me where OpenBSD gets the >> time from, when the system has no RTC and ntpd is not working? >> >> I a

Re: time keeping fallback mechanics during reboot on octeon

2024-01-12 Thread Otto Moerbeek
On Fri, Jan 12, 2024 at 02:35:47PM +0100, Christian Gut wrote: > Hi, > > Could somebody point me to documentation or tell me where OpenBSD gets the > time from, when the system has no RTC and ntpd is not working? > > I am using an EdgeRouter / octeon and at every reboot, the date/time gets > r

time keeping fallback mechanics during reboot on octeon

2024-01-12 Thread Christian Gut
Hi, Could somebody point me to documentation or tell me where OpenBSD gets the time from, when the system has no RTC and ntpd is not working? I am using an EdgeRouter / octeon and at every reboot, the date/time gets reset to the exact same date. I tried to read the source code of boot(9) and i