flasher: Partition blacklisting
The Ouya has no hardware mechanism to enter recovery/fastboot. No power+volume combination. There is only a power button. It always boots the boot partition. So it is easy to brick the device. Flash a broken boot.img to the boot partition. It will never boot anything else ever again.
Ouya owners have been using a boot menu called SafeBoot. SafeBoot is installed on the boot partition and that partition should never be touched again. SafeBoot will load an actual ROMs boot.img
from /system/boot.img
or /sdcard/altboot.img
.
pmbootstrap fastboot flash method defaults to flashing the boot partition or a user specified one. This makes sense for most all devices. I think we would really really want to prevent the users from flashing the boot partition on the Ouya. Especially since pmbootstrap provides generic flasher
commands. Users may not be aware that they are running fastboot flash
behind the scenes.
This patch allows deviceinfo to specify a blacklist of partitions that should never be used by flasher.
The deviceinfo would specify the blacklist:
deviceinfo_partition_blacklist="boot recovery"
The blacklisted partitions can't be used:
$ pmbootstrap flasher flash_kernel
[16:19:06] (rootfs_ouya-ouya) mkinitfs ouya-ouya
[16:19:13] (native) flash kernel ouya-ouya
[16:19:13] (native) install
[16:19:14] ERROR: boot partition(s) are blacklisted from being flashed! See the device wiki page for more information.
[16:19:14] See also: <https://postmarketos.org/troubleshooting>
Run 'pmbootstrap log' for details.
$ pmbootstrap flasher flash_rootfs --partition boot
[16:19:50] (native) flash rootfs image
[16:19:51] (native) install
[16:19:51] ERROR: boot partition(s) are blacklisted from being flashed! See the device wiki page for more information.
[16:19:51] See also: <https://postmarketos.org/troubleshooting>
Run 'pmbootstrap log' for details.
``