rpms/util-linux-ng/devel util-linux-ng-2.14-dmesg-r.patch,NONE,1.1

Karel Zak kzak at fedoraproject.org
Fri Feb 20 09:23:39 UTC 2009


Author: kzak

Update of /cvs/pkgs/rpms/util-linux-ng/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28133

Added Files:
	util-linux-ng-2.14-dmesg-r.patch 
Log Message:
- add a missing patch


util-linux-ng-2.14-dmesg-r.patch:

--- NEW FILE util-linux-ng-2.14-dmesg-r.patch ---
>From 11ea22d5a3dbb69557a4e1c7e3c862b0765102b5 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax at redhat.com>
Date: Thu, 8 Jan 2009 11:44:27 -0500
Subject: [PATCH] dmesg: Add -r (raw) option.

Useful for debugging which kernel messages are ruining your quiet
bootup.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 sys-utils/dmesg.1 |    5 ++++-
 sys-utils/dmesg.c |    8 ++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/sys-utils/dmesg.1 b/sys-utils/dmesg.1
index d5dfa9d..33fd8b0 100644
--- a/sys-utils/dmesg.1
+++ b/sys-utils/dmesg.1
@@ -4,7 +4,7 @@
 .SH NAME
 dmesg \- print or control the kernel ring buffer
 .SH SYNOPSIS
-.BI "dmesg [ \-c ] [ \-n " level " ] [ \-s " bufsize " ]"
+.BI "dmesg [ \-c ] [ -r ] [ \-n " level " ] [ \-s " bufsize " ]"
 .SH DESCRIPTION
 .B dmesg
 is used to examine or control the kernel ring buffer.
@@ -22,6 +22,9 @@ file to whoever can debug their problem.
 .B \-c
 Clear the ring buffer contents after printing.
 .TP
+.B \-r
+Print the raw message buffer, i.e., don't strip the log level prefixes.
+.TP
 .BI \-s bufsize
 Use a buffer of size
 .I bufsize
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index ac0535d..b634d86 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -56,13 +56,14 @@ main(int argc, char *argv[]) {
 	int  level = 0;
 	int  lastc;
 	int  cmd = 3;		/* Read all messages in the ring buffer */
+	int  raw = 0;
 
 	setlocale(LC_ALL, "");
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	textdomain(PACKAGE);
 
 	progname = argv[0];
-	while ((c = getopt(argc, argv, "cn:s:")) != -1) {
+	while ((c = getopt(argc, argv, "crn:s:")) != -1) {
 		switch (c) {
 		case 'c':
 			cmd = 4;	/* Read and clear all messages */
@@ -71,6 +72,9 @@ main(int argc, char *argv[]) {
 			cmd = 8;	/* Set level of messages */
 			level = atoi(optarg);
 			break;
+		case 'r':
+			raw = 1;
+			break;
 		case 's':
 			bufsize = atoi(optarg);
 			if (bufsize < 4096)
@@ -131,7 +135,7 @@ main(int argc, char *argv[]) {
 
 	lastc = '\n';
 	for (i = 0; i < n; i++) {
-		if ((i == 0 || buf[i - 1] == '\n') && buf[i] == '<') {
+		if (!raw && (i == 0 || buf[i - 1] == '\n') && buf[i] == '<') {
 			i++;
 			while (buf[i] >= '0' && buf[i] <= '9')
 				i++;
-- 
1.6.0.6





More information about the fedora-extras-commits mailing list