Remodeling to a new model

pedronis
upcoming

#1

As we planned in Opt-in accepting/distribution of 'generic'-signed serials registration should always send both the model assertion of the device and a serial request assertion.

A remodeling operation can be used to move a device – with a model and registered for it – to a new model.

Before the device can acquire a new store session to access the potentially new brand store as the new model, it needs to register itself as the new model.

For a first iteration of this we will assume that the new model registration is served by the same device service (aka serial vault) as the current model.

The device, early as part of the whole remodeling, will proceed with a new registration by sending a serial-request with extra fields:

  • original-brand-id
  • original-model
  • original-serial

It will also send the new model assertion as well as the current serial assertion.

For this it will use the same configuration as if for the original serial request, kept as gadget configuration, at this point it doesn’t have yet access to the new gadget.

Based on its own configuration and the information sent by the remodeling device, after cross checking it, the device service will determine whether to allow the remodel and issue back a serial for the new model.


#2

Now on a device that went through a remodeling (or multiple) to new brand/model there will be multiple model and serial assertions in its system assertion database. This means that snap known model|serial alone cannot answer what is the current model/serial of the device.

We will introduce dedicated commands to find the current model/serial of a device:

snap model [--serial]  [--verbose|--assertion]

The basic commands will display what are the primary keys of the underlying assertions in the usual YAML-like format. With --verbose all information (except assertion details) will be printed. With --assertion the commands will output the underlying assertion verbatim.

The snapd API behind these will work similarly to /v2/assertions/{assertType}][?json=] but returning only the current assertion and living at /v2/model and /v2/model/serial respectively.