← Back to team overview

ubuntu-phone team mailing list archive

Re: Files to keep on userdata reset

 

This span out of a thread on our internal OEM threads. On those I was not
in favour of preserving files across this reset process.

When our phones boot for the very first time, they do so with an empty
writeable partition. The intent of this reset procedure is re-run whatever
code runs then to populate the writable data with defaults.

The files which triggered this discussion:

/userdata/.last_update
/userdata/.last_ubuntu-build

Are to my mind a bug, in that they exist on the writable partition. Both
pieces of information must be generated around the same time as the system
upgrader has the read-only partition writeable for updating, so they could
be stored there.

However, reviewing the attached file list, the files:

/userdata/system-data/var/lib/dbus/machine-id
/userdata/system-data/var/lib/whoopsie/whoopsie-id

Probably contain info that should survive a reset. In an ideal world, I
would propose they should be stored in the same data store as the devices
IMEI, MAC address and Serial Number, but we can't be sure to influence that
storage while we co-exist with android products.

As such, I'm in favour the whitelist of files that survive a reset, but we
probably should add explicit testing of from-empty-writable booting, and
reset-booting, since they are now clearly intended to be different.

I think the whitelist is currently the four files above, and we should aim
to reduce it to an empty set over time.

Of course, our so called 'loopmounted' devices (such as mako), which are
born running android, will always have to be different in this function.

J


On 13 July 2015 at 16:55, Simon Busch <simon.busch@xxxxxxxxxxxxx> wrote:

> Hey all,
>
> we recently fixed the device user data reset functionality (see LP
> #1419928) to erase really all files in /userdata which wasn't the case
> before (like we missed hidden files for examples).
>
> With that being fixed we now came to the point that some files shouldn't
> be removed on /userdata reset which are important for the system and as
> they are mounted writeable and are placed by nature in
> /userdata/system-data they get erased on reset as well. Good example for
> this is /userdata/.last_update which is used to display the last time the
> device was updated in the settings application.
>
> To overcome this we're now planing to whitelist certain files which we
> don't drop on device reset. To not miss anything I am opening the
> discussion here to include all important people.
>
> Files we know about which shouldn't be dropped on reset:
>
> /userdata/.last_update
> /userdata/.last_ubuntu-build
>
> I listed all others I found in /userdata/ and /userdata/system-data which
> we need to consider and take a decision for at
> https://docs.google.com/a/canonical.com/spreadsheets/d/1cNAEHh-TdhlSYpVycM3ClN6Tc9-FmtbRHylTk99q8YQ/edit?usp=sharing
>
> Please raise your hand if you feel any of those might be worth to keep.
>
> regards,
> Simon
>
>
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help   : https://help.launchpad.net/ListHelp
>

References