]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
kmsg-reader: Seek to the end of the ringbuffer dmesg-replay
authorAdrian Vovk <adrianvovk@gmail.com>
Fri, 9 May 2025 19:35:38 +0000 (15:35 -0400)
committerAdrian Vovk <adrianvovk@gmail.com>
Mon, 12 May 2025 20:05:43 +0000 (16:05 -0400)
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

src/libply-splash-core/ply-kmsg-reader.c

index 439da415b1e798a48b0feab2ce6f28a03870448d..9e9de214c9137b21c0aca5e56740b6448df05822 100644 (file)
@@ -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,