X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=extras%2Fpath_id;h=4ac718717a1b41d6afa72eb1ec48db7097b6b8c0;hb=287814b23cd564043391ce449f27e6ccd9d244e4;hp=8391f2e58619bbe11729ab192b5db6228cbda8ca;hpb=c5e6eaa002d457af9b5530a29edd514d5826f094;p=elogind.git diff --git a/extras/path_id b/extras/path_id index 8391f2e58..4ac718717 100755 --- a/extras/path_id +++ b/extras/path_id @@ -1,19 +1,22 @@ #!/bin/sh -#set -x -# this script should provide the shortest possible unique hardware path -# to a block device +# provide the shortest possible unique hardware path to a block device +# for the udev persistent disk device naming scheme # +# Copyright (C) 2005 SUSE Linux Products GmbH +# Author: +# Hannes Reinecke +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation version 2 of the License. +# +# to be called from a udev rule to return the name for a symlink +# DEVPATH=/block/sda/sda3 path_id +# path_id -# Horrible script. Handle with extreme care. - -# to be called from udev -# DEVPATH=/block/sda/sda3 $0 (or similar) -# $0 /block/sda -# $0 /sys/block/sda - -# example for all: -# for i in `find /sys/block -name dev` ;do DEVPATH="`echo $i | sed -e 's@^/sys\|/dev@@g'`" $0 ; done +# example for all block devices on a system: +# for i in `find /sys/block -name dev` ;do DEVPATH="`echo $i | sed -e 's@^/sys\|/dev@@g'`" path_id ; done # examples: # SCSI cdrom @@ -55,9 +58,7 @@ # then firewire sbp2 # then the rest -PATH=/lib/klibc/bin #/usr:/usr/sbin:/usr/bin:/sbin:/bin SYSFS=/sys -export PATH RESULT=1 CDROM= TYPE=