ddf tests: fix get_rootdev
Getting the major number from the hex device number should take all-but-the-last-two digits, rather than just the first two digits. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
f33a71f107
commit
be4a3188f6
|
@ -4,7 +4,7 @@ sha1_sum() {
|
|||
|
||||
get_rootdev() {
|
||||
local dev=$(stat -c %D /)
|
||||
local maj=$(expr $dev : '\(..\)')
|
||||
local maj=$(expr $dev : '\(..*\)..')
|
||||
local min=${dev#$maj}
|
||||
local bd=/dev/$(basename $(readlink /sys/dev/block/$((0x$maj)):$((0x$min))))
|
||||
[ -b $bd ] || exit 1
|
||||
|
|
Loading…
Reference in New Issue