udev : floppy support]
PATCH 1/1 udev : floppy support]
ide-devfs.sh improvements from a user.
----- Forwarded message from Alban Browaeys <[email protected]> -----
Subject: [PATCH] udev : floppy support
From: Alban Browaeys <[email protected]>
Reply-To: [email protected]
To: Marco d'Itri <[email protected]>
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 renamed from ide-devfs.sh.old +2 -0
@@ -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 <[email protected]> -----
Subject: [PATCH] udev : floppy support - previous missed partition support
From: Alban Browaeys <[email protected]>
Reply-To: [email protected]
To: Marco d'Itri <[email protected]>
Previous made only the drive device (disc) , this one add partitions (part1,part2,...)
Alban Browaeys
[email protected]
ide-devfs.sh renamed from ide-devfs.sh.old +8 -1
@@ -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 -----
Signature · 13 lines
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 [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel