https://bugzilla.novell.com/show_bug.cgi?id=664825
https://bugzilla.novell.com/show_bug.cgi?id=664825#c1
--- Comment #1 from Greg Freemyer 2011-01-17 20:09:46 UTC ---
Feedback from Mark Lord (upstream maintainer)
===
How does this look to you for a bash rdev equivalent:
## Try and determine the device name associated with the root filesystem.
## This is nearly impossible to do in any perfect fashion.
##
## do_rdev *usually* works, but on some distros it may only find
"/dev/root",
## and "/dev/root" is not usually a real device. We leave it like that for
now,
## because that's the pattern such systems also use in /proc/mounts.
## Later, at time of use, we'll try harder to find the real rootdev.
##
## Redhat/Fedora no longer have an rdev command. Silly them.
## So we now implement it internally, below.
##
STAT=/usr/bin/stat
FIND=/usr/bin/find
function match_rdev() {
rdev=""
rdevno="$1"
while read bdev ; do
if [ "$rdev" = "" -o "$bdev" != "/dev/root" ]; then
devno=$($STAT -c "0x%t%02T" "$bdev")
[ "$devno" = "$rdevno" ] && rdev="$bdev"
fi
done
echo -n "$rdev"
}
rootdev=$($FIND /dev/ -type b 2>/dev/null | match_rdev $($STAT -c "0x%D"
'/'))
[ $verbose -gt 0 ] && echo "rootdev=$rootdev"
That's what I'm intending to replace rdev with in wiper.sh v3.3.
But I don't have any installs here that use "/dev/root" to re-test with.
Gotta hunt around some more, I guess..
===
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.