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 015 release
Date: Thu, 29 Jan 2004 20:30:20 +0200	[thread overview]
Message-ID: <1075401020.7680.25.camel@nosferatu.lan> (raw)
In-Reply-To: <20040126215036.GA6906@kroah.com>


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

On Mon, 2004-01-26 at 23:50, Greg KH wrote:

I see latest version is very noisy, and although it is a good option
to have, I think it should be tweakable (and recompiling is not always
an option if you want some quick debugging).

Attached is a simple patch to add a config option to udev.conf to toggle
logging.


Thanks,

-- 
Martin Schlemmer

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

--- udev-015/Makefile	2004-01-29 20:03:55.920842712 +0200
+++ udev-015.log_option/Makefile	2004-01-29 20:20:06.758252992 +0200
@@ -232,6 +232,7 @@
 	@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\" >> $@
 
 # config files automatically generated
 GEN_CONFIGS =	$(LOCAL_CFG_DIR)/udev.conf
@@ -252,12 +253,12 @@
 	$(LD) $(LDFLAGS) -o $@ $(CRT0) udevinfo.o logging.o udev_config.o udevdb.o $(SYSFS) $(TDB) $(LIB_OBJS) $(ARCH_LIB_OBJS)
 	$(STRIPCMD) $@
 
-$(DAEMON): udevd.h udevd.o udevd.o logging.o
-	$(LD) $(LDFLAGS) -o $@ $(CRT0) udevd.o logging.o $(LIB_OBJS) $(ARCH_LIB_OBJS)
+$(DAEMON): udevd.h udevd.o udevd.o udev_config.o logging.o $(SYSFS)
+	$(LD) $(LDFLAGS) -o $@ $(CRT0) udevd.o udev_config.o logging.o $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
 	$(STRIPCMD) $@
 
-$(SENDER): udevd.h udevsend.o udevd.o logging.o
-	$(LD) $(LDFLAGS) -o $@ $(CRT0) udevsend.o logging.o $(LIB_OBJS) $(ARCH_LIB_OBJS)
+$(SENDER): udevd.h udevsend.o udevd.o udev_config.o logging.o $(SYSFS)
+	$(LD) $(LDFLAGS) -o $@ $(CRT0) udevsend.o udev_config.o logging.o $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
 	$(STRIPCMD) $@
 
 clean:
--- udev-015/etc/udev/udev.conf.in	2004-01-29 19:59:08.296568248 +0200
+++ udev-015.log_option/etc/udev/udev.conf.in	2004-01-29 20:15:01.824609952 +0200
@@ -29,3 +29,6 @@
 #                 explicit match in the permissions file
 default_group="root"
 
+# udev_log - set to "yes" if you want logging, else "no"
+udev_log="yes"
+
--- udev-015/udev_config.c	2004-01-29 19:20:34.634298376 +0200
+++ udev-015.log_option/udev_config.c	2004-01-29 20:22:49.771471216 +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)
--- udev-015/logging.c	2004-01-29 19:20:40.673380296 +0200
+++ udev-015.log_option/logging.c	2004-01-29 20:02:41.316184344 +0200
@@ -26,6 +26,7 @@
 #include <unistd.h>
 #include <syslog.h>
 
+#include "udev.h"
 #include "logging.h"
 
 
@@ -47,6 +48,9 @@ int log_message(int level, const char *f
 {
 	va_list	args;
 
+	if (0 != strncmp(udev_log_str, "yes", BOOL_SIZE))
+		return 0;
+
 	if (!logging_init)
 		init_logging();
 	va_start(args, format);
--- udev-015/udev.h	2004-01-29 20:00:40.473555216 +0200
+++ udev-015.log_option/udev.h	2004-01-29 20:03:16.094897176 +0200
@@ -32,6 +32,7 @@
 #define OWNER_SIZE	30
 #define GROUP_SIZE	30
 #define MODE_SIZE	8
+#define BOOL_SIZE	5
 
 struct udevice {
 	char name[NAME_SIZE];
@@ -72,5 +73,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

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

  parent reply	other threads:[~2004-01-29 18:30 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-26 21:50 [ANNOUNCE] udev 015 release Greg KH
2004-01-26 22:15 ` Tomasz Torcz
2004-01-27  5:52 ` Chris Friesen
2004-01-27 22:22   ` Greg KH
2004-01-29  4:52 ` Martin Schlemmer
2004-01-29 21:54   ` Greg KH
2004-01-29 16:52 ` Martin Schlemmer
2004-01-29 21:55   ` Greg KH
2004-01-31  3:17     ` Kay Sievers
2004-01-31 17:54       ` Martin Schlemmer
2004-01-31 18:15         ` Kay Sievers
2004-01-31 18:27           ` Martin Schlemmer
2004-01-31 18:39             ` Kay Sievers
2004-01-31 18:47               ` Martin Schlemmer
2004-01-29 18:30 ` Martin Schlemmer [this message]
2004-01-30  4:41   ` Martin Schlemmer
2004-02-02 23:32   ` Greg KH
2004-02-03  4:12     ` Martin Schlemmer
2004-01-30 16:45 ` Prakash K. Cheemplavam
2004-01-30 17:23   ` Greg KH
2004-01-30 17:44     ` Prakash K. Cheemplavam
2004-01-30 17:49       ` Greg KH
2004-01-30 18:17         ` Prakash K. Cheemplavam
2004-02-01 15:24     ` Martin Schlemmer
2004-02-02  8:46       ` Prakash K. Cheemplavam
2004-01-30 17:33   ` Martin Schlemmer
2004-01-30 18:03   ` Andre Noll
2004-01-30 23:06     ` Tom Rini
2004-02-02 21:43       ` Greg KH
2004-02-05  0:31         ` [2.6 patch] remove USB_SCANNER Adrian Bunk
2004-02-05  1:14           ` Greg KH
2004-02-05 17:20             ` Azog
2004-02-05 17:30               ` Greg KH
2004-02-05 17:50                 ` Stian Jordet
2004-02-05 17:57                   ` Greg KH
2004-02-05 20:24                 ` Leopold Gouverneur
2004-02-05 21:15                   ` Stian Jordet
2004-02-05 21:36                     ` Leopold Gouverneur
2004-02-06  1:15               ` Gene Heskett
2004-02-06 20:59                 ` Bill Davidsen
2004-02-06 21:04                   ` Greg KH
2004-02-01 22:52 ` hal daemon and ide-floppy J.A. Magallon
2004-02-02  3:16   ` Greg KH
2004-02-02 22:32 ` udev depends on /usr J.A. Magallon
2004-02-02 22:44   ` Greg KH
2004-02-02 23:01     ` J.A. Magallon
2004-02-03  4:10     ` Martin Schlemmer
2004-02-02 23:08 ` [ANNOUNCE] udev 015 release Prakash K. Cheemplavam
2004-02-02 23:11   ` 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=1075401020.7680.25.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