sometimes these can get left around, and udev can be looking
at them at awkward times so they don't disappear.
So be forceful.
Signed-off-by: NeilBrown <neilb@suse.de>
trap cleanup 0 1 3 15
trap ctrl_c 2
+ # make sure there are no loop devices remaining.
+ # udev started things can sometimes prevent them being stopped
+ # immediately
+ while grep loop /proc/partitions > /dev/null 2>&1
+ do
+ losetup -d /dev/loop[0-9]* 2> /dev/null
+ sleep 1
+ done
devlist=
for d in 0 1 2 3 4 5 6 7 8 9 10 11 12 13
do