From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Fri, 09 Apr 2004 20:52:24 +0000 Subject: Re: Test script for udevd binary, Request for Comments! Message-Id: <20040409205224.GA1652@vrfy.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="BXVAT5kNtrzKuDFl" List-Id: References: <3ACA40606221794F80A5670F0AF15F84037B9188@PDSMSX403.ccr.corp.intel.com> In-Reply-To: <3ACA40606221794F80A5670F0AF15F84037B9188@PDSMSX403.ccr.corp.intel.com> To: linux-hotplug@vger.kernel.org --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 09, 2004 at 10:45:40AM +0000, Nick Yin wrote: > Kay, > > Thank you very much for giving me so much suggestion. I will modify this > test script following your suggestion. :-) Nick, here is the needed change for udevd. You can start udevd in your test script with a specified UDEV_BIN in the environment. If we get a nice udevd test script, we can merge the change in the main tree along with your script :) good luck, Kay --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="01-udev_bin-override.patch" ===== udevd.c 1.30 vs edited ===== --- 1.30/udevd.c Fri Apr 2 22:48:21 2004 +++ edited/udevd.c Fri Apr 9 22:12:22 2004 @@ -60,6 +60,7 @@ static void msg_queue_manager(void); static void user_sighandler(void); static void reap_kids(void); +char *udev_bin; #ifdef LOG unsigned char logname[LOGNAME_SIZE]; @@ -146,7 +147,7 @@ switch (pid) { case 0: /* child */ - execle(UDEV_BIN, "udev", msg->subsystem, NULL, env); + execle(udev_bin, "udev", msg->subsystem, NULL, env); dbg("exec of child failed"); exit(1); break; @@ -399,6 +400,7 @@ const int on = 1; struct sigaction act; fd_set readfds; + char *s; init_logging("udevd"); dbg("version %s", UDEV_VERSION); @@ -457,6 +459,15 @@ /* enable receiving of the sender credentials */ setsockopt(ssock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); + + /* possible override of udev binary, used for testing */ + s = getenv("UDEV_BIN"); + if (s != NULL) { + udev_bin = s; + dbg("udev binary is set to '%s'", udev_bin); + } else { + udev_bin = UDEV_BIN; + } FD_ZERO(&readfds); FD_SET(ssock, &readfds); --BXVAT5kNtrzKuDFl-- ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel