summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-11-19 16:40:09 +1100
committerNeilBrown <neilb@suse.de>2013-11-19 16:40:09 +1100
commitbe4a3188f6f21d8aba1704e18fa15d5ea9308c15 (patch)
tree364e7197a7e92d487b01b1f051c2e5869fbba4df /tests
parentf33a71f107a5ad35345215ee8ebf9920a00099b0 (diff)
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/env-ddf-template2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/env-ddf-template b/tests/env-ddf-template
index c0a4b713..90d7272f 100644
--- a/tests/env-ddf-template
+++ b/tests/env-ddf-template
@@ -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