A device without UBI, such as an x86 VM or a device on eMMC, can keep its
provisioning data on a block partition named `provisioning`. The data
uses the same header as the UBI volume.
open() and create() prefer the UBI volume and then look for the partition
through the PARTNAME of each block device in sysfs. A commit checks the
flush, because close() reports no error. A partition cannot be removed
from here, so destroy erases the header and the data.
The provision command now exits with an error when a commit or a
destroy fails, for both backends.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
The message told the user to run "provision enable", but no such command
exists. The command that makes the partition is "provision create".
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This is useful for keeping specific data on a device across factory reset.
It uses a separate partition (only UBI supported at the moment) to store
the data. The primary use case is storing sensitive data like cryptographic
keys for maintaining a device as part of a network.
Signed-off-by: Felix Fietkau <nbd@nbd.name>