linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [albanbrowaeys@oreka.com: [PATCH] udev : floppy support]
@ 2004-02-13 10:57 Marco d'Itri
  0 siblings, 0 replies; only message in thread
From: Marco d'Itri @ 2004-02-13 10:57 UTC (permalink / raw)
  To: linux-hotplug

ide-devfs.sh improvements from a user.

----- Forwarded message from Alban Browaeys <albanbrowaeys@oreka.com> -----

Subject: [PATCH] udev : floppy support
From: Alban Browaeys <albanbrowaeys@oreka.com>
Reply-To: albanbrowaeys@oreka.com
To: Marco d'Itri <md@linux.it>

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 <albanbrowaeys@oreka.com> -----

Subject: [PATCH] udev : floppy support - previous missed partition support
From: Alban Browaeys <albanbrowaeys@oreka.com>
Reply-To: albanbrowaeys@oreka.com
To: Marco d'Itri <md@linux.it>

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_id\x1356&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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-13 10:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-13 10:57 [albanbrowaeys@oreka.com: [PATCH] udev : floppy support] Marco d'Itri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).