From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Marco d'Itri" Date: Fri, 13 Feb 2004 10:57:03 +0000 Subject: [albanbrowaeys@oreka.com: [PATCH] udev : floppy support] Message-Id: <20040213105703.GA4394@wonderland.linux.it> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org ide-devfs.sh improvements from a user. ----- Forwarded message from Alban Browaeys ----- Subject: [PATCH] udev : floppy support From: Alban Browaeys Reply-To: albanbrowaeys@oreka.com To: Marco d'Itri Your packages save me time which gave me to this small patch to /etc/udev/ide-devfs.sh. This detect ide floppies (tested with zip only though should work flawlessy) and add them in /udev/floppies/floppy[#] (taken from my devfs days for due credits) Two things made me fuzzy about this script: - it use /proc/ide to detect device type ... isn t it obsoleted by sysfs ? (as a device information repository) - the .sh are really bad ! and useless . Man should remplace the bash script by a perl, ruby,who nows one ... why shoudl he rewrite all his configs because of this crappy .sh . You get the point, please join the "kill their wincrap extension party at sight" , free menbership till Monday. Cheers Alban --- ide-devfs.sh.old 2004-02-11 06:16:38.000000000 +0100 +++ ide-devfs.sh 2004-02-11 06:16:19.000000000 +0100 @@ -41,6 +41,8 @@ echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom` elif [ "${MEDIA}" = "disk" ]; then echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`get_dev_number $1 disk`/disc + elif [ "${MEDIA}" = "floppy" ]; then + echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/floppy`get_dev_number $1 floppy`/disc fi else echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/part$3 discs/disc`get_dev_number $1 disk`/part$3 ----- End forwarded message ----- ----- Forwarded message from Alban Browaeys ----- Subject: [PATCH] udev : floppy support - previous missed partition support From: Alban Browaeys Reply-To: albanbrowaeys@oreka.com To: Marco d'Itri Previous made only the drive device (disc) , this one add partitions (part1,part2,...) Alban Browaeys albanbrowaeys@oreka.com --- ide-devfs.sh.old 2004-02-11 06:44:29.000000000 +0100 +++ ide-devfs.sh 2004-02-11 06:42:57.000000000 +0100 @@ -41,7 +41,14 @@ echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom` elif [ "${MEDIA}" = "disk" ]; then echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`get_dev_number $1 disk`/disc + elif [ "${MEDIA}" = "floppy" ]; then + echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/floppy`get_dev_number $1 floppy`/disc fi else - echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/part$3 discs/disc`get_dev_number $1 disk`/part$3 + MEDIA=`cat /proc/ide/${1%%[0-9]*}/media` + if [ "${MEDIA}" = "disk" ]; then + echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/part$3 discs/disc`get_dev_number $1 disk`/part$3 + elif [ "${MEDIA}" = "floppy" ]; then + echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/part$3 floppies/floppy`get_dev_number $1 floppy`/part$3 + fi fi ----- End forwarded message ----- -- ciao, | Marco | [4587 in/fZ98CPefKk] ------------------------------------------------------- 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_id56&alloc_id438&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