5 grep -s "blocks super external:imsm" /proc/mdstat > /dev/null || {
6 echo >&2 "**Fatal** Correctly formed container not found"; cat /proc/mdstat; exit 1; }
19 eval `stat -L -c "let major=0x%t; let minor=0x%T;" $t_member`
20 sysfs=/sys/dev/block/${major}:${minor}
21 if [ ! -f ${sysfs}/md/array_state ]; then
22 echo "**Fatal**: Array member $t_member not found" >&2; cat /proc/mdstat >&2; exit 1
24 _chunk=`cat ${sysfs}/md/chunk_size`
25 if [ $t_chunk -ne $((_chunk/1024)) ]; then
26 echo "**Error**: Chunk size mismatch - expected $t_chunk, actual $_chunk" >&2
29 for i in `seq 0 $((t_num_disks - 1))`; do
30 _offset=`cat ${sysfs}/md/rd${i}/offset`
31 if [ $t_offset -ne $((_offset / 2)) ]; then
32 echo "**Error**: Offset mismatch - expected $t_offset, actual $_offset" >&2
35 _rd_size=`cat ${sysfs}/md/rd${i}/size`
36 if [ $t_rd_size -ne $_rd_size ]; then
37 echo "**Error**: Component size mismatch - expected $t_rd_size, actual $_rd_size" >&2
41 _size=`cat ${sysfs}/md/array_size`
42 if [ $t_size -ne $_size ]; then
43 echo "**Error**: Array size mismatch - expected $t_size, actual $_size" >&2
46 if [ $err -gt 0 ]; then
47 echo "$t_member failed check" >&2
49 mdadm -E /dev/loop0 >&2
54 echo >&2 "**Error** unknown check $1"; exit 1;
58 export IMSM_NO_PLATFORM=1
59 export IMSM_DEVNAME_AS_SERIAL=1
60 export IMSM_TEST_OROM=1
61 export MDADM_EXPERIMENTAL=1
62 container=/dev/md/container