diff options
author | NeilBrown <neilb@suse.de> | 2013-11-19 06:40:09 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-11-19 06:40:09 +0100 |
commit | be4a3188f6f21d8aba1704e18fa15d5ea9308c15 (patch) | |
tree | 364e7197a7e92d487b01b1f051c2e5869fbba4df /tests/env-ddf-template | |
parent | Add support for --add-spare (diff) | |
download | mdadm-be4a3188f6f21d8aba1704e18fa15d5ea9308c15.tar.xz mdadm-be4a3188f6f21d8aba1704e18fa15d5ea9308c15.zip |
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/env-ddf-template')
-rw-r--r-- | tests/env-ddf-template | 2 |
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 |