chiark / gitweb /
[PATCH] get_dev_number() in extras/ide-devfs.sh
authorelkropac@students.zcu.cz <elkropac@students.zcu.cz>
Tue, 3 Feb 2004 08:20:31 +0000 (00:20 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:32:24 +0000 (21:32 -0700)
this patch corrects ide devices with number greater than 9 being linked
into wrong discs/discX directories (my hda10 device was in discs/disc1
directory)
it adds % into pattern for $DRIVE, so for example, hda10 is not eaten
to hda1, but to hda, and break in for cycle works for it

extras/ide-devfs.sh

index 8648f6c0c06d7c97678cef10f9bc7993394a693f..1cf6f9c9e463aaf3d43be8f2a177aeb05e1098c1 100644 (file)
@@ -18,7 +18,7 @@ get_dev_number() {
        local x=
        local num=0
        local MEDIA=
-       local DRIVE="${1%[0-9]*}"
+       local DRIVE="${1%%[0-9]*}"
 
        for x in /proc/ide/*/media; do
                if [ -e "${x}" ]; then