diff options
| author | Yelninei <yelninei@tutamail.com> | 2025-12-28 10:49:40 +0000 |
|---|---|---|
| committer | Rutherther <rutherther@ditigal.xyz> | 2026-01-25 21:17:37 +0100 |
| commit | 2e25daf39dac8bca411889ba1f4f7597b77228ec (patch) | |
| tree | 8ba8dd96a11edbcddc3ac02392ec820f3b9ce199 | |
| parent | 7472e6c3fd46b9ac2dce2e3a01ecee621d69f1b2 (diff) | |
gnu: gnumach: Don't truncate kernel messages.
* gnu/packages/patches/gnumach-kmsg-overflow.patch: New patch
* gnu/local.mk (dist_path_DATA): Register patch.
* gnu/packages/hurd.scm (gnumach): Add the patch.
Change-Id: Ibc75e9374426fe4aacbc94c1265d7dbb77386afa
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/hurd.scm | 3 | ||||
| -rw-r--r-- | gnu/packages/patches/gnumach-kmsg-overflow.patch | 59 |
3 files changed, 62 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index cc1b3c61413..ea9fc47ad78 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1508,6 +1508,7 @@ dist_patch_DATA = \ %D%/packages/patches/gnome-tweaks-search-paths.patch \ %D%/packages/patches/gnulib-bootstrap.patch \ %D%/packages/patches/gnumach-div0.patch \ + %D%/packages/patches/gnumach-kmsg-overflow.patch \ %D%/packages/patches/gnumach-version.patch \ %D%/packages/patches/gnupg-default-pinentry.patch \ %D%/packages/patches/gnupg-1-build-with-gcc10.patch \ diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index f99527f8f31..84ae9a4a2c9 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -279,7 +279,8 @@ Hurd-minimal package which are needed for both glibc and GCC.") (inherit (package-source gnumach-headers)) (patches (append (origin-patches (package-source gnumach-headers)) - (search-patches "gnumach-div0.patch"))))) + (search-patches "gnumach-div0.patch" + "gnumach-kmsg-overflow.patch"))))) (arguments (substitute-keyword-arguments (package-arguments gnumach-headers) ((#:configure-flags flags ''()) diff --git a/gnu/packages/patches/gnumach-kmsg-overflow.patch b/gnu/packages/patches/gnumach-kmsg-overflow.patch new file mode 100644 index 00000000000..8a1c2747e43 --- /dev/null +++ b/gnu/packages/patches/gnumach-kmsg-overflow.patch @@ -0,0 +1,59 @@ +Upstream Status: https://lists.gnu.org/archive/html/bug-hurd/2025-12/msg00043.html + +From 2c9868cd8974e75a028349aa1ec9b1417f5d6617 Mon Sep 17 00:00:00 2001 +From: Yelninei <yelninei@tutamail.com> +Date: Thu, 2 Oct 2025 16:20:00 +0000 +Subject: [PATCH] kmsg: Don't truncate messages when overflowing. + +Instead of discarding a character drop the first unread one. +--- + device/kmsg.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +diff --git a/device/kmsg.c b/device/kmsg.c +index e5b518e6..bb72930d 100644 +--- a/device/kmsg.c ++++ b/device/kmsg.c +@@ -217,7 +217,6 @@ void + kmsg_putchar (int c) + { + io_req_t ior; +- int offset; + spl_t s = -1; + + /* XXX: cninit is not called before cnputc is used. So call kmsginit +@@ -230,22 +229,20 @@ kmsg_putchar (int c) + + if (spl_init) + s = simple_lock_irq (&kmsg_lock); +- offset = kmsg_write_offset + 1; +- if (offset == KMSGBUFSIZE) +- offset = 0; +- +- if (offset == kmsg_read_offset) +- { +- /* Discard C. */ +- if (spl_init) +- simple_unlock_irq (s, &kmsg_lock); +- return; +- } + + kmsg_buffer[kmsg_write_offset++] = c; + if (kmsg_write_offset == KMSGBUFSIZE) + kmsg_write_offset = 0; + ++ if(kmsg_write_offset == kmsg_read_offset) ++ { ++ /* Drop first unread char */ ++ kmsg_read_offset++; ++ if (kmsg_read_offset == KMSGBUFSIZE) ++ kmsg_read_offset = 0; ++ } ++ ++ + while ((ior = (io_req_t) dequeue_head (&kmsg_read_queue)) != NULL) + iodone (ior); + +-- +2.52.0 + |
