From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Marco d'Itri" Date: Sun, 29 Feb 2004 13:49:26 +0000 Subject: patches for udev 019 Message-Id: <20040229134926.GA7406@wonderland.linux.it> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Kj7319i9nmIyA2yE" List-Id: To: linux-hotplug@vger.kernel.org --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline fix_expr: remove usage of expr in ide-devfs.sh, because it may be in /usr/bin and not available at early boot time. man-dashes.diff: escape dashes in man pages, helps with UTF-8 locales (by Philipp Matthias Hahn). no_error_on_enoent: do not exit with an error and delete all files when a device or directory does not exist. udevsend.8 by by Philipp Matthias Hahn. -- ciao, | Marco | [4695 sc.Be13Nezixw] --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=fix_expr diff -ruN udev-018.orig/extras/ide-devfs.sh udev-018/extras/ide-devfs.sh --- udev-018.orig/extras/ide-devfs.sh 2004-02-19 19:38:37.000000000 +0100 +++ udev-018/extras/ide-devfs.sh 2004-02-21 17:57:06.000000000 +0100 @@ -8,7 +8,7 @@ TARGET="${2#[0-9]\.}" if [ -z "${HOST#[13579]}" ]; then - HOST=`expr ${HOST} - 1` + HOST=$((${HOST} - 1)) BUS="1" else BUS="0" @@ -24,7 +24,7 @@ if [ -e "${x}" ]; then MEDIA=`cat ${x}` if [ "${MEDIA}" = "$2" ]; then - num=`expr ${num} + 1` + num=$((${num} + 1)) fi if [ "${x}" = "/proc/ide/${DRIVE}/media" ]; then break @@ -32,7 +32,7 @@ fi done - echo `expr ${num} - 1` + echo $((${num} - 1)) } if [ -z "$3" ]; then --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="man-dashes.diff" --- udev-018/udev.8 2004-02-19 19:38:36.000000000 +0100 +++ udev-018/udev.8 2004-02-20 22:52:47.000000000 +0100 @@ -270,8 +270,8 @@ .B [ ] Matches any single character specified within the brackets. For example, the pattern string "tty[SR]" would match either "ttyS" or "ttyR". Ranges are also -supported within this match with the '-' character. For example, to match on -the range of all digits, the pattern [0-9] would be used. If the first character +supported within this match with the '\-' character. For example, to match on +the range of all digits, the pattern [0\-9] would be used. If the first character following the '[' is a '!' then any character not enclosed is matched. .SH "FILES" .nf @@ -285,7 +285,7 @@ .BR hotplug (8) .PP The -.I http://linux-hotplug.sourceforge.net/ +.I http://linux\-hotplug.sourceforge.net/ web site. .SH AUTHORS .B udev --- udev-018/udevinfo.8 2004-02-19 19:38:37.000000000 +0100 +++ udev-018/udevinfo.8 2004-02-20 22:53:26.000000000 +0100 @@ -3,7 +3,7 @@ udevinfo \- retrieve information from udev .SH SYNOPSIS .B udevinfo -.RI "[-q " query_type " -p " sysfs_path "] [-drVh]" +.RI "[\-q " query_type " \-p " sysfs_path "] [\-drVh]" .SH "DESCRIPTION" .B udevinfo allows users to query the udev database for information on any of the devices @@ -13,40 +13,40 @@ rule files. .SH "OPTIONS" .TP -.B -V +.B \-V Print the version information. .TP -.B -r +.B \-r Print the the .B udev_root directory. When used in conjunction with a query for the node name, the .B udev_root will be prepended. .TP -.BI -q " query_type" +.BI \-q " query_type" Query the database for specified value of a created device node. -.RB Needs " -p " or " -n " specified. +.RB Needs " \-p " or " \-n " specified. .br Valid types are: .BR name ", " symlink ", " mode " ," owner " , " group " or " path. .TP -.BI -p " sysfs_path" +.BI \-p " sysfs_path" Specify the sysfs path of the device to query. .TP -.BI -n " name" +.BI \-n " name" Specify the name of the node for the device to query. .TP -.B -a +.B \-a Print all .BI SYSFS{ filename } attributes along the device chain. Useful for for finding unique attributes to compose a rule. -.RB Needs " -p " specified. +.RB Needs " \-p " specified. .TP -.B -d +.B \-d Dump the whole database. .TP -.B -h +.B \-h Print help text. .SH "FILES" .nf --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=no_error_on_enoent diff -ruNp udev-019.orig/udev-remove.c udev-019/udev-remove.c --- udev-019.orig/udev-remove.c 2004-02-28 02:11:47.000000000 +0100 +++ udev-019/udev-remove.c 2004-02-28 16:09:24.000000000 +0100 @@ -51,6 +51,8 @@ static int delete_path(char *path) /* remove if empty */ retval = rmdir(path); + if (errno == ENOENT) + retval = 0; if (retval) { if (errno == ENOTEMPTY) return 0; @@ -77,6 +79,8 @@ static int delete_node(struct udevice *d info("removing device node '%s'", filename); retval = unlink(filename); + if (errno == ENOENT) + retval = 0; if (retval) { dbg("unlink(%s) failed with error '%s'", filename, strerror(errno)); @@ -108,6 +112,8 @@ static int delete_node(struct udevice *d dbg("unlinking symlink '%s'", filename); retval = unlink(filename); + if (errno == ENOENT) + retval = 0; if (retval) { dbg("unlink(%s) failed with error '%s'", filename, strerror(errno)); --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="udevsend.8" .TH UDEVSEND 8 "February 2004" "" "Linux Administrator's Manual" .SH NAME udevsend \- Linux dynamic device naming daemon .SH SYNOPSIS .BI udevsend " hotplug-subsystem" .SH .B udevsend sends device creation and removal events to the .B udevd daemon. .SH ENVIRONMENT .TP ACTION .B add or .B remove .TP DEVPATH sysfs-path of the device to be added or removed .TP SEQNUM Sequence number of event. .SH "SEE ALSO" .BR udev (8), .BR udevd (8) .PP The .I http://linux-hotplug.sourceforge.net/ web site. .SH AUTHORS .B udev was developed by Greg Kroah-Hartman with much help from Dan Stekloff , Kay Sievers , and many others. --Kj7319i9nmIyA2yE-- ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&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