Comment 38 for bug 942106

The patch of does not work in following case:
- Ubuntu 12.04
- partitionable RAID-1 on two complete disks sda and sdb, giving array md0. Root partition is md0p1, swap partition is md0p2.
- One disk physically removed before boot.
- boot degraded arrays is requested

The system reports Mount failed, /dev/disk/my-uuid/<uniqueid> busy.
This /dev/disk/my-uuid/<uniqueid> points to /dev/sda1.

add a second wait_for_udev at the end of the local-premount/mdadm script.
This results in the script:
. /scripts/mdadm-functions
. /scripts/functions

degraded_arrays || exit 0
mountroot_fail || panic "Dropping to a shell."

Hypothetical explanation:
mountroot_fail finds a degraded RAID-1 array and starts it with one disk, creating device /dev/md0. The function ends.
Next, the 'local' script tries to mount the root partition, but udev did not yet have time to detect the partitions and create the corresponding devices md0p1 and md0p1, and change the links in /dev/disk/by-uuid to these detected partitions.
The links in /dev/disk/by-uuid still point to /dev/sda[12], which are locked by mdadm for md0.

The added wait_for_udev lets udev find the partitions md0p1 and md0p2 and change the links in /dev/disk/by-uuid before
trying to mount the root partition.