Backport "Support flashing Ubuntu to a partition"

Commit: 51f7b4e556e14d0a9cfe5d42c63b6392ae9698c1
Change-Id: Ib1b47a0bf311b555ea46cb1a0298cebd98f98f1d
Signed-off-by: Jani Monoses <jani.monoses@canonical.com>
Backport "Allowing a password to be set during recovery."

This is required for ci to continue working. There's a minor precaution
take with regards to data security of this requiring a factory reset
(format data).

Commit: 518dd4d01b35998dd921a1562b253963bbd860bc
Change-Id: I3e27301b77e4536a7b6a59be49d0ca58bce765f6
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>