5 # Copyright (C) Intel Corp, 2004
7 # Author: Yin Hu <hu.yin@intel.com>
9 # This is a script for replacing udev binary during udevsend/udevd testing.
10 # It just simply logs the event information sent by udved in order to
11 # test script udevd-test.pl can analyze whether udved execute as we expected.
12 # You should not execute this script directly because it will be invoked by
13 # udevd automatically.
15 # Before you run your test please modify $log_file to designate where the udev
16 # log file should be placed, in fact, the default value is ok.
19 # This program is free software; you can redistribute it and/or modify it
20 # under the terms of the GNU General Public License as published by the
21 # Free Software Foundation version 2 of the License.
23 # This program is distributed in the hope that it will be useful, but
24 # WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 # General Public License for more details.
28 # You should have received a copy of the GNU General Public License along
29 # with this program; if not, write to the Free Software Foundation, Inc.,
30 # 675 Mass Ave, Cambridge, MA 02139, USA.
37 my $log_file = "/tmp/udev_log.txt";
40 my $subsystem = $ARGV[0];
41 my $devpath = $ENV{DEVPATH};
42 my $action = $ENV{ACTION};
46 if (open(LOGF, ">>$log_file")) {
47 print LOGF "$devpath,$action,$subsystem,$time\n";
49 print "File open failed. \n";
56 print "Too less argument count.\n";