From: Adrian Vovk Date: Fri, 9 May 2025 19:35:38 +0000 (-0400) Subject: kmsg-reader: Seek to the end of the ringbuffer X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fdmesg-replay;p=thirdparty%2Fplymouth.git kmsg-reader: Seek to the end of the ringbuffer Otherwise, whenever plymouth starts we'd replay all previous kmsg entries, even if they've already been logged to the console. This leads to duplicated log entires, and makes it hard to debug things. With /dev/console, we only log what we capture while Plymouth is running. Let's do the same with /dev/kmsg --- diff --git a/src/libply-splash-core/ply-kmsg-reader.c b/src/libply-splash-core/ply-kmsg-reader.c index 439da415..9e9de214 100644 --- a/src/libply-splash-core/ply-kmsg-reader.c +++ b/src/libply-splash-core/ply-kmsg-reader.c @@ -204,6 +204,8 @@ ply_kmsg_reader_start (ply_kmsg_reader_t *kmsg_reader) if (kmsg_reader->kmsg_fd < 0) return; + lseek (kmsg_reader->kmsg_fd, 0, SEEK_END); + kmsg_reader->fd_watch = ply_event_loop_watch_fd (ply_event_loop_get_default (), kmsg_reader->kmsg_fd, PLY_EVENT_LOOP_FD_STATUS_HAS_DATA, (ply_event_handler_t) handle_kmsg_message, NULL,