Add rules to optionally build badblocks for recovery.

Change-Id: I08cc5d4964b672b2a5e5290f126508d8df59508e