public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Schlemmer <azarah@nosferatu.za.org>
To: Greg KH <greg@kroah.com>
Cc: linux-hotplug-devel@lists.sourceforge.net,
	Linux Kernel Mailing Lists <linux-kernel@vger.kernel.org>
Subject: Re: [ANNOUNCE] udev 016 release
Date: Tue, 03 Feb 2004 23:43:22 +0200	[thread overview]
Message-ID: <1075844602.7473.75.camel@nosferatu.lan> (raw)
In-Reply-To: <20040203201359.GB19476@kroah.com>


[-- Attachment #1.1: Type: text/plain, Size: 758 bytes --]

On Tue, 2004-02-03 at 22:13, Greg KH wrote:

Once again, patch to make logging a config option.

Reason for this (since you asked for it =):
- In our setup it is easy (although still annoying) .. just
edit the ebuild, add logging support (or remove it) and rebuild.
For say a binary distro, having the logging is useful for debugging
some times, but its more a once of, or rare thing, as you do not
add or change config files every day.  Sure, we can have logging
by default, but many do not want ~300 lines of extra debugging in
their logs is not pleasant, and they will complain.  Rebuilding
the package for that binary package (given the users it is targeted
to) is usually not within most users grasp.


Thanks,

-- 
Martin Schlemmer

[-- Attachment #1.2: udev-016-logging-config-option.patch --]
[-- Type: text/x-patch, Size: 4176 bytes --]

diff -uprN udev-016/Makefile udev-016.logging/Makefile
--- udev-016/Makefile	2004-02-03 22:55:30.201851776 +0200
+++ udev-016.logging/Makefile	2004-02-03 23:03:55.869978536 +0200
@@ -239,6 +239,7 @@ udev_version.h:
 	@echo \#define UDEV_CONFIG_FILE	\"$(configdir)\udev.conf\" >> $@
 	@echo \#define UDEV_RULES_FILE	\"$(configdir)\udev.rules\" >> $@
 	@echo \#define UDEV_PERMISSION_FILE	\"$(configdir)\udev.permissions\" >> $@
+	@echo \#define UDEV_LOG_DEFAULT \"yes\" >> $@
 	@echo \#define UDEV_BIN		\"$(DESTDIR)$(sbindir)/udev\" >> $@
 	@echo \#define UDEVD_BIN	\"$(DESTDIR)$(sbindir)/udevd\" >> $@
 	@echo \#define UDEVD_SOCK	\"$(udevdir)/\.udevd.sock\" >> $@
diff -uprN udev-016/etc/udev/udev.conf.in udev-016.logging/etc/udev/udev.conf.in
--- udev-016/etc/udev/udev.conf.in	2004-02-03 22:58:34.939767344 +0200
+++ udev-016.logging/etc/udev/udev.conf.in	2004-02-03 22:56:46.535247336 +0200
@@ -29,3 +29,6 @@ default_owner="root"
 #                 explicit match in the permissions file
 default_group="root"
 
+# udev_log - set to "yes" if you want logging, else "no"
+udev_log="yes"
+
diff -uprN udev-016/logging.h udev-016.logging/logging.h
--- udev-016/logging.h	2004-02-02 11:34:49.000000000 +0200
+++ udev-016.logging/logging.h	2004-02-03 23:04:51.204566400 +0200
@@ -33,6 +33,9 @@
 #include <stdarg.h>
 #include <syslog.h>
 
+#include "udev.h"
+#include "udev_version.h"
+
 #undef info
 #define info(format, arg...)								\
 	do {										\
@@ -62,6 +65,9 @@ static inline void log_message (int leve
 {
 	va_list	args;
 
+	if (0 != strncmp(udev_log_str, UDEV_LOG_DEFAULT, BOOL_SIZE))
+		return;
+
 	va_start(args, format);
 	vsyslog(level, format, args);
 	va_end(args);
diff -uprN udev-016/udev.h udev-016.logging/udev.h
--- udev-016/udev.h	2004-01-26 22:24:42.000000000 +0200
+++ udev-016.logging/udev.h	2004-02-03 23:03:25.682567720 +0200
@@ -32,6 +32,8 @@
 #define OWNER_SIZE	30
 #define GROUP_SIZE	30
 #define MODE_SIZE	8
+#define BOOL_SIZE	5	/* 'yes', 'no' and possibly 'true' or 'false'
+				   in future */
 
 struct udevice {
 	char name[NAME_SIZE];
@@ -72,5 +74,6 @@ extern char udev_rules_filename[PATH_MAX
 extern char default_mode_str[MODE_SIZE];
 extern char default_owner_str[OWNER_SIZE];
 extern char default_group_str[GROUP_SIZE];
+extern char udev_log_str[BOOL_SIZE];
 
 #endif
diff -uprN udev-016/udev_config.c udev-016.logging/udev_config.c
--- udev-016/udev_config.c	2004-02-03 23:00:40.438688608 +0200
+++ udev-016.logging/udev_config.c	2004-02-03 22:56:46.649230008 +0200
@@ -48,6 +48,7 @@ char udev_config_filename[PATH_MAX+NAME_
 char default_mode_str[MODE_SIZE];
 char default_owner_str[OWNER_SIZE];
 char default_group_str[GROUP_SIZE];
+char udev_log_str[BOOL_SIZE];
 
 
 static void init_variables(void)
@@ -60,6 +61,7 @@ static void init_variables(void)
 	strfieldcpy(udev_config_filename, UDEV_CONFIG_FILE);
 	strfieldcpy(udev_rules_filename, UDEV_RULES_FILE);
 	strfieldcpy(udev_permissions_filename, UDEV_PERMISSION_FILE);
+	strfieldcpy(udev_log_str, UDEV_LOG_DEFAULT);
 }
 
 #define set_var(_name, _var)				\
@@ -156,6 +158,7 @@ static int parse_config_file(void)
 		set_var("default_mode", default_mode_str);
 		set_var("default_owner", default_owner_str);
 		set_var("default_group", default_group_str);
+		set_var("udev_log", udev_log_str);
 	}
 	dbg_parse("%s:%d:%Zd: error parsing '%s'", udev_config_filename,
 		  lineno, temp - line, temp);
@@ -191,6 +194,7 @@ static void get_dirs(void)
 	dbg_parse("udev_db_filename = %s", udev_db_filename);
 	dbg_parse("udev_rules_filename = %s", udev_rules_filename);
 	dbg_parse("udev_permissions_filename = %s", udev_permissions_filename);
+	dbg_parse("udev_log_str = %s", udev_log_str);
 	parse_config_file();
 
 	dbg_parse("udev_root = %s", udev_root);
@@ -198,6 +202,7 @@ static void get_dirs(void)
 	dbg_parse("udev_db_filename = %s", udev_db_filename);
 	dbg_parse("udev_rules_filename = %s", udev_rules_filename);
 	dbg_parse("udev_permissions_filename = %s", udev_permissions_filename);
+	dbg_parse("udev_log_str = %s", udev_log_str);
 }
 
 void udev_init_config(void)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2004-02-03 21:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-03 20:13 [ANNOUNCE] udev 016 release Greg KH
2004-02-03 20:49 ` Martin Schlemmer
2004-02-03 23:14   ` Greg KH
2004-02-03 21:28 ` Martin Schlemmer
2004-02-03 23:03   ` Martin Schlemmer
2004-02-03 23:13     ` Greg KH
2004-02-04  0:01       ` Kay Sievers
2004-02-04  4:25       ` Martin Schlemmer
2004-02-08 11:27         ` Martin Schlemmer
2004-02-08 13:01           ` Martin Schlemmer
2004-02-03 21:43 ` Martin Schlemmer [this message]
2004-02-11 22:13   ` Greg KH
2004-02-11 22:27     ` Martin Schlemmer
2004-02-12  1:19       ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1075844602.7473.75.camel@nosferatu.lan \
    --to=azarah@nosferatu.za.org \
    --cc=greg@kroah.com \
    --cc=linux-hotplug-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox