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:
NeilBrown 2013-11-19 16:40:09 +11:00
parent f33a71f107
commit be4a3188f6
1 changed files with 1 additions and 1 deletions

View File

@ -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