On Thu, May 24, 2001 at 12:22:03PM -0700, Tom Rini wrote: > On Wed, May 23, 2001 at 11:18:58PM -0800, Ethan Benson wrote: > > On Wed, May 23, 2001 at 06:12:46PM -0700, Tom Rini wrote: > > > > > > Well, the problem is that my fstab has /dev/hda10, but df shows the > > > devfs name. I've (almost) got something done which will turn > > > /dev/ide/host0/bus0/target0/lun0/partX into /dev/hdaX and so on (at least > > > as much as we have OF aliases for). > > > > i am not opposed to ofpath supporting devfs, there are some criteria > > that MUST be met for me to accept a patch: > > Okay, I think I managed to meet all of these. Doesn't need anything > not already in use, should be nice and POSIX compliant, and makes devfs > look like 'standard', not the other way around. > > I'm not quite happy about how the translation for SCSI went, but that wasn't > something I could fix (since unlike IDE, /dev/sdb could be anywhere.)
it appears that it requires devfsd to be running, i don't really care
but some people might like it if you could convert the name without
it...
i have made a couple changes to your patch, in fixdevfs() i changed
all instances of $KERNDEV to $1 so that i can simply call it with an
argument. i also redirect stderr to /dev/null for all the ls -l
variables in the scsi part, this way if devfsd is not there i won't
spew a dozen `No such file or directory' error messages. i also added
a falloff else to that section informing the user that convertion
failed.
i also moved the fixdevfs() function to ofpath and have it check and
convert the name its given. yabootconfig i have changed so it doesn't
need fixdevfs, only ckdevfs.
i have not tested the devfs changes since i don't run devfs (or even
2.4 for that matter). i have uploaded new versions of both ofpath and
yabootconfig, please test them on both devfs and *especially* devfs
systems using both normal and devfs names. you must run the new
ofpath with the new yabootconfig so you may need to move
/usr/sbin/ofpath out of the way temporarily while you test.
(yabootconfig resets PATH).
> --- yabootconfig.orig Thu May 24 11:33:58 2001
> +++ yabootconfig Thu May 24 12:21:37 2001
> @@ -104,13 +104,13 @@
> esac
> +fixdevfs()
> + scsi)
> + BASEDEV=${KERNDEV#/dev/}
> + SDA=`ls -l /dev/sda$PARTNUM`
> + SDA=${SDA#l*> }
> + SDB=`ls -l /dev/sdb$PARTNUM`
> + SDB=${SDB#l*> }
> + SDC=`ls -l /dev/sdc$PARTNUM`
> + SDC=${SDC#l*> }
> + SDD=`ls -l /dev/sdd$PARTNUM`
> + SDD=${SDD#l*> }
> + SDE=`ls -l /dev/sde$PARTNUM`
> + SDE=${SDE#l*> }
> + SDF=`ls -l /dev/sdf$PARTNUM`
> + SDF=${SDF#l*> }
> + SDG=`ls -l /dev/sdg$PARTNUM`
> + SDG=${SDG#l*> }
> + SDH=`ls -l /dev/sdh$PARTNUM`
all of these are now SDx=`ls -l /dev/sdh$PARTNUM 2>/dev/null`
> + SDH=${SDH#l*> }
> + if [ "$BASEDEV" == "$SDA" ]; then
> + DEV=sda${PARTNUM}
> + elif [ "$BASEDEV" == "$SDB" ]; then
> + DEV=sdb${PARTNUM}
> + elif [ "$BASEDEV" == "$SDC" ]; then
> + DEV=sdc${PARTNUM}
> + elif [ "$BASEDEV" == "$SDC" ]; then
> + DEV=sdd${PARTNUM}
> + elif [ "$BASEDEV" == "$SDE" ]; then
> + DEV=sde${PARTNUM}
> + elif [ "$BASEDEV" == "$SDF" ]; then
> + DEV=sdf${PARTNUM}
> + elif [ "$BASEDEV" == "$SDG" ]; then
> + DEV=sdg${PARTNUM}
> + elif [ "$BASEDEV" == "$SDH" ]; then
> + DEV=sdh${PARTNUM}
add: else
echo "$PRG: conversion failed..."
return 1
> + KERNDEV=/dev/$DEV
changed this to: echo "/dev/$DEV"
--
Ethan Benson
http://www.alaska.net/~erbenson/
pgpXtaks5rur8.pgp
Description: PGP signature

