Bug 1593 - Implement factory reset
Summary: Implement factory reset
Status: RESOLVED OBSOLETE
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Low enhancement
Target Milestone: Future
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2011-10-04 07:23 UTC by Richard Purdie
Modified: 2019-10-24 15:06 UTC (History)
13 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments
Design (33.31 KB, image/jpeg)
2015-04-16 21:41 UTC, Aníbal Limón
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2011-10-04 07:23:03 UTC
Implement a factory reset image feature. We\'ll use one of the union mount technologies (aufs/overlayfs/union mounts) to create an overlay on the file system as the final piece of rootfs creation. The overlaid file-system will be the target of all writes made to the image after the image is generated. A user-space mechanism to disable the overlay, and therefore reset to the state of the image just after it was created, will also be provided. This feature could be further enhanced by integrating with the package manager, and other user-space switches, to create system restore points which can later be rolled back to.
Comment 1 Aníbal Limón 2015-04-16 19:28:44 UTC
There are another option to don't depend on filesystem but it requires partition support in Yocto that now is done by Openembedded wic tool.

Example of the partition/disk,

- Bootloader
- Linux Recovery OS (Minimal)
- Linux RW 
- Linux RO


The Bootloader need to have a mechanism (store some value on disk?) to detect when a factory reset is needed and if factory reset is needed boot Linux recovery OS if not set boots the Linux RW.

The Linux Recovery OS reads the RO partition and then writes into RW and then reset.

The settings for the factory reset/partition schema needs to be specified at level of configuration.
Comment 2 Aníbal Limón 2015-04-16 21:41:41 UTC
Created attachment 2479 [details]
Design
Comment 3 Chen Qi 2015-04-22 07:45:11 UTC
Below is an article I read some time ago.
http://0pointer.net/blog/projects/stateless.html

I know it's based on systemd, and our project provides both sysvinit and systemd, but I think its approach is somewhat interesting. Note that the whole implementation is on the filesystem level.

Hope it would provide some useful information.

//Chen Qi
Comment 4 Patrick Ohly 2016-11-03 10:22:30 UTC
Support for stateless is tracked in bug #9527.