#!/bin/sh
# try to set internal write-intent bitmaps at least on arrays
# which managed to sync up during installation (probably / only)
# see also https://bugzilla.altlinux.org/show_bug.cgi?id=14877

grep ^md /proc/mdstat || exit 0

. install2-init-functions

for array in /dev/md[0-9]*; do
	# we don't even want to check /sys/block/mdX/md/array_state
	# since that can be clean/active/active-idle
	mdadm -G "$array" -b internal ||:
done
