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; }
17 t_rd_size=$((t_rd_size & ~(1024 - 1)))
19 if [ $t_level -eq 1 ]; then
27 t_num_data_disks=$t_num_disks
33 t_num_data_disks=$((t_num_disks-1))
36 t_num_data_disks=$((t_num_disks/2))
40 t_size=$((t_rd_size*t_num_data_disks))
44 eval `stat -L -c "let major=0x%t; let minor=0x%T;" $t_member`
45 sysfs=/sys/dev/block/${major}:${minor}
46 if [ ! -f ${sysfs}/md/array_state ]; then
47 echo "**Fatal**: Array member $t_member not found" >&2; cat /proc/mdstat >&2; exit 1
49 _chunk=`cat ${sysfs}/md/chunk_size`
50 if [ $t_chunk -ne $((_chunk/1024)) ]; then
51 echo "**Error**: Chunk size mismatch - expected $t_chunk, actual $(($_chunk/1024))" >&2
54 for i in `seq 0 $((t_num_disks - 1))`; do
55 _offset=`cat ${sysfs}/md/rd${i}/offset`
56 if [ $t_offset -ne $((_offset / 2)) ]; then
57 echo "**Error**: Offset mismatch - expected $t_offset, actual $_offset" >&2
60 _rd_size=`cat ${sysfs}/md/rd${i}/size`
61 if [ $t_rd_size -ne $_rd_size ]; then
62 echo "**Error**: Component size mismatch - expected $t_rd_size, actual $_rd_size" >&2
66 _size=`cat ${sysfs}/md/array_size`
67 if [ $t_size -ne $_size ]; then
68 echo "**Error**: Array size mismatch - expected $t_size, actual $_size" >&2
71 if [ $err -gt 0 ]; then
72 echo "$t_member failed check" >&2
74 mdadm -E /dev/loop0 >&2
79 echo >&2 "**Error** unknown check $1"; exit 1;
83 export IMSM_NO_PLATFORM=1
84 export IMSM_DEVNAME_AS_SERIAL=1
85 export IMSM_TEST_OROM=1
86 container=/dev/md/container