<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yoctoproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Patrick+Ohly</id>
	<title>Yocto Project - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yoctoproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Patrick+Ohly"/>
	<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/Special:Contributions/Patrick_Ohly"/>
	<updated>2026-04-11T13:14:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28561</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28561"/>
		<updated>2017-07-07T13:31:28Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Status and goals for &amp;quot;stateless&amp;quot; in Yocto */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty&lt;br /&gt;
when booting. According to this definition, populating /etc to factory&lt;br /&gt;
defaults during the boot process is allowed. However, also allowing&lt;br /&gt;
persistent modifications of the copied files then leads to problems&lt;br /&gt;
when updating the defaults. See&lt;br /&gt;
http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
So a stricter definition of &amp;quot;stateless&amp;quot; as used by the Clear Linux&lt;br /&gt;
project (called &amp;quot;fully stateless&amp;quot; in this page) is that the system must work also when /etc remains empty at&lt;br /&gt;
runtime, while (optionally) allowing an admin to configure the system&lt;br /&gt;
by creating files there. See https://clearlinux.org/features/stateless&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A fully stateless image, updates can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Ideally, no configuration files are needed by the OS in /etc at all, while using them when they exist. Only the local admin or configuration tools create files there. In such a setup, configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of files are still expected in /etc. They can be placed there from factory defaults via the systemd tmpfiles.d service. After a system update, either a factory reset must be done or these copied files must be overwritten with more recent ones from the updated factory defaults.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless, with user handling fully stateless. In that image, at least the following local configuration changes are meant to work in combination with system update:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless-pr. It does not yet achieve all of the goals, but the general approach is ready for review in https://github.com/intel/intel-iot-refkit/pull/233. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless-pr/meta-refkit-core/classes/stateless.bbclass. It operates almost entirely during rootfs construction, with some patches integrated into various recipes as an interim solution until it gets decided whether those patches can be upstreamed and/or included in OE-core.&lt;br /&gt;
&lt;br /&gt;
The actual configuration is in various stateless*.inc files in https://github.com/pohly/intel-iot-refkit/blob/stateless-pr/meta-refkit-core/conf/distro/include.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28560</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28560"/>
		<updated>2017-07-07T13:30:49Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Status and goals for &amp;quot;stateless&amp;quot; in Yocto */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty&lt;br /&gt;
when booting. According to this definition, populating /etc to factory&lt;br /&gt;
defaults during the boot process is allowed. However, also allowing&lt;br /&gt;
persistent modifications of the copied files then leads to problems&lt;br /&gt;
when updating the defaults. See&lt;br /&gt;
http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
So a stricter definition of &amp;quot;stateless&amp;quot; as used by the Clear Linux&lt;br /&gt;
project (called &amp;quot;fully stateless&amp;quot; in this page) is that the system must work also when /etc remains empty at&lt;br /&gt;
runtime, while (optionally) allowing an admin to configure the system&lt;br /&gt;
by creating files there. See https://clearlinux.org/features/stateless&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A fully stateless image, updates can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Ideally, no configuration files are needed by the OS in /etc at all, while using them when they exist. Only the local admin or configuration tools create files there. In such a setup, configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of files are still expected in /etc. They can be placed there from factory defaults via the systemd tmpfiles.d service. After a system update, either a factory reset must be done or these copied files must be overwritten with more recent ones from the updated factory defaults.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless, with user handling fully stateless. In that image, at least the following local configuration changes are meant to work in combination with system update:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless-pr. It does not yet achieve all of the goals, but the general approach is ready for review in https://github.com/intel/intel-iot-refkit/pull/233. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless-pr/meta-refkit/classes/stateless.bbclass. It operates almost entirely during rootfs construction, with some patches integrated into various recipes as an interim solution until it gets decided whether those patches can be upstreamed and/or included in OE-core.&lt;br /&gt;
&lt;br /&gt;
The actual configuration is in various stateless*.inc files in https://github.com/pohly/intel-iot-refkit/blob/stateless-pr/meta-refkit/conf/distro/include.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28559</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28559"/>
		<updated>2017-07-07T13:24:02Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty&lt;br /&gt;
when booting. According to this definition, populating /etc to factory&lt;br /&gt;
defaults during the boot process is allowed. However, also allowing&lt;br /&gt;
persistent modifications of the copied files then leads to problems&lt;br /&gt;
when updating the defaults. See&lt;br /&gt;
http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
So a stricter definition of &amp;quot;stateless&amp;quot; as used by the Clear Linux&lt;br /&gt;
project (called &amp;quot;fully stateless&amp;quot; in this page) is that the system must work also when /etc remains empty at&lt;br /&gt;
runtime, while (optionally) allowing an admin to configure the system&lt;br /&gt;
by creating files there. See https://clearlinux.org/features/stateless&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A fully stateless image, updates can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Ideally, no configuration files are needed by the OS in /etc at all, while using them when they exist. Only the local admin or configuration tools create files there. In such a setup, configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of files are still expected in /etc. They can be placed there from factory defaults via the systemd tmpfiles.d service. After a system update, either a factory reset must be done or these copied files must be overwritten with more recent ones from the updated factory defaults.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It operates entirely during rootfs construction. STATELESS_MV_ROOTFS is for cases where configuration files were put into /etc in do_install that can also be elsewhere. It also supports moving files into the factory defaults. STATELESS_RM_ROOTFS is for items that can be removed.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. refkit-image-common is built with an empty /etc, and accidentally putting something into /etc triggers a build error.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28558</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28558"/>
		<updated>2017-07-07T13:23:32Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Definition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty&lt;br /&gt;
when booting. According to this definition, populating /etc to factory&lt;br /&gt;
defaults during the boot process is allowed. However, also allowing&lt;br /&gt;
persistent modifications of the copied files then leads to problems&lt;br /&gt;
when updating the defaults. See&lt;br /&gt;
http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
So a stricter definition of &amp;quot;stateless&amp;quot; as used by the Clear Linux&lt;br /&gt;
project (called &amp;quot;fully stateless&amp;quot; in this page) is that the system must work also when /etc remains empty at&lt;br /&gt;
runtime, while (optionally) allowing an admin to configure the system&lt;br /&gt;
by creating files there. See https://clearlinux.org/features/stateless&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Ideally, no configuration files are needed by the OS in /etc at all, while using them when they exist. Only the local admin or configuration tools create files there. In such a setup, configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of files are still expected in /etc. They can be placed there from factory defaults via the systemd tmpfiles.d service. After a system update, either a factory reset must be done or these copied files must be overwritten with more recent ones from the updated factory defaults.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It operates entirely during rootfs construction. STATELESS_MV_ROOTFS is for cases where configuration files were put into /etc in do_install that can also be elsewhere. It also supports moving files into the factory defaults. STATELESS_RM_ROOTFS is for items that can be removed.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. refkit-image-common is built with an empty /etc, and accidentally putting something into /etc triggers a build error.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28557</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=28557"/>
		<updated>2017-07-07T13:22:37Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Definition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty&lt;br /&gt;
when booting. According to this definition, populating /etc to factory&lt;br /&gt;
defaults during the boot process is allowed. However, also allowing&lt;br /&gt;
persistent modifications of the copied files then leads to problems&lt;br /&gt;
when updating the defaults. See&lt;br /&gt;
http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
So a stricter definition of &amp;quot;stateless&amp;quot; as used by the Clear Linux&lt;br /&gt;
project is that the system must work also when /etc remains empty at&lt;br /&gt;
runtime, while (optionally) allowing an admin to configure the system&lt;br /&gt;
by creating files there. See https://clearlinux.org/features/stateless&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Ideally, no configuration files are needed by the OS in /etc at all, while using them when they exist. Only the local admin or configuration tools create files there. In such a setup, configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of files are still expected in /etc. They can be placed there from factory defaults via the systemd tmpfiles.d service. After a system update, either a factory reset must be done or these copied files must be overwritten with more recent ones from the updated factory defaults.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It operates entirely during rootfs construction. STATELESS_MV_ROOTFS is for cases where configuration files were put into /etc in do_install that can also be elsewhere. It also supports moving files into the factory defaults. STATELESS_RM_ROOTFS is for items that can be removed.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. refkit-image-common is built with an empty /etc, and accidentally putting something into /etc triggers a build error.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=26452</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=26452"/>
		<updated>2017-04-28T06:54:54Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
Some talks at Embedded Linux Conference presented an overview of the current mechanisms:&lt;br /&gt;
* How do you update your embedded Linux devices? by Daniel Sangorrin / Keijiro Yano http://events.linuxfoundation.org/sites/events/files/slides/linuxcon-japan-2016-softwre-updates-sangorrin.pdf&lt;br /&gt;
* Comparison of Linux Software Update Technologies by Matt Porter http://events.linuxfoundation.org/sites/events/files/slides/Comparison%20of%20Linux%20Software%20Update%20Technologies_0.pdf. Video at https://youtu.be/pdHV9H9nZks?list=PLbzoR-pLrL6pRFP6SOywVJWdEHlmQE51q. Full paper done for Automotive Grade Linux (AGL) here: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-May/002061.html&lt;br /&gt;
* Software update for IoT: the current state of play by Chris Simmonds http://de.slideshare.net/chrissimmonds/software-update-for-iot-the-current-state-of-play&lt;br /&gt;
* OSS Remote Firmware Updates for IoT-like Projects by Silvano Cirujano Cuesta http://events.linuxfoundation.org/sites/events/files/slides/OSS_Remote_Firmware_Updates_for_IoT-like_Projects.pdf&lt;br /&gt;
* &amp;quot;Surviving in the Wilderness: Integrity Protection and System Update&amp;quot; by Patrick Ohly: [https://openiotelcna2017.sched.com/event/9J5i/surviving-in-the-wilderness-integrity-protection-and-system-update-patrick-ohly-intel-gmbh abstract and slides], [https://www.youtube.com/watch?v=N8V0W0p3YBU video recording of talk]&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dependencies on boot loader, number and kind of partitions, etc. Flexible mechanisms make no or only few assumptions about the system, but typically then require additional work to integrate with a specific setup.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible&lt;br /&gt;
| read/write&lt;br /&gt;
| HTTP(S) server, local media&lt;br /&gt;
| depends on setup&lt;br /&gt;
| relatively stable, under active development&lt;br /&gt;
| [http://git.yoctoproject.org/cgit/cgit.cgi/meta-swupd meta-swupd]&lt;br /&gt;
| moderate, suitable for frequent updates&lt;br /&gt;
| minimal download, needs sufficient free space in rootfs&lt;br /&gt;
| favors fast updates over failure resilience&lt;br /&gt;
| some planning required&lt;br /&gt;
| minimal, reboot optional&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Signed update data, HTTPS transfer protection.&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/sbabic/swupdate sbabic&#039;s swupdate]&lt;br /&gt;
| block-based / file based&lt;br /&gt;
| flexible&lt;br /&gt;
| depends on setup&lt;br /&gt;
| local and remote (plain HTTP(S) or custom server)&lt;br /&gt;
| depends on setup&lt;br /&gt;
| Code relatively stable, 3 months release cycle&lt;br /&gt;
| [https://github.com/sbabic/meta-swupdate meta-swupdate]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| no builtin mechanism, to be added as part of system&lt;br /&gt;
| easy to use (but requires customization!?)&lt;br /&gt;
| reboot required&lt;br /&gt;
| signed and encrypted images, HTTPS&lt;br /&gt;
|-&lt;br /&gt;
! [https://mender.io/ Mender]&lt;br /&gt;
| block-based&lt;br /&gt;
| [https://docs.mender.io/1.0/Devices/Partition-layout flexible (minimum four partitions)], U-Boot as boot loader&lt;br /&gt;
| conceptually read-only&lt;br /&gt;
| remote ([https://docs.mender.io/1.0/Architecture/Overview#modes-of-operation managed mode]) or local ([https://docs.mender.io/1.0/Architecture/Overview#modes-of-operation standalone mode])&lt;br /&gt;
| Complete rootfs, including kernel.&lt;br /&gt;
| relatively stable, fully supported and tested upgrade path&lt;br /&gt;
| [https://github.com/mendersoftware/meta-mender meta-mender]&lt;br /&gt;
| compressed rootfs per build&lt;br /&gt;
| download and write compressed rootfs&lt;br /&gt;
| integrated rollback&lt;br /&gt;
| easy when using meta-mender&lt;br /&gt;
| reboot required&lt;br /&gt;
| HTTPS enforced, [https://tracker.mender.io/projects/MEN/issues/MEN-1020 signing being developed]&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/ostreedev/ostree OSTree]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible, but supports only limited set of bootloaders&lt;br /&gt;
| read/write, OS trees bind mounted read-only, /etc and /var writable&lt;br /&gt;
| local and remote repositories&lt;br /&gt;
| kernel and filesystem&lt;br /&gt;
| relatively stable, significant user base, under active development&lt;br /&gt;
| meta-ostree (WIP), [https://github.com/advancedtelematic/meta-updater meta-updater] (public)&lt;br /&gt;
| generating commits based on new builds, storing them in repository&lt;br /&gt;
| updating local repository, hard links for sharing unchanged content between deployments&lt;br /&gt;
| rollback to a different deployed OS tree&lt;br /&gt;
| some work required&lt;br /&gt;
| reboot required&lt;br /&gt;
| GPG-signed commits&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/rauc/rauc RAUC]&lt;br /&gt;
| block based / file-based (tar)&lt;br /&gt;
| flexible (block-device/MTD)&lt;br /&gt;
| depends on setup (read-only supported)&lt;br /&gt;
| depends on setup&lt;br /&gt;
| depends on setup (any storage device)&lt;br /&gt;
| relatively stable, under active development&lt;br /&gt;
| [https://github.com/rauc/meta-rauc meta-rauc]&lt;br /&gt;
| archives full (compressed) image per build&lt;br /&gt;
| download and write full (compressed) image&lt;br /&gt;
| integrated rollback (requires bootloader support)&lt;br /&gt;
| some customization required&lt;br /&gt;
| reboot required&lt;br /&gt;
| X509-signed update bundles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: swupd updates files in a single partition. Other than that, it makes no assumptions about disk layout, filesystem and boot mechanism.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Files provided by the OS are read-only, everything else is read/write (/etc, /var) and preserved during updates. OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
;Updates from&lt;br /&gt;
: Uses libcurl to fetch update data and thus supports all URL schemes supported by libcurl, in particular http(s) and local files.&lt;br /&gt;
;Updates what&lt;br /&gt;
: swupd itself updates files in the rootfs, other components then need to be updated (boot loader, kernel, firmware, ...) then need be updated via custom plugins.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Used and maintained in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype). Code changes not written for Clear Linux OS tend to get merged only slowly or not at all (examples: [https://github.com/clearlinux/swupd-server/pull/25 assumption about filesystem], [https://github.com/clearlinux/swupd-server/pull/26 error checking], [https://github.com/clearlinux/swupd-client/pull/71 path configuration]).&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Layer available, not part of Yocto releases, experimental. Supports building incremental updates (= only changes since last build are stored for new build) and deltas (= optimized update pack for specific previous builds, typically major milestones).&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). When using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs. Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left. Updating files while system services are running reduces downtime, but is also more risky if system services aren&#039;t prepared for it. Could be extended to do updates without that risk, at the expense of increased downtime.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Upgrade path must be considered as part of release process (deltas, incompatible changes).&lt;br /&gt;
;Downtime&lt;br /&gt;
: Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot depending on what was updated (not automated at the moment in meta-swupd layer).&lt;br /&gt;
;Security&lt;br /&gt;
: Compatible with Linux IMA, Smack, SELinux. Conceptually incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of update data (not integrated into meta-swupd yet).&lt;br /&gt;
&lt;br /&gt;
== babic&#039;s SWUpdate ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: There is no constraint how software is stored. SWUPdate supports raw flash (NOR, NAND), UBI volumes, disk partitions or can update files (provided in a tarball) into an existing filesystem. Each artifact can be stored on a different storage device.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: No constrain where software is stored. During an update, a single partition, multiple partitions or generically multiple different storages can be updated.&lt;br /&gt;
:&lt;br /&gt;
: SWUpdate is often used in one of the following setup:&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : The system reboots in maintenance mode and SWUpdate is started from a Ramdisk. Just one copy of the Software is stored into the system.&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : two copies of the software (rootfs, kernel) are stored into the system and SWUpdate installs the stand-by copy.&lt;br /&gt;
;Updates from&lt;br /&gt;
:&lt;br /&gt;
:* local provisioning : USB, SD, etc.&lt;br /&gt;
:* generic URL : HTTP(S), FTP. It uses the libcurl library and supports what libcurl provides.&lt;br /&gt;
:* Webserver : SWUpdate integrates a Webserver (moongoose)&lt;br /&gt;
:* External Backend connector (suricatta mode) to bind with an external backend server. Currently, the Hawkbit server is supported https://github.com/eclipse/hawkbit. Open to further backends.&lt;br /&gt;
;Updates what&lt;br /&gt;
:&lt;br /&gt;
:* bootloader (risky !)&lt;br /&gt;
:* kernel&lt;br /&gt;
:* interface to bootloader (U-Boot) Allows to change u-boot variables and allow to use plugins to make changes to other bootloaders.&lt;br /&gt;
;* disk partitions&lt;br /&gt;
;* provide interface to update FPGAs, external microcontrollers, etc.&lt;br /&gt;
;* custom handlers: an interface allows to add own installers written in C or in LUA.&lt;br /&gt;
;Resources on client&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : meta-swupdate provides recipe to generate a compressed ramdisk with small footprint. Including support for signed image, the whole rootfs is ~4MB. The minimal requirement for a complete rescue (bootloader, kernel for SWUpdate and ramdisk) is 8MB. This allows to put the rescue in a small storage like a SPI-NOR, while the software is stored on another and bigger device (NAND, eMMC).&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. No additional space is required if the image is directly streamed to the stand-by copy.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: There are no recovery mechanism built in. If the bootloader has the capability to check if a boot failed, it could boot in maintenance mode again.&lt;br /&gt;
; Downtime&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : There is need to reboot in maintenance mode and once the image is installed, needs to reboot again with the new production image. &lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; :  Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime. &lt;br /&gt;
;Security&lt;br /&gt;
:&lt;br /&gt;
:* Connection with HTTPS to the external the server.&lt;br /&gt;
:* Signed images : it is possible to sign the images used for the update in order to check its integrity.&lt;br /&gt;
:* Split in several processes: connection to the internet can run with a different userid / groupid as the installer. The installer runs often with high privileges because it has to write the hardware.&lt;br /&gt;
:* Support for encrypted artifacts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mender ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: No upper limit on partitions, [https://docs.mender.io/1.0/Devices/Partition-layout minimum four]. Dual rootfs partitions with two extra partitions, a boot and a data partition. Depends on U-Boot as boot loader for the automatic rollback.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Stored in one active and one passive partition, read/write while in use, but modifications to it get lost during updates when switching partitions, so persistent data should be stored in the data partition. Kernel is stored on rootfs.&lt;br /&gt;
; Updates from&lt;br /&gt;
: Mender Server over HTTPS ([https://docs.mender.io/1.0/Architecture/Overview#modes-of-operation managed mode])&lt;br /&gt;
: manual provisioning : local file system/URL, e.g. USB, SD, HTTP(S) ([https://docs.mender.io/1.0/Architecture/Overview#modes-of-operation standalone mode])&lt;br /&gt;
;Code stability&lt;br /&gt;
: Stable release. Upgrade path fully supported and tested.&lt;br /&gt;
;Resources on server&lt;br /&gt;
: Needs to store one compressed rootfs image for each update, plus small meta data section.&lt;br /&gt;
;Resources on client&lt;br /&gt;
: Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. Needs no additional space on device beyond the partitions (update is streamed), space for the Mender binary, and a tiny local database.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Automatic rollback if the device either fails to boot, or the Mender daemon cannot connect to the Mender server afterwards.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Relatively easy to [https://docs.mender.io/Artifacts/Building-Mender-Yocto-image build with Yocto]. More complex if [https://mender.io/blog/porting-mender-to-a-non-yocto-build-system not using Yocto].&lt;br /&gt;
;Downtime&lt;br /&gt;
: Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime.&lt;br /&gt;
;Security&lt;br /&gt;
: Secure connection to the server (TLS). Artifact signing is [https://tracker.mender.io/projects/MEN/issues/MEN-1020?filter=allopenissues being implemented].&lt;br /&gt;
&lt;br /&gt;
== OSTree ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
:Only limited set of bootloaders supported (those that support [http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec The Boot Loader Specification] and some exceptions). The root file system has to have the /boot directory managed by OSTree. The actual deployed OS trees have certain conventions and requirements. For example, /etc and /var need to be writable, while /usr is mounted read-only.&lt;br /&gt;
;Rootfs&lt;br /&gt;
:Files provided by OS are expected to be in /usr, which is mounted read-only. /etc and /var are writable.&lt;br /&gt;
;Updates from&lt;br /&gt;
:Local and remote repostories. OSTree works by replicating a repository to the target device and then &amp;quot;checking out&amp;quot; deployment directories from the repository. Local and HTTP methods for replicating the repository are available.&lt;br /&gt;
;Updates what&lt;br /&gt;
:OSTree (atomically) updates root file system trees and the kernel. If anything else needs to be updated, it needs to happen by running custom code on the target device.&lt;br /&gt;
;Code stability&lt;br /&gt;
:OSTree is relatively stable. It&#039;s used by many distributions and projects, such as Fedora Atomic and Flatpak. OSTree is under active development and has an open-source community around it.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
:Meta-ostree layer is work in progress.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
:OSTree generates &amp;quot;commit objects&amp;quot; based on the filesystem changes between builds. These commit objects are stored in a commit chain the same way as git does. The commit objects transmitted over the network as binary diffs when the remote and local repositories are synchronized.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
:Client has the local copy of the repository. The repository contains the objects, which map to the files on the OS trees. The deployments of the OS trees (or &amp;quot;checkouts&amp;quot; in git termininology) are made using hard links to the repository content. This means that the required space is only increased when the data changes: the static data files are shared between deployments.&lt;br /&gt;
:OSTree allows deleting of data. This means that the full operating system history doesn&#039;t need to be stored in the repository. A typical OSTree-based system might have two deployed OS trees: one that is being currently used and one fallback.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
:OSTree controls the booting to the different deployed trees using bootloader entries. If booting a deployed OS tree fails, a different bootloader entry can be chosen for booting into a different OS tree.&lt;br /&gt;
;Complexity&lt;br /&gt;
:Some work is needed to fit the root filesystem into the conventions that OSTree likes. Some documentation of the needed steps [https://ostree.readthedocs.io/en/latest/manual/adapting-existing/ is available here].&lt;br /&gt;
;Downtime&lt;br /&gt;
:Reboot is required after updates. Changing between deployed OS trees is done by selecting a different boot loader entry.&lt;br /&gt;
;Security&lt;br /&gt;
:The commits can be signed with GPG-based signatures. OSTree repositories store file extended attributes, which means that the security mechanisms using extended attributes should be functional with OSTree.&lt;br /&gt;
&lt;br /&gt;
== RAUC ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: RAUC supports filesystems on block devices and MTD (NAND/NOR) as well as raw images (bootloaders, FPGA bitstreams).&lt;br /&gt;
;Disk layout&lt;br /&gt;
: RAUC does not depend on a fixed disk layout but allows to flexibly [https://rauc.readthedocs.io/en/latest/reference.html#sec-ref-slot-config configure] one. It supports A+B scenarios as well as A+recovery or more complex setups. &lt;br /&gt;
;Rootfs&lt;br /&gt;
: There are no limitations on the root file system, it can be read-only or read-write. It has to contain the RAUC system configuration file, a keyring for verification and the small RAUC binary itself.&lt;br /&gt;
;Updates from&lt;br /&gt;
: RAUC is the updating core that is meant to be integrated in a custom environment. Thus it supports installing bundles from local file paths, while another application is responsible fetching the update.&lt;br /&gt;
: External storage (USB, SD): direct access, no copying required&lt;br /&gt;
: Webserver: Application downloads Bundle to local tmpfs / storage.&lt;br /&gt;
: Demo-applications planned.&lt;br /&gt;
;Updates what&lt;br /&gt;
:&lt;br /&gt;
:* everything which is updatable&lt;br /&gt;
:* default handler for common storage types and file systems (ext4, NAND, UBI, raw copy)&lt;br /&gt;
:* allows [https://rauc.readthedocs.io/en/latest/using.html#customizing-the-update custom handler] for each update target (script or application, information passed as environment variables)&lt;br /&gt;
;Resources on client&lt;br /&gt;
: At least one production rootfs and a rescue system. Temporary storage for update Bundle (compressed) if provided by a webserver.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Interface to [https://rauc.readthedocs.io/en/latest/integration.html#interfacing-with-the-bootloader Booloader] (Barebox, U-Boot, GRUB) allows atomic updates (correct fallback handling is up to the bootloader). Interface to mark updates good or bad after certain checks in the newly booted rootfs (must be supported by bootloader).&lt;br /&gt;
;Complexity&lt;br /&gt;
: Integration into the rootfs and generating update Bundles is relatively easy with Yocto ([https://github.com/rauc/meta-rauc meta-rauc]) or [https://www.mail-archive.com/ptxdist@pengutronix.de/msg11471.html PTXdist]. Manual integration described [https://rauc.readthedocs.io/en/latest/integration.html here].&lt;br /&gt;
;Downtime&lt;br /&gt;
: Normally, downloading and installing will be perforemd as background operation. A reboot is needed to make the new system active (might be scheduled).&lt;br /&gt;
;Security&lt;br /&gt;
: Signed images: Signing images is mandatory. X.509 cryptography (CMS) is used to sign the bundle and a full PKI with revocations is supported. An example script allows creating key/cert/keychain for test purposes.&lt;br /&gt;
: Verified boot: When using image updates, compatible with IMA, SELinux, dm-verity, ... (as it does require write access to the filesystems).&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25136</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25136"/>
		<updated>2017-03-10T12:32:31Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Status and goals for &amp;quot;stateless&amp;quot; in Yocto */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty when booting. No state persists across reboots, hence the name. A more relaxed version of this preserves config files in /etc, but still allows them to be removed at any time to do a factory reset.&lt;br /&gt;
&lt;br /&gt;
See http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Ideally, no configuration files are needed by the OS in /etc at all, while using them when they exist. Only the local admin or configuration tools create files there. In such a setup, configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of files are still expected in /etc. They can be placed there from factory defaults via the systemd tmpfiles.d service. After a system update, either a factory reset must be done or these copied files must be overwritten with more recent ones from the updated factory defaults.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It operates entirely during rootfs construction. STATELESS_MV_ROOTFS is for cases where configuration files were put into /etc in do_install that can also be elsewhere. It also supports moving files into the factory defaults. STATELESS_RM_ROOTFS is for items that can be removed.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. refkit-image-common is built with an empty /etc, and accidentally putting something into /etc triggers a build error.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25135</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25135"/>
		<updated>2017-03-10T12:28:09Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty when booting. No state persists across reboots, hence the name. A more relaxed version of this preserves config files in /etc, but still allows them to be removed at any time to do a factory reset.&lt;br /&gt;
&lt;br /&gt;
See http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Ideally, no configuration files are needed by the OS in /etc at all, while using them when they exist. Only the local admin or configuration tools create files there. In such a setup, configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of files are still expected in /etc. They can be placed there from factory defaults via the systemd tmpfiles.d service. After a system update, either a factory reset must be done or these copied files must be overwritten with more recent ones from the updated factory defaults.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It supports STATELESS_RELOCATE_pn-&amp;lt;recipe&amp;gt; = &amp;quot;True&amp;quot; for compiling a recipe such that it uses a read-only sysconfig directory. STATELESS_MV is for cases where a recipe puts files into /etc in do_install that can also be elsewhere. STATELESS_RM is for items that can be removed. The same exists as STATELESS_RM/MV_ROOTFS for items created as part of package installation or rootfs functions.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. It does not yet enforce an empty /etc. Instead one has to run &amp;quot;bitbake refkit-image-common:do_rootfs&amp;quot; and check the content of /etc manually.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* use STATELESS_MV_pn-&amp;lt;recipe&amp;gt; to avoid repackaging other recipes&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_ETC_WHITELIST&lt;br /&gt;
** STATELESS_RM/MV sorted by pn-&amp;lt;reciped&amp;gt; (alphabetically)&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** special python functions&lt;br /&gt;
&lt;br /&gt;
refkit-image-common is stateless once /etc is empty after do_rootfs and the resulting image works without problems. Right now, it still has the following content:&lt;br /&gt;
&lt;br /&gt;
 $ tree tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 ├── asound.conf&lt;br /&gt;
 ├── audisp&lt;br /&gt;
 │   ├── audispd.conf&lt;br /&gt;
 │   └── plugins.d&lt;br /&gt;
 │       ├── af_unix.conf&lt;br /&gt;
 │       └── syslog.conf&lt;br /&gt;
 ├── audit&lt;br /&gt;
 │   ├── auditd.conf&lt;br /&gt;
 │   ├── audit.rules&lt;br /&gt;
 │   └── rules.d&lt;br /&gt;
 │       └── audit.rules&lt;br /&gt;
 ├── bluetooth&lt;br /&gt;
 │   ├── input.conf&lt;br /&gt;
 │   └── network.conf&lt;br /&gt;
 ├── build&lt;br /&gt;
 ├── busybox.links.nosuid&lt;br /&gt;
 ├── busybox.links.suid&lt;br /&gt;
 ├── ca-certificates&lt;br /&gt;
 │   └── update.d&lt;br /&gt;
 ├── ca-certificates.conf&lt;br /&gt;
 ├── dbus-1&lt;br /&gt;
 │   ├── session.conf&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   └── system.d&lt;br /&gt;
 │       ├── bluetooth.conf&lt;br /&gt;
 │       ├── connman.conf&lt;br /&gt;
 │       ├── dbus-wpa_supplicant.conf&lt;br /&gt;
 │       ├── org.freedesktop.hostname1.conf&lt;br /&gt;
 │       ├── org.freedesktop.locale1.conf&lt;br /&gt;
 │       ├── org.freedesktop.login1.conf&lt;br /&gt;
 │       ├── org.freedesktop.machine1.conf&lt;br /&gt;
 │       ├── org.freedesktop.systemd1.conf&lt;br /&gt;
 │       └── org.freedesktop.timedate1.conf&lt;br /&gt;
 ├── default&lt;br /&gt;
 │   ├── auditd&lt;br /&gt;
 │   ├── mountall&lt;br /&gt;
 │   ├── usbd&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   └── volatiles&lt;br /&gt;
 │       ├── 99_dbus&lt;br /&gt;
 │       ├── 99_pam&lt;br /&gt;
 │       ├── 99_sshd&lt;br /&gt;
 │       └── 99_wpa_supplicant&lt;br /&gt;
 ├── depmod.d&lt;br /&gt;
 ├── environment&lt;br /&gt;
 ├── filesystems&lt;br /&gt;
 ├── fstab&lt;br /&gt;
 ├── group&lt;br /&gt;
 ├── gshadow&lt;br /&gt;
 ├── host.conf&lt;br /&gt;
 ├── hostname&lt;br /&gt;
 ├── hosts&lt;br /&gt;
 ├── init.d&lt;br /&gt;
 │   └── smack&lt;br /&gt;
 ├── inputrc&lt;br /&gt;
 ├── issue&lt;br /&gt;
 ├── issue.net&lt;br /&gt;
 ├── ld.so.conf&lt;br /&gt;
 ├── libaudit.conf&lt;br /&gt;
 ├── libnl&lt;br /&gt;
 │   ├── classid&lt;br /&gt;
 │   └── pktloc&lt;br /&gt;
 ├── login.defs&lt;br /&gt;
 ├── machine-id&lt;br /&gt;
 ├── mke2fs.conf&lt;br /&gt;
 ├── modprobe.d&lt;br /&gt;
 ├── modules-load.d&lt;br /&gt;
 │   ├── iwlwifi.conf&lt;br /&gt;
 │   └── uio.conf&lt;br /&gt;
 ├── motd&lt;br /&gt;
 ├── mtab -&amp;gt; /proc/mounts&lt;br /&gt;
 ├── network&lt;br /&gt;
 │   ├── if-down.d&lt;br /&gt;
 │   ├── if-post-down.d&lt;br /&gt;
 │   │   └── wpa-supplicant -&amp;gt; ../if-pre-up.d/wpa-supplicant&lt;br /&gt;
 │   └── if-pre-up.d&lt;br /&gt;
 │       └── wpa-supplicant&lt;br /&gt;
 ├── nsswitch.conf&lt;br /&gt;
 ├── os-release&lt;br /&gt;
 ├── pam.d&lt;br /&gt;
 │   ├── chage&lt;br /&gt;
 │   ├── chfn&lt;br /&gt;
 │   ├── chgpasswd&lt;br /&gt;
 │   ├── chpasswd&lt;br /&gt;
 │   ├── chsh&lt;br /&gt;
 │   ├── common-account&lt;br /&gt;
 │   ├── common-auth&lt;br /&gt;
 │   ├── common-password&lt;br /&gt;
 │   ├── common-session&lt;br /&gt;
 │   ├── common-session-noninteractive&lt;br /&gt;
 │   ├── groupadd&lt;br /&gt;
 │   ├── groupdel&lt;br /&gt;
 │   ├── groupmems&lt;br /&gt;
 │   ├── groupmod&lt;br /&gt;
 │   ├── login&lt;br /&gt;
 │   ├── newusers&lt;br /&gt;
 │   ├── other&lt;br /&gt;
 │   ├── passwd&lt;br /&gt;
 │   ├── runuser&lt;br /&gt;
 │   ├── runuser-l&lt;br /&gt;
 │   ├── sshd&lt;br /&gt;
 │   ├── su&lt;br /&gt;
 │   ├── systemd-user&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   ├── userdel&lt;br /&gt;
 │   └── usermod&lt;br /&gt;
 ├── passwd&lt;br /&gt;
 ├── profile&lt;br /&gt;
 ├── protocols&lt;br /&gt;
 ├── request-key.conf&lt;br /&gt;
 ├── request-key.d&lt;br /&gt;
 ├── rpc&lt;br /&gt;
 ├── securetty&lt;br /&gt;
 ├── security&lt;br /&gt;
 │   ├── access.conf&lt;br /&gt;
 │   ├── group.conf&lt;br /&gt;
 │   ├── limits.conf&lt;br /&gt;
 │   ├── limits.d&lt;br /&gt;
 │   ├── namespace.conf&lt;br /&gt;
 │   ├── namespace.d&lt;br /&gt;
 │   ├── namespace.init&lt;br /&gt;
 │   ├── pam_env.conf&lt;br /&gt;
 │   └── time.conf&lt;br /&gt;
 ├── services&lt;br /&gt;
 ├── shadow&lt;br /&gt;
 ├── shells&lt;br /&gt;
 ├── skel&lt;br /&gt;
 ├── smack&lt;br /&gt;
 │   ├── accesses.d&lt;br /&gt;
 │   └── cipso.d&lt;br /&gt;
 ├── ssh&lt;br /&gt;
 │   ├── moduli&lt;br /&gt;
 │   ├── ssh_config&lt;br /&gt;
 │   ├── sshd_config&lt;br /&gt;
 │   └── sshd_config_readonly&lt;br /&gt;
 ├── ssl&lt;br /&gt;
 │   ├── certs&lt;br /&gt;
 │   │   ├── 02265526.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority_-_G2.crt&lt;br /&gt;
 │   │   ├── 024dc131.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Microsec_e-Szigno_Root_CA.crt&lt;br /&gt;
 │   │   ├── 03179a64.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_EV_Root_CA.crt&lt;br /&gt;
 ...&lt;br /&gt;
 │   │   └── XRamp_Global_CA_Root.pem -&amp;gt; /usr/share/ca-certificates/mozilla/XRamp_Global_CA_Root.crt&lt;br /&gt;
 │   ├── openssl.cnf&lt;br /&gt;
 │   └── private&lt;br /&gt;
 ├── sysctl.d&lt;br /&gt;
 ├── systemd&lt;br /&gt;
 │   ├── journald.conf&lt;br /&gt;
 │   ├── logind.conf&lt;br /&gt;
 │   ├── network&lt;br /&gt;
 │   ├── system&lt;br /&gt;
 │   │   ├── bluetooth.target.wants&lt;br /&gt;
 │   │   │   └── bluetooth.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── ctrl-alt-del.target -&amp;gt; ../../../lib/systemd/system/reboot.target&lt;br /&gt;
 │   │   ├── dbus-org.bluez.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── default.target -&amp;gt; /lib/systemd/system/multi-user.target&lt;br /&gt;
 │   │   ├── getty.target.wants&lt;br /&gt;
 │   │   │   └── getty@tty1.service -&amp;gt; ../../../../lib/systemd/system/getty@.service&lt;br /&gt;
 │   │   ├── local-fs.target.wants&lt;br /&gt;
 │   │   │   └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   │   ├── multi-user.target.wants&lt;br /&gt;
 │   │   │   ├── auditd.service -&amp;gt; /lib/systemd/system/auditd.service&lt;br /&gt;
 │   │   │   ├── connman.service -&amp;gt; /lib/systemd/system/connman.service&lt;br /&gt;
 │   │   │   ├── machines.target -&amp;gt; ../../../../lib/systemd/system/machines.target&lt;br /&gt;
 │   │   │   └── remote-fs.target -&amp;gt; ../../../../lib/systemd/system/remote-fs.target&lt;br /&gt;
 │   │   ├── network.target.wants&lt;br /&gt;
 │   │   │   ├── ip6tables.service -&amp;gt; /lib/systemd/system/ip6tables.service&lt;br /&gt;
 │   │   │   └── iptables.service -&amp;gt; /lib/systemd/system/iptables.service&lt;br /&gt;
 │   │   ├── sockets.target.wants&lt;br /&gt;
 │   │   │   └── sshd.socket -&amp;gt; /lib/systemd/system/sshd.socket&lt;br /&gt;
 │   │   ├── sysinit.target.wants&lt;br /&gt;
 │   │   │   ├── run-postinsts.service -&amp;gt; /lib/systemd/system/run-postinsts.service&lt;br /&gt;
 │   │   │   └── systemd-timesyncd.service -&amp;gt; ../../../../lib/systemd/system/systemd-timesyncd.service&lt;br /&gt;
 │   │   └── systemd-random-seed.service.wants&lt;br /&gt;
 │   │       └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   ├── timesyncd.conf&lt;br /&gt;
 │   ├── user&lt;br /&gt;
 │   └── user.conf&lt;br /&gt;
 ├── terminfo&lt;br /&gt;
 │   ├── a&lt;br /&gt;
 │   │   └── ansi&lt;br /&gt;
 │   ├── d&lt;br /&gt;
 │   │   └── dumb&lt;br /&gt;
 │   ├── l&lt;br /&gt;
 │   │   └── linux&lt;br /&gt;
 │   ├── r&lt;br /&gt;
 │   │   └── rxvt&lt;br /&gt;
 │   ├── s&lt;br /&gt;
 │   │   ├── screen&lt;br /&gt;
 │   │   ├── screen-256color&lt;br /&gt;
 │   │   └── sun&lt;br /&gt;
 │   ├── v&lt;br /&gt;
 │   │   ├── vt100&lt;br /&gt;
 │   │   ├── vt102&lt;br /&gt;
 │   │   ├── vt200&lt;br /&gt;
 │   │   ├── vt220&lt;br /&gt;
 │   │   └── vt52&lt;br /&gt;
 │   └── x&lt;br /&gt;
 │       ├── xterm -&amp;gt; xterm-color&lt;br /&gt;
 │       ├── xterm-256color&lt;br /&gt;
 │       ├── xterm-color&lt;br /&gt;
 │       └── xterm-xfree86&lt;br /&gt;
 ├── timestamp&lt;br /&gt;
 ├── tmpfiles.d&lt;br /&gt;
 │   ├── 00-create-volatile.conf&lt;br /&gt;
 │   ├── audit-volatile.conf&lt;br /&gt;
 │   └── connman_resolvconf.conf&lt;br /&gt;
 ├── udev&lt;br /&gt;
 │   ├── hwdb.d&lt;br /&gt;
 │   ├── rules.d&lt;br /&gt;
 │   │   ├── touchscreen.rules&lt;br /&gt;
 │   │   └── udev-smack-default.rules&lt;br /&gt;
 │   └── udev.conf&lt;br /&gt;
 ├── udhcpc.d&lt;br /&gt;
 │   └── 50default&lt;br /&gt;
 ├── version&lt;br /&gt;
 ├── wpa_supplicant.conf&lt;br /&gt;
 └── xdg&lt;br /&gt;
     └── systemd&lt;br /&gt;
         └── user -&amp;gt; ../../systemd/user&lt;br /&gt;
 &lt;br /&gt;
 62 directories, 500 files&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25134</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25134"/>
		<updated>2017-03-10T12:27:57Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Limitations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty when booting. No state persists across reboots, hence the name. A more relaxed version of this preserves config files in /etc, but still allows them to be removed at any time to do a factory reset.&lt;br /&gt;
&lt;br /&gt;
See http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Ideally, no configuration files are needed by the OS in /etc at all, while using them when they exist. Only the local admin or configuration tools create files there. In such a setup, configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of files are still expected in /etc. They can be placed there from factory defaults via the systemd tmpfiles.d service. After a system update, either a factory reset must be done or these copied files must be overwritten with more recent ones from the updated factory defaults.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Ideally, an OS component itself knows how to update the default configuration with small, independent configuration fragments in /etc, i.e. the actual configuration is constructed dynamically at runtime. systemd works like that.&lt;br /&gt;
&lt;br /&gt;
Less suitable, but still &amp;quot;stateless&amp;quot; is an OS component which reads a configuration file from /etc if it exists and falls back to some read-only default when it doesn&#039;t. This is less suitable when a real human creates the configuration in /etc because that person then has to ensure that updated system defaults get copied into the config file in /etc, but it may work when the file is created using some tool that can be re-run after an update.&lt;br /&gt;
&lt;br /&gt;
Finally, an OS component can be configured to ignore /etc entirely and just read its configuration files from a read-only location. It can then still be configured when building the OS, but not locally. Depending on the use-cases, such local modifications might not be needed.&lt;br /&gt;
&lt;br /&gt;
Some legacy components use /etc as location for files created at runtime. This is undesirable because it makes it less obvious for an admin which files in /etc may be modified, but if the files get recreated without data loss after a factory reset or system update, then using /etc is acceptable.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It supports STATELESS_RELOCATE_pn-&amp;lt;recipe&amp;gt; = &amp;quot;True&amp;quot; for compiling a recipe such that it uses a read-only sysconfig directory. STATELESS_MV is for cases where a recipe puts files into /etc in do_install that can also be elsewhere. STATELESS_RM is for items that can be removed. The same exists as STATELESS_RM/MV_ROOTFS for items created as part of package installation or rootfs functions.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. It does not yet enforce an empty /etc. Instead one has to run &amp;quot;bitbake refkit-image-common:do_rootfs&amp;quot; and check the content of /etc manually.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* use STATELESS_MV_pn-&amp;lt;recipe&amp;gt; to avoid repackaging other recipes&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_ETC_WHITELIST&lt;br /&gt;
** STATELESS_RM/MV sorted by pn-&amp;lt;reciped&amp;gt; (alphabetically)&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** special python functions&lt;br /&gt;
&lt;br /&gt;
refkit-image-common is stateless once /etc is empty after do_rootfs and the resulting image works without problems. Right now, it still has the following content:&lt;br /&gt;
&lt;br /&gt;
 $ tree tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 ├── asound.conf&lt;br /&gt;
 ├── audisp&lt;br /&gt;
 │   ├── audispd.conf&lt;br /&gt;
 │   └── plugins.d&lt;br /&gt;
 │       ├── af_unix.conf&lt;br /&gt;
 │       └── syslog.conf&lt;br /&gt;
 ├── audit&lt;br /&gt;
 │   ├── auditd.conf&lt;br /&gt;
 │   ├── audit.rules&lt;br /&gt;
 │   └── rules.d&lt;br /&gt;
 │       └── audit.rules&lt;br /&gt;
 ├── bluetooth&lt;br /&gt;
 │   ├── input.conf&lt;br /&gt;
 │   └── network.conf&lt;br /&gt;
 ├── build&lt;br /&gt;
 ├── busybox.links.nosuid&lt;br /&gt;
 ├── busybox.links.suid&lt;br /&gt;
 ├── ca-certificates&lt;br /&gt;
 │   └── update.d&lt;br /&gt;
 ├── ca-certificates.conf&lt;br /&gt;
 ├── dbus-1&lt;br /&gt;
 │   ├── session.conf&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   └── system.d&lt;br /&gt;
 │       ├── bluetooth.conf&lt;br /&gt;
 │       ├── connman.conf&lt;br /&gt;
 │       ├── dbus-wpa_supplicant.conf&lt;br /&gt;
 │       ├── org.freedesktop.hostname1.conf&lt;br /&gt;
 │       ├── org.freedesktop.locale1.conf&lt;br /&gt;
 │       ├── org.freedesktop.login1.conf&lt;br /&gt;
 │       ├── org.freedesktop.machine1.conf&lt;br /&gt;
 │       ├── org.freedesktop.systemd1.conf&lt;br /&gt;
 │       └── org.freedesktop.timedate1.conf&lt;br /&gt;
 ├── default&lt;br /&gt;
 │   ├── auditd&lt;br /&gt;
 │   ├── mountall&lt;br /&gt;
 │   ├── usbd&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   └── volatiles&lt;br /&gt;
 │       ├── 99_dbus&lt;br /&gt;
 │       ├── 99_pam&lt;br /&gt;
 │       ├── 99_sshd&lt;br /&gt;
 │       └── 99_wpa_supplicant&lt;br /&gt;
 ├── depmod.d&lt;br /&gt;
 ├── environment&lt;br /&gt;
 ├── filesystems&lt;br /&gt;
 ├── fstab&lt;br /&gt;
 ├── group&lt;br /&gt;
 ├── gshadow&lt;br /&gt;
 ├── host.conf&lt;br /&gt;
 ├── hostname&lt;br /&gt;
 ├── hosts&lt;br /&gt;
 ├── init.d&lt;br /&gt;
 │   └── smack&lt;br /&gt;
 ├── inputrc&lt;br /&gt;
 ├── issue&lt;br /&gt;
 ├── issue.net&lt;br /&gt;
 ├── ld.so.conf&lt;br /&gt;
 ├── libaudit.conf&lt;br /&gt;
 ├── libnl&lt;br /&gt;
 │   ├── classid&lt;br /&gt;
 │   └── pktloc&lt;br /&gt;
 ├── login.defs&lt;br /&gt;
 ├── machine-id&lt;br /&gt;
 ├── mke2fs.conf&lt;br /&gt;
 ├── modprobe.d&lt;br /&gt;
 ├── modules-load.d&lt;br /&gt;
 │   ├── iwlwifi.conf&lt;br /&gt;
 │   └── uio.conf&lt;br /&gt;
 ├── motd&lt;br /&gt;
 ├── mtab -&amp;gt; /proc/mounts&lt;br /&gt;
 ├── network&lt;br /&gt;
 │   ├── if-down.d&lt;br /&gt;
 │   ├── if-post-down.d&lt;br /&gt;
 │   │   └── wpa-supplicant -&amp;gt; ../if-pre-up.d/wpa-supplicant&lt;br /&gt;
 │   └── if-pre-up.d&lt;br /&gt;
 │       └── wpa-supplicant&lt;br /&gt;
 ├── nsswitch.conf&lt;br /&gt;
 ├── os-release&lt;br /&gt;
 ├── pam.d&lt;br /&gt;
 │   ├── chage&lt;br /&gt;
 │   ├── chfn&lt;br /&gt;
 │   ├── chgpasswd&lt;br /&gt;
 │   ├── chpasswd&lt;br /&gt;
 │   ├── chsh&lt;br /&gt;
 │   ├── common-account&lt;br /&gt;
 │   ├── common-auth&lt;br /&gt;
 │   ├── common-password&lt;br /&gt;
 │   ├── common-session&lt;br /&gt;
 │   ├── common-session-noninteractive&lt;br /&gt;
 │   ├── groupadd&lt;br /&gt;
 │   ├── groupdel&lt;br /&gt;
 │   ├── groupmems&lt;br /&gt;
 │   ├── groupmod&lt;br /&gt;
 │   ├── login&lt;br /&gt;
 │   ├── newusers&lt;br /&gt;
 │   ├── other&lt;br /&gt;
 │   ├── passwd&lt;br /&gt;
 │   ├── runuser&lt;br /&gt;
 │   ├── runuser-l&lt;br /&gt;
 │   ├── sshd&lt;br /&gt;
 │   ├── su&lt;br /&gt;
 │   ├── systemd-user&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   ├── userdel&lt;br /&gt;
 │   └── usermod&lt;br /&gt;
 ├── passwd&lt;br /&gt;
 ├── profile&lt;br /&gt;
 ├── protocols&lt;br /&gt;
 ├── request-key.conf&lt;br /&gt;
 ├── request-key.d&lt;br /&gt;
 ├── rpc&lt;br /&gt;
 ├── securetty&lt;br /&gt;
 ├── security&lt;br /&gt;
 │   ├── access.conf&lt;br /&gt;
 │   ├── group.conf&lt;br /&gt;
 │   ├── limits.conf&lt;br /&gt;
 │   ├── limits.d&lt;br /&gt;
 │   ├── namespace.conf&lt;br /&gt;
 │   ├── namespace.d&lt;br /&gt;
 │   ├── namespace.init&lt;br /&gt;
 │   ├── pam_env.conf&lt;br /&gt;
 │   └── time.conf&lt;br /&gt;
 ├── services&lt;br /&gt;
 ├── shadow&lt;br /&gt;
 ├── shells&lt;br /&gt;
 ├── skel&lt;br /&gt;
 ├── smack&lt;br /&gt;
 │   ├── accesses.d&lt;br /&gt;
 │   └── cipso.d&lt;br /&gt;
 ├── ssh&lt;br /&gt;
 │   ├── moduli&lt;br /&gt;
 │   ├── ssh_config&lt;br /&gt;
 │   ├── sshd_config&lt;br /&gt;
 │   └── sshd_config_readonly&lt;br /&gt;
 ├── ssl&lt;br /&gt;
 │   ├── certs&lt;br /&gt;
 │   │   ├── 02265526.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority_-_G2.crt&lt;br /&gt;
 │   │   ├── 024dc131.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Microsec_e-Szigno_Root_CA.crt&lt;br /&gt;
 │   │   ├── 03179a64.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_EV_Root_CA.crt&lt;br /&gt;
 ...&lt;br /&gt;
 │   │   └── XRamp_Global_CA_Root.pem -&amp;gt; /usr/share/ca-certificates/mozilla/XRamp_Global_CA_Root.crt&lt;br /&gt;
 │   ├── openssl.cnf&lt;br /&gt;
 │   └── private&lt;br /&gt;
 ├── sysctl.d&lt;br /&gt;
 ├── systemd&lt;br /&gt;
 │   ├── journald.conf&lt;br /&gt;
 │   ├── logind.conf&lt;br /&gt;
 │   ├── network&lt;br /&gt;
 │   ├── system&lt;br /&gt;
 │   │   ├── bluetooth.target.wants&lt;br /&gt;
 │   │   │   └── bluetooth.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── ctrl-alt-del.target -&amp;gt; ../../../lib/systemd/system/reboot.target&lt;br /&gt;
 │   │   ├── dbus-org.bluez.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── default.target -&amp;gt; /lib/systemd/system/multi-user.target&lt;br /&gt;
 │   │   ├── getty.target.wants&lt;br /&gt;
 │   │   │   └── getty@tty1.service -&amp;gt; ../../../../lib/systemd/system/getty@.service&lt;br /&gt;
 │   │   ├── local-fs.target.wants&lt;br /&gt;
 │   │   │   └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   │   ├── multi-user.target.wants&lt;br /&gt;
 │   │   │   ├── auditd.service -&amp;gt; /lib/systemd/system/auditd.service&lt;br /&gt;
 │   │   │   ├── connman.service -&amp;gt; /lib/systemd/system/connman.service&lt;br /&gt;
 │   │   │   ├── machines.target -&amp;gt; ../../../../lib/systemd/system/machines.target&lt;br /&gt;
 │   │   │   └── remote-fs.target -&amp;gt; ../../../../lib/systemd/system/remote-fs.target&lt;br /&gt;
 │   │   ├── network.target.wants&lt;br /&gt;
 │   │   │   ├── ip6tables.service -&amp;gt; /lib/systemd/system/ip6tables.service&lt;br /&gt;
 │   │   │   └── iptables.service -&amp;gt; /lib/systemd/system/iptables.service&lt;br /&gt;
 │   │   ├── sockets.target.wants&lt;br /&gt;
 │   │   │   └── sshd.socket -&amp;gt; /lib/systemd/system/sshd.socket&lt;br /&gt;
 │   │   ├── sysinit.target.wants&lt;br /&gt;
 │   │   │   ├── run-postinsts.service -&amp;gt; /lib/systemd/system/run-postinsts.service&lt;br /&gt;
 │   │   │   └── systemd-timesyncd.service -&amp;gt; ../../../../lib/systemd/system/systemd-timesyncd.service&lt;br /&gt;
 │   │   └── systemd-random-seed.service.wants&lt;br /&gt;
 │   │       └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   ├── timesyncd.conf&lt;br /&gt;
 │   ├── user&lt;br /&gt;
 │   └── user.conf&lt;br /&gt;
 ├── terminfo&lt;br /&gt;
 │   ├── a&lt;br /&gt;
 │   │   └── ansi&lt;br /&gt;
 │   ├── d&lt;br /&gt;
 │   │   └── dumb&lt;br /&gt;
 │   ├── l&lt;br /&gt;
 │   │   └── linux&lt;br /&gt;
 │   ├── r&lt;br /&gt;
 │   │   └── rxvt&lt;br /&gt;
 │   ├── s&lt;br /&gt;
 │   │   ├── screen&lt;br /&gt;
 │   │   ├── screen-256color&lt;br /&gt;
 │   │   └── sun&lt;br /&gt;
 │   ├── v&lt;br /&gt;
 │   │   ├── vt100&lt;br /&gt;
 │   │   ├── vt102&lt;br /&gt;
 │   │   ├── vt200&lt;br /&gt;
 │   │   ├── vt220&lt;br /&gt;
 │   │   └── vt52&lt;br /&gt;
 │   └── x&lt;br /&gt;
 │       ├── xterm -&amp;gt; xterm-color&lt;br /&gt;
 │       ├── xterm-256color&lt;br /&gt;
 │       ├── xterm-color&lt;br /&gt;
 │       └── xterm-xfree86&lt;br /&gt;
 ├── timestamp&lt;br /&gt;
 ├── tmpfiles.d&lt;br /&gt;
 │   ├── 00-create-volatile.conf&lt;br /&gt;
 │   ├── audit-volatile.conf&lt;br /&gt;
 │   └── connman_resolvconf.conf&lt;br /&gt;
 ├── udev&lt;br /&gt;
 │   ├── hwdb.d&lt;br /&gt;
 │   ├── rules.d&lt;br /&gt;
 │   │   ├── touchscreen.rules&lt;br /&gt;
 │   │   └── udev-smack-default.rules&lt;br /&gt;
 │   └── udev.conf&lt;br /&gt;
 ├── udhcpc.d&lt;br /&gt;
 │   └── 50default&lt;br /&gt;
 ├── version&lt;br /&gt;
 ├── wpa_supplicant.conf&lt;br /&gt;
 └── xdg&lt;br /&gt;
     └── systemd&lt;br /&gt;
         └── user -&amp;gt; ../../systemd/user&lt;br /&gt;
 &lt;br /&gt;
 62 directories, 500 files&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25133</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25133"/>
		<updated>2017-03-10T11:27:18Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Limitations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty when booting. No state persists across reboots, hence the name. A more relaxed version of this preserves config files in /etc, but still allows them to be removed at any time to do a factory reset.&lt;br /&gt;
&lt;br /&gt;
See http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Ideally, no configuration files are *needed* by the OS in /etc at all, while using them when they exist. Only the local admin or configuration tools create files there. In such a setup, configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of files are still expected in /etc. They can be placed there from factory defaults via the systemd tmpfiles.d service. After a system update, either a factory reset must be done or these copied files must be overwritten with more recent ones from the updated factory defaults.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Ideally, an OS component itself knows how to update the default configuration with small, independent configuration fragments in /etc, i.e. the actual configuration is constructed dynamically at runtime. systemd works like that.&lt;br /&gt;
&lt;br /&gt;
Less suitable, but still &amp;quot;stateless&amp;quot; is an OS component which reads a configuration file from /etc if it exists and falls back to some read-only default when it doesn&#039;t. This is less suitable when a real human creates the configuration in /etc because that person then has to ensure that updated system defaults get copied into the config file in /etc, but it may work when the file is created using some tool that can be re-run after an update.&lt;br /&gt;
&lt;br /&gt;
Finally, an OS component can be configured to ignore /etc entirely and just read its configuration files from a read-only location. It can then still be configured when building the OS, but not locally. Depending on the use-cases, such local modifications might not be needed.&lt;br /&gt;
&lt;br /&gt;
Some legacy components use /etc as location for files created at runtime. This is undesirable because it makes it less obvious for an admin which files in /etc may be modified, but if the files get recreated without data loss after a factory reset or system update, then using /etc is acceptable.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It supports STATELESS_RELOCATE_pn-&amp;lt;recipe&amp;gt; = &amp;quot;True&amp;quot; for compiling a recipe such that it uses a read-only sysconfig directory. STATELESS_MV is for cases where a recipe puts files into /etc in do_install that can also be elsewhere. STATELESS_RM is for items that can be removed. The same exists as STATELESS_RM/MV_ROOTFS for items created as part of package installation or rootfs functions.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. It does not yet enforce an empty /etc. Instead one has to run &amp;quot;bitbake refkit-image-common:do_rootfs&amp;quot; and check the content of /etc manually.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* use STATELESS_MV_pn-&amp;lt;recipe&amp;gt; to avoid repackaging other recipes&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_ETC_WHITELIST&lt;br /&gt;
** STATELESS_RM/MV sorted by pn-&amp;lt;reciped&amp;gt; (alphabetically)&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** special python functions&lt;br /&gt;
&lt;br /&gt;
refkit-image-common is stateless once /etc is empty after do_rootfs and the resulting image works without problems. Right now, it still has the following content:&lt;br /&gt;
&lt;br /&gt;
 $ tree tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 ├── asound.conf&lt;br /&gt;
 ├── audisp&lt;br /&gt;
 │   ├── audispd.conf&lt;br /&gt;
 │   └── plugins.d&lt;br /&gt;
 │       ├── af_unix.conf&lt;br /&gt;
 │       └── syslog.conf&lt;br /&gt;
 ├── audit&lt;br /&gt;
 │   ├── auditd.conf&lt;br /&gt;
 │   ├── audit.rules&lt;br /&gt;
 │   └── rules.d&lt;br /&gt;
 │       └── audit.rules&lt;br /&gt;
 ├── bluetooth&lt;br /&gt;
 │   ├── input.conf&lt;br /&gt;
 │   └── network.conf&lt;br /&gt;
 ├── build&lt;br /&gt;
 ├── busybox.links.nosuid&lt;br /&gt;
 ├── busybox.links.suid&lt;br /&gt;
 ├── ca-certificates&lt;br /&gt;
 │   └── update.d&lt;br /&gt;
 ├── ca-certificates.conf&lt;br /&gt;
 ├── dbus-1&lt;br /&gt;
 │   ├── session.conf&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   └── system.d&lt;br /&gt;
 │       ├── bluetooth.conf&lt;br /&gt;
 │       ├── connman.conf&lt;br /&gt;
 │       ├── dbus-wpa_supplicant.conf&lt;br /&gt;
 │       ├── org.freedesktop.hostname1.conf&lt;br /&gt;
 │       ├── org.freedesktop.locale1.conf&lt;br /&gt;
 │       ├── org.freedesktop.login1.conf&lt;br /&gt;
 │       ├── org.freedesktop.machine1.conf&lt;br /&gt;
 │       ├── org.freedesktop.systemd1.conf&lt;br /&gt;
 │       └── org.freedesktop.timedate1.conf&lt;br /&gt;
 ├── default&lt;br /&gt;
 │   ├── auditd&lt;br /&gt;
 │   ├── mountall&lt;br /&gt;
 │   ├── usbd&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   └── volatiles&lt;br /&gt;
 │       ├── 99_dbus&lt;br /&gt;
 │       ├── 99_pam&lt;br /&gt;
 │       ├── 99_sshd&lt;br /&gt;
 │       └── 99_wpa_supplicant&lt;br /&gt;
 ├── depmod.d&lt;br /&gt;
 ├── environment&lt;br /&gt;
 ├── filesystems&lt;br /&gt;
 ├── fstab&lt;br /&gt;
 ├── group&lt;br /&gt;
 ├── gshadow&lt;br /&gt;
 ├── host.conf&lt;br /&gt;
 ├── hostname&lt;br /&gt;
 ├── hosts&lt;br /&gt;
 ├── init.d&lt;br /&gt;
 │   └── smack&lt;br /&gt;
 ├── inputrc&lt;br /&gt;
 ├── issue&lt;br /&gt;
 ├── issue.net&lt;br /&gt;
 ├── ld.so.conf&lt;br /&gt;
 ├── libaudit.conf&lt;br /&gt;
 ├── libnl&lt;br /&gt;
 │   ├── classid&lt;br /&gt;
 │   └── pktloc&lt;br /&gt;
 ├── login.defs&lt;br /&gt;
 ├── machine-id&lt;br /&gt;
 ├── mke2fs.conf&lt;br /&gt;
 ├── modprobe.d&lt;br /&gt;
 ├── modules-load.d&lt;br /&gt;
 │   ├── iwlwifi.conf&lt;br /&gt;
 │   └── uio.conf&lt;br /&gt;
 ├── motd&lt;br /&gt;
 ├── mtab -&amp;gt; /proc/mounts&lt;br /&gt;
 ├── network&lt;br /&gt;
 │   ├── if-down.d&lt;br /&gt;
 │   ├── if-post-down.d&lt;br /&gt;
 │   │   └── wpa-supplicant -&amp;gt; ../if-pre-up.d/wpa-supplicant&lt;br /&gt;
 │   └── if-pre-up.d&lt;br /&gt;
 │       └── wpa-supplicant&lt;br /&gt;
 ├── nsswitch.conf&lt;br /&gt;
 ├── os-release&lt;br /&gt;
 ├── pam.d&lt;br /&gt;
 │   ├── chage&lt;br /&gt;
 │   ├── chfn&lt;br /&gt;
 │   ├── chgpasswd&lt;br /&gt;
 │   ├── chpasswd&lt;br /&gt;
 │   ├── chsh&lt;br /&gt;
 │   ├── common-account&lt;br /&gt;
 │   ├── common-auth&lt;br /&gt;
 │   ├── common-password&lt;br /&gt;
 │   ├── common-session&lt;br /&gt;
 │   ├── common-session-noninteractive&lt;br /&gt;
 │   ├── groupadd&lt;br /&gt;
 │   ├── groupdel&lt;br /&gt;
 │   ├── groupmems&lt;br /&gt;
 │   ├── groupmod&lt;br /&gt;
 │   ├── login&lt;br /&gt;
 │   ├── newusers&lt;br /&gt;
 │   ├── other&lt;br /&gt;
 │   ├── passwd&lt;br /&gt;
 │   ├── runuser&lt;br /&gt;
 │   ├── runuser-l&lt;br /&gt;
 │   ├── sshd&lt;br /&gt;
 │   ├── su&lt;br /&gt;
 │   ├── systemd-user&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   ├── userdel&lt;br /&gt;
 │   └── usermod&lt;br /&gt;
 ├── passwd&lt;br /&gt;
 ├── profile&lt;br /&gt;
 ├── protocols&lt;br /&gt;
 ├── request-key.conf&lt;br /&gt;
 ├── request-key.d&lt;br /&gt;
 ├── rpc&lt;br /&gt;
 ├── securetty&lt;br /&gt;
 ├── security&lt;br /&gt;
 │   ├── access.conf&lt;br /&gt;
 │   ├── group.conf&lt;br /&gt;
 │   ├── limits.conf&lt;br /&gt;
 │   ├── limits.d&lt;br /&gt;
 │   ├── namespace.conf&lt;br /&gt;
 │   ├── namespace.d&lt;br /&gt;
 │   ├── namespace.init&lt;br /&gt;
 │   ├── pam_env.conf&lt;br /&gt;
 │   └── time.conf&lt;br /&gt;
 ├── services&lt;br /&gt;
 ├── shadow&lt;br /&gt;
 ├── shells&lt;br /&gt;
 ├── skel&lt;br /&gt;
 ├── smack&lt;br /&gt;
 │   ├── accesses.d&lt;br /&gt;
 │   └── cipso.d&lt;br /&gt;
 ├── ssh&lt;br /&gt;
 │   ├── moduli&lt;br /&gt;
 │   ├── ssh_config&lt;br /&gt;
 │   ├── sshd_config&lt;br /&gt;
 │   └── sshd_config_readonly&lt;br /&gt;
 ├── ssl&lt;br /&gt;
 │   ├── certs&lt;br /&gt;
 │   │   ├── 02265526.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority_-_G2.crt&lt;br /&gt;
 │   │   ├── 024dc131.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Microsec_e-Szigno_Root_CA.crt&lt;br /&gt;
 │   │   ├── 03179a64.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_EV_Root_CA.crt&lt;br /&gt;
 ...&lt;br /&gt;
 │   │   └── XRamp_Global_CA_Root.pem -&amp;gt; /usr/share/ca-certificates/mozilla/XRamp_Global_CA_Root.crt&lt;br /&gt;
 │   ├── openssl.cnf&lt;br /&gt;
 │   └── private&lt;br /&gt;
 ├── sysctl.d&lt;br /&gt;
 ├── systemd&lt;br /&gt;
 │   ├── journald.conf&lt;br /&gt;
 │   ├── logind.conf&lt;br /&gt;
 │   ├── network&lt;br /&gt;
 │   ├── system&lt;br /&gt;
 │   │   ├── bluetooth.target.wants&lt;br /&gt;
 │   │   │   └── bluetooth.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── ctrl-alt-del.target -&amp;gt; ../../../lib/systemd/system/reboot.target&lt;br /&gt;
 │   │   ├── dbus-org.bluez.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── default.target -&amp;gt; /lib/systemd/system/multi-user.target&lt;br /&gt;
 │   │   ├── getty.target.wants&lt;br /&gt;
 │   │   │   └── getty@tty1.service -&amp;gt; ../../../../lib/systemd/system/getty@.service&lt;br /&gt;
 │   │   ├── local-fs.target.wants&lt;br /&gt;
 │   │   │   └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   │   ├── multi-user.target.wants&lt;br /&gt;
 │   │   │   ├── auditd.service -&amp;gt; /lib/systemd/system/auditd.service&lt;br /&gt;
 │   │   │   ├── connman.service -&amp;gt; /lib/systemd/system/connman.service&lt;br /&gt;
 │   │   │   ├── machines.target -&amp;gt; ../../../../lib/systemd/system/machines.target&lt;br /&gt;
 │   │   │   └── remote-fs.target -&amp;gt; ../../../../lib/systemd/system/remote-fs.target&lt;br /&gt;
 │   │   ├── network.target.wants&lt;br /&gt;
 │   │   │   ├── ip6tables.service -&amp;gt; /lib/systemd/system/ip6tables.service&lt;br /&gt;
 │   │   │   └── iptables.service -&amp;gt; /lib/systemd/system/iptables.service&lt;br /&gt;
 │   │   ├── sockets.target.wants&lt;br /&gt;
 │   │   │   └── sshd.socket -&amp;gt; /lib/systemd/system/sshd.socket&lt;br /&gt;
 │   │   ├── sysinit.target.wants&lt;br /&gt;
 │   │   │   ├── run-postinsts.service -&amp;gt; /lib/systemd/system/run-postinsts.service&lt;br /&gt;
 │   │   │   └── systemd-timesyncd.service -&amp;gt; ../../../../lib/systemd/system/systemd-timesyncd.service&lt;br /&gt;
 │   │   └── systemd-random-seed.service.wants&lt;br /&gt;
 │   │       └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   ├── timesyncd.conf&lt;br /&gt;
 │   ├── user&lt;br /&gt;
 │   └── user.conf&lt;br /&gt;
 ├── terminfo&lt;br /&gt;
 │   ├── a&lt;br /&gt;
 │   │   └── ansi&lt;br /&gt;
 │   ├── d&lt;br /&gt;
 │   │   └── dumb&lt;br /&gt;
 │   ├── l&lt;br /&gt;
 │   │   └── linux&lt;br /&gt;
 │   ├── r&lt;br /&gt;
 │   │   └── rxvt&lt;br /&gt;
 │   ├── s&lt;br /&gt;
 │   │   ├── screen&lt;br /&gt;
 │   │   ├── screen-256color&lt;br /&gt;
 │   │   └── sun&lt;br /&gt;
 │   ├── v&lt;br /&gt;
 │   │   ├── vt100&lt;br /&gt;
 │   │   ├── vt102&lt;br /&gt;
 │   │   ├── vt200&lt;br /&gt;
 │   │   ├── vt220&lt;br /&gt;
 │   │   └── vt52&lt;br /&gt;
 │   └── x&lt;br /&gt;
 │       ├── xterm -&amp;gt; xterm-color&lt;br /&gt;
 │       ├── xterm-256color&lt;br /&gt;
 │       ├── xterm-color&lt;br /&gt;
 │       └── xterm-xfree86&lt;br /&gt;
 ├── timestamp&lt;br /&gt;
 ├── tmpfiles.d&lt;br /&gt;
 │   ├── 00-create-volatile.conf&lt;br /&gt;
 │   ├── audit-volatile.conf&lt;br /&gt;
 │   └── connman_resolvconf.conf&lt;br /&gt;
 ├── udev&lt;br /&gt;
 │   ├── hwdb.d&lt;br /&gt;
 │   ├── rules.d&lt;br /&gt;
 │   │   ├── touchscreen.rules&lt;br /&gt;
 │   │   └── udev-smack-default.rules&lt;br /&gt;
 │   └── udev.conf&lt;br /&gt;
 ├── udhcpc.d&lt;br /&gt;
 │   └── 50default&lt;br /&gt;
 ├── version&lt;br /&gt;
 ├── wpa_supplicant.conf&lt;br /&gt;
 └── xdg&lt;br /&gt;
     └── systemd&lt;br /&gt;
         └── user -&amp;gt; ../../systemd/user&lt;br /&gt;
 &lt;br /&gt;
 62 directories, 500 files&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25132</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=25132"/>
		<updated>2017-03-10T11:21:01Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty when booting. No state persists across reboots, hence the name. A more relaxed version of this preserves config files in /etc, but still allows them to be removed at any time to do a factory reset.&lt;br /&gt;
&lt;br /&gt;
See http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc, without exceptions.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Ideally, an OS component itself knows how to update the default configuration with small, independent configuration fragments in /etc, i.e. the actual configuration is constructed dynamically at runtime. systemd works like that.&lt;br /&gt;
&lt;br /&gt;
Less suitable, but still &amp;quot;stateless&amp;quot; is an OS component which reads a configuration file from /etc if it exists and falls back to some read-only default when it doesn&#039;t. This is less suitable when a real human creates the configuration in /etc because that person then has to ensure that updated system defaults get copied into the config file in /etc, but it may work when the file is created using some tool that can be re-run after an update.&lt;br /&gt;
&lt;br /&gt;
Finally, an OS component can be configured to ignore /etc entirely and just read its configuration files from a read-only location. It can then still be configured when building the OS, but not locally. Depending on the use-cases, such local modifications might not be needed.&lt;br /&gt;
&lt;br /&gt;
Some legacy components use /etc as location for files created at runtime. This is undesirable because it makes it less obvious for an admin which files in /etc may be modified, but if the files get recreated without data loss after a factory reset or system update, then using /etc is acceptable.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It supports STATELESS_RELOCATE_pn-&amp;lt;recipe&amp;gt; = &amp;quot;True&amp;quot; for compiling a recipe such that it uses a read-only sysconfig directory. STATELESS_MV is for cases where a recipe puts files into /etc in do_install that can also be elsewhere. STATELESS_RM is for items that can be removed. The same exists as STATELESS_RM/MV_ROOTFS for items created as part of package installation or rootfs functions.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. It does not yet enforce an empty /etc. Instead one has to run &amp;quot;bitbake refkit-image-common:do_rootfs&amp;quot; and check the content of /etc manually.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* use STATELESS_MV_pn-&amp;lt;recipe&amp;gt; to avoid repackaging other recipes&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_ETC_WHITELIST&lt;br /&gt;
** STATELESS_RM/MV sorted by pn-&amp;lt;reciped&amp;gt; (alphabetically)&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** special python functions&lt;br /&gt;
&lt;br /&gt;
refkit-image-common is stateless once /etc is empty after do_rootfs and the resulting image works without problems. Right now, it still has the following content:&lt;br /&gt;
&lt;br /&gt;
 $ tree tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 ├── asound.conf&lt;br /&gt;
 ├── audisp&lt;br /&gt;
 │   ├── audispd.conf&lt;br /&gt;
 │   └── plugins.d&lt;br /&gt;
 │       ├── af_unix.conf&lt;br /&gt;
 │       └── syslog.conf&lt;br /&gt;
 ├── audit&lt;br /&gt;
 │   ├── auditd.conf&lt;br /&gt;
 │   ├── audit.rules&lt;br /&gt;
 │   └── rules.d&lt;br /&gt;
 │       └── audit.rules&lt;br /&gt;
 ├── bluetooth&lt;br /&gt;
 │   ├── input.conf&lt;br /&gt;
 │   └── network.conf&lt;br /&gt;
 ├── build&lt;br /&gt;
 ├── busybox.links.nosuid&lt;br /&gt;
 ├── busybox.links.suid&lt;br /&gt;
 ├── ca-certificates&lt;br /&gt;
 │   └── update.d&lt;br /&gt;
 ├── ca-certificates.conf&lt;br /&gt;
 ├── dbus-1&lt;br /&gt;
 │   ├── session.conf&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   └── system.d&lt;br /&gt;
 │       ├── bluetooth.conf&lt;br /&gt;
 │       ├── connman.conf&lt;br /&gt;
 │       ├── dbus-wpa_supplicant.conf&lt;br /&gt;
 │       ├── org.freedesktop.hostname1.conf&lt;br /&gt;
 │       ├── org.freedesktop.locale1.conf&lt;br /&gt;
 │       ├── org.freedesktop.login1.conf&lt;br /&gt;
 │       ├── org.freedesktop.machine1.conf&lt;br /&gt;
 │       ├── org.freedesktop.systemd1.conf&lt;br /&gt;
 │       └── org.freedesktop.timedate1.conf&lt;br /&gt;
 ├── default&lt;br /&gt;
 │   ├── auditd&lt;br /&gt;
 │   ├── mountall&lt;br /&gt;
 │   ├── usbd&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   └── volatiles&lt;br /&gt;
 │       ├── 99_dbus&lt;br /&gt;
 │       ├── 99_pam&lt;br /&gt;
 │       ├── 99_sshd&lt;br /&gt;
 │       └── 99_wpa_supplicant&lt;br /&gt;
 ├── depmod.d&lt;br /&gt;
 ├── environment&lt;br /&gt;
 ├── filesystems&lt;br /&gt;
 ├── fstab&lt;br /&gt;
 ├── group&lt;br /&gt;
 ├── gshadow&lt;br /&gt;
 ├── host.conf&lt;br /&gt;
 ├── hostname&lt;br /&gt;
 ├── hosts&lt;br /&gt;
 ├── init.d&lt;br /&gt;
 │   └── smack&lt;br /&gt;
 ├── inputrc&lt;br /&gt;
 ├── issue&lt;br /&gt;
 ├── issue.net&lt;br /&gt;
 ├── ld.so.conf&lt;br /&gt;
 ├── libaudit.conf&lt;br /&gt;
 ├── libnl&lt;br /&gt;
 │   ├── classid&lt;br /&gt;
 │   └── pktloc&lt;br /&gt;
 ├── login.defs&lt;br /&gt;
 ├── machine-id&lt;br /&gt;
 ├── mke2fs.conf&lt;br /&gt;
 ├── modprobe.d&lt;br /&gt;
 ├── modules-load.d&lt;br /&gt;
 │   ├── iwlwifi.conf&lt;br /&gt;
 │   └── uio.conf&lt;br /&gt;
 ├── motd&lt;br /&gt;
 ├── mtab -&amp;gt; /proc/mounts&lt;br /&gt;
 ├── network&lt;br /&gt;
 │   ├── if-down.d&lt;br /&gt;
 │   ├── if-post-down.d&lt;br /&gt;
 │   │   └── wpa-supplicant -&amp;gt; ../if-pre-up.d/wpa-supplicant&lt;br /&gt;
 │   └── if-pre-up.d&lt;br /&gt;
 │       └── wpa-supplicant&lt;br /&gt;
 ├── nsswitch.conf&lt;br /&gt;
 ├── os-release&lt;br /&gt;
 ├── pam.d&lt;br /&gt;
 │   ├── chage&lt;br /&gt;
 │   ├── chfn&lt;br /&gt;
 │   ├── chgpasswd&lt;br /&gt;
 │   ├── chpasswd&lt;br /&gt;
 │   ├── chsh&lt;br /&gt;
 │   ├── common-account&lt;br /&gt;
 │   ├── common-auth&lt;br /&gt;
 │   ├── common-password&lt;br /&gt;
 │   ├── common-session&lt;br /&gt;
 │   ├── common-session-noninteractive&lt;br /&gt;
 │   ├── groupadd&lt;br /&gt;
 │   ├── groupdel&lt;br /&gt;
 │   ├── groupmems&lt;br /&gt;
 │   ├── groupmod&lt;br /&gt;
 │   ├── login&lt;br /&gt;
 │   ├── newusers&lt;br /&gt;
 │   ├── other&lt;br /&gt;
 │   ├── passwd&lt;br /&gt;
 │   ├── runuser&lt;br /&gt;
 │   ├── runuser-l&lt;br /&gt;
 │   ├── sshd&lt;br /&gt;
 │   ├── su&lt;br /&gt;
 │   ├── systemd-user&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   ├── userdel&lt;br /&gt;
 │   └── usermod&lt;br /&gt;
 ├── passwd&lt;br /&gt;
 ├── profile&lt;br /&gt;
 ├── protocols&lt;br /&gt;
 ├── request-key.conf&lt;br /&gt;
 ├── request-key.d&lt;br /&gt;
 ├── rpc&lt;br /&gt;
 ├── securetty&lt;br /&gt;
 ├── security&lt;br /&gt;
 │   ├── access.conf&lt;br /&gt;
 │   ├── group.conf&lt;br /&gt;
 │   ├── limits.conf&lt;br /&gt;
 │   ├── limits.d&lt;br /&gt;
 │   ├── namespace.conf&lt;br /&gt;
 │   ├── namespace.d&lt;br /&gt;
 │   ├── namespace.init&lt;br /&gt;
 │   ├── pam_env.conf&lt;br /&gt;
 │   └── time.conf&lt;br /&gt;
 ├── services&lt;br /&gt;
 ├── shadow&lt;br /&gt;
 ├── shells&lt;br /&gt;
 ├── skel&lt;br /&gt;
 ├── smack&lt;br /&gt;
 │   ├── accesses.d&lt;br /&gt;
 │   └── cipso.d&lt;br /&gt;
 ├── ssh&lt;br /&gt;
 │   ├── moduli&lt;br /&gt;
 │   ├── ssh_config&lt;br /&gt;
 │   ├── sshd_config&lt;br /&gt;
 │   └── sshd_config_readonly&lt;br /&gt;
 ├── ssl&lt;br /&gt;
 │   ├── certs&lt;br /&gt;
 │   │   ├── 02265526.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority_-_G2.crt&lt;br /&gt;
 │   │   ├── 024dc131.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Microsec_e-Szigno_Root_CA.crt&lt;br /&gt;
 │   │   ├── 03179a64.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_EV_Root_CA.crt&lt;br /&gt;
 ...&lt;br /&gt;
 │   │   └── XRamp_Global_CA_Root.pem -&amp;gt; /usr/share/ca-certificates/mozilla/XRamp_Global_CA_Root.crt&lt;br /&gt;
 │   ├── openssl.cnf&lt;br /&gt;
 │   └── private&lt;br /&gt;
 ├── sysctl.d&lt;br /&gt;
 ├── systemd&lt;br /&gt;
 │   ├── journald.conf&lt;br /&gt;
 │   ├── logind.conf&lt;br /&gt;
 │   ├── network&lt;br /&gt;
 │   ├── system&lt;br /&gt;
 │   │   ├── bluetooth.target.wants&lt;br /&gt;
 │   │   │   └── bluetooth.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── ctrl-alt-del.target -&amp;gt; ../../../lib/systemd/system/reboot.target&lt;br /&gt;
 │   │   ├── dbus-org.bluez.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── default.target -&amp;gt; /lib/systemd/system/multi-user.target&lt;br /&gt;
 │   │   ├── getty.target.wants&lt;br /&gt;
 │   │   │   └── getty@tty1.service -&amp;gt; ../../../../lib/systemd/system/getty@.service&lt;br /&gt;
 │   │   ├── local-fs.target.wants&lt;br /&gt;
 │   │   │   └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   │   ├── multi-user.target.wants&lt;br /&gt;
 │   │   │   ├── auditd.service -&amp;gt; /lib/systemd/system/auditd.service&lt;br /&gt;
 │   │   │   ├── connman.service -&amp;gt; /lib/systemd/system/connman.service&lt;br /&gt;
 │   │   │   ├── machines.target -&amp;gt; ../../../../lib/systemd/system/machines.target&lt;br /&gt;
 │   │   │   └── remote-fs.target -&amp;gt; ../../../../lib/systemd/system/remote-fs.target&lt;br /&gt;
 │   │   ├── network.target.wants&lt;br /&gt;
 │   │   │   ├── ip6tables.service -&amp;gt; /lib/systemd/system/ip6tables.service&lt;br /&gt;
 │   │   │   └── iptables.service -&amp;gt; /lib/systemd/system/iptables.service&lt;br /&gt;
 │   │   ├── sockets.target.wants&lt;br /&gt;
 │   │   │   └── sshd.socket -&amp;gt; /lib/systemd/system/sshd.socket&lt;br /&gt;
 │   │   ├── sysinit.target.wants&lt;br /&gt;
 │   │   │   ├── run-postinsts.service -&amp;gt; /lib/systemd/system/run-postinsts.service&lt;br /&gt;
 │   │   │   └── systemd-timesyncd.service -&amp;gt; ../../../../lib/systemd/system/systemd-timesyncd.service&lt;br /&gt;
 │   │   └── systemd-random-seed.service.wants&lt;br /&gt;
 │   │       └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   ├── timesyncd.conf&lt;br /&gt;
 │   ├── user&lt;br /&gt;
 │   └── user.conf&lt;br /&gt;
 ├── terminfo&lt;br /&gt;
 │   ├── a&lt;br /&gt;
 │   │   └── ansi&lt;br /&gt;
 │   ├── d&lt;br /&gt;
 │   │   └── dumb&lt;br /&gt;
 │   ├── l&lt;br /&gt;
 │   │   └── linux&lt;br /&gt;
 │   ├── r&lt;br /&gt;
 │   │   └── rxvt&lt;br /&gt;
 │   ├── s&lt;br /&gt;
 │   │   ├── screen&lt;br /&gt;
 │   │   ├── screen-256color&lt;br /&gt;
 │   │   └── sun&lt;br /&gt;
 │   ├── v&lt;br /&gt;
 │   │   ├── vt100&lt;br /&gt;
 │   │   ├── vt102&lt;br /&gt;
 │   │   ├── vt200&lt;br /&gt;
 │   │   ├── vt220&lt;br /&gt;
 │   │   └── vt52&lt;br /&gt;
 │   └── x&lt;br /&gt;
 │       ├── xterm -&amp;gt; xterm-color&lt;br /&gt;
 │       ├── xterm-256color&lt;br /&gt;
 │       ├── xterm-color&lt;br /&gt;
 │       └── xterm-xfree86&lt;br /&gt;
 ├── timestamp&lt;br /&gt;
 ├── tmpfiles.d&lt;br /&gt;
 │   ├── 00-create-volatile.conf&lt;br /&gt;
 │   ├── audit-volatile.conf&lt;br /&gt;
 │   └── connman_resolvconf.conf&lt;br /&gt;
 ├── udev&lt;br /&gt;
 │   ├── hwdb.d&lt;br /&gt;
 │   ├── rules.d&lt;br /&gt;
 │   │   ├── touchscreen.rules&lt;br /&gt;
 │   │   └── udev-smack-default.rules&lt;br /&gt;
 │   └── udev.conf&lt;br /&gt;
 ├── udhcpc.d&lt;br /&gt;
 │   └── 50default&lt;br /&gt;
 ├── version&lt;br /&gt;
 ├── wpa_supplicant.conf&lt;br /&gt;
 └── xdg&lt;br /&gt;
     └── systemd&lt;br /&gt;
         └── user -&amp;gt; ../../systemd/user&lt;br /&gt;
 &lt;br /&gt;
 62 directories, 500 files&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24537</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24537"/>
		<updated>2017-03-01T16:51:56Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Status and goals for &amp;quot;stateless&amp;quot; in Yocto */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty when booting. No state persists across reboots, hence the name. A more relaxed version of this preserves config files in /etc, but still allows them to be removed at any time to do a factory reset.&lt;br /&gt;
&lt;br /&gt;
See http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Ideally, an OS component itself knows how to update the default configuration with small, independent configuration fragments in /etc, i.e. the actual configuration is constructed dynamically at runtime. systemd works like that.&lt;br /&gt;
&lt;br /&gt;
Less suitable, but still &amp;quot;stateless&amp;quot; is an OS component which reads a configuration file from /etc if it exists and falls back to some read-only default when it doesn&#039;t. This is less suitable when a real human creates the configuration in /etc because that person then has to ensure that updated system defaults get copied into the config file in /etc, but it may work when the file is created using some tool that can be re-run after an update.&lt;br /&gt;
&lt;br /&gt;
Finally, an OS component can be configured to ignore /etc entirely and just read its configuration files from a read-only location. It can then still be configured when building the OS, but not locally. Depending on the use-cases, such local modifications might not be needed.&lt;br /&gt;
&lt;br /&gt;
Some legacy components use /etc as location for files created at runtime. This is undesirable because it makes it less obvious for an admin which files in /etc may be modified, but if the files get recreated without data loss after a factory reset or system update, then using /etc is acceptable.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless. Previous work in Ostro that led to a considerably reduced /etc is in https://github.com/pohly/ostro-os/tree/stateless-rebased.&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It supports STATELESS_RELOCATE_pn-&amp;lt;recipe&amp;gt; = &amp;quot;True&amp;quot; for compiling a recipe such that it uses a read-only sysconfig directory. STATELESS_MV is for cases where a recipe puts files into /etc in do_install that can also be elsewhere. STATELESS_RM is for items that can be removed. The same exists as STATELESS_RM/MV_ROOTFS for items created as part of package installation or rootfs functions.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. It does not yet enforce an empty /etc. Instead one has to run &amp;quot;bitbake refkit-image-common:do_rootfs&amp;quot; and check the content of /etc manually.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* use STATELESS_MV_pn-&amp;lt;recipe&amp;gt; to avoid repackaging other recipes&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_ETC_WHITELIST&lt;br /&gt;
** STATELESS_RM/MV sorted by pn-&amp;lt;reciped&amp;gt; (alphabetically)&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** special python functions&lt;br /&gt;
&lt;br /&gt;
refkit-image-common is stateless once /etc is empty after do_rootfs and the resulting image works without problems. Right now, it still has the following content:&lt;br /&gt;
&lt;br /&gt;
 $ tree tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 ├── asound.conf&lt;br /&gt;
 ├── audisp&lt;br /&gt;
 │   ├── audispd.conf&lt;br /&gt;
 │   └── plugins.d&lt;br /&gt;
 │       ├── af_unix.conf&lt;br /&gt;
 │       └── syslog.conf&lt;br /&gt;
 ├── audit&lt;br /&gt;
 │   ├── auditd.conf&lt;br /&gt;
 │   ├── audit.rules&lt;br /&gt;
 │   └── rules.d&lt;br /&gt;
 │       └── audit.rules&lt;br /&gt;
 ├── bluetooth&lt;br /&gt;
 │   ├── input.conf&lt;br /&gt;
 │   └── network.conf&lt;br /&gt;
 ├── build&lt;br /&gt;
 ├── busybox.links.nosuid&lt;br /&gt;
 ├── busybox.links.suid&lt;br /&gt;
 ├── ca-certificates&lt;br /&gt;
 │   └── update.d&lt;br /&gt;
 ├── ca-certificates.conf&lt;br /&gt;
 ├── dbus-1&lt;br /&gt;
 │   ├── session.conf&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   └── system.d&lt;br /&gt;
 │       ├── bluetooth.conf&lt;br /&gt;
 │       ├── connman.conf&lt;br /&gt;
 │       ├── dbus-wpa_supplicant.conf&lt;br /&gt;
 │       ├── org.freedesktop.hostname1.conf&lt;br /&gt;
 │       ├── org.freedesktop.locale1.conf&lt;br /&gt;
 │       ├── org.freedesktop.login1.conf&lt;br /&gt;
 │       ├── org.freedesktop.machine1.conf&lt;br /&gt;
 │       ├── org.freedesktop.systemd1.conf&lt;br /&gt;
 │       └── org.freedesktop.timedate1.conf&lt;br /&gt;
 ├── default&lt;br /&gt;
 │   ├── auditd&lt;br /&gt;
 │   ├── mountall&lt;br /&gt;
 │   ├── usbd&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   └── volatiles&lt;br /&gt;
 │       ├── 99_dbus&lt;br /&gt;
 │       ├── 99_pam&lt;br /&gt;
 │       ├── 99_sshd&lt;br /&gt;
 │       └── 99_wpa_supplicant&lt;br /&gt;
 ├── depmod.d&lt;br /&gt;
 ├── environment&lt;br /&gt;
 ├── filesystems&lt;br /&gt;
 ├── fstab&lt;br /&gt;
 ├── group&lt;br /&gt;
 ├── gshadow&lt;br /&gt;
 ├── host.conf&lt;br /&gt;
 ├── hostname&lt;br /&gt;
 ├── hosts&lt;br /&gt;
 ├── init.d&lt;br /&gt;
 │   └── smack&lt;br /&gt;
 ├── inputrc&lt;br /&gt;
 ├── issue&lt;br /&gt;
 ├── issue.net&lt;br /&gt;
 ├── ld.so.conf&lt;br /&gt;
 ├── libaudit.conf&lt;br /&gt;
 ├── libnl&lt;br /&gt;
 │   ├── classid&lt;br /&gt;
 │   └── pktloc&lt;br /&gt;
 ├── login.defs&lt;br /&gt;
 ├── machine-id&lt;br /&gt;
 ├── mke2fs.conf&lt;br /&gt;
 ├── modprobe.d&lt;br /&gt;
 ├── modules-load.d&lt;br /&gt;
 │   ├── iwlwifi.conf&lt;br /&gt;
 │   └── uio.conf&lt;br /&gt;
 ├── motd&lt;br /&gt;
 ├── mtab -&amp;gt; /proc/mounts&lt;br /&gt;
 ├── network&lt;br /&gt;
 │   ├── if-down.d&lt;br /&gt;
 │   ├── if-post-down.d&lt;br /&gt;
 │   │   └── wpa-supplicant -&amp;gt; ../if-pre-up.d/wpa-supplicant&lt;br /&gt;
 │   └── if-pre-up.d&lt;br /&gt;
 │       └── wpa-supplicant&lt;br /&gt;
 ├── nsswitch.conf&lt;br /&gt;
 ├── os-release&lt;br /&gt;
 ├── pam.d&lt;br /&gt;
 │   ├── chage&lt;br /&gt;
 │   ├── chfn&lt;br /&gt;
 │   ├── chgpasswd&lt;br /&gt;
 │   ├── chpasswd&lt;br /&gt;
 │   ├── chsh&lt;br /&gt;
 │   ├── common-account&lt;br /&gt;
 │   ├── common-auth&lt;br /&gt;
 │   ├── common-password&lt;br /&gt;
 │   ├── common-session&lt;br /&gt;
 │   ├── common-session-noninteractive&lt;br /&gt;
 │   ├── groupadd&lt;br /&gt;
 │   ├── groupdel&lt;br /&gt;
 │   ├── groupmems&lt;br /&gt;
 │   ├── groupmod&lt;br /&gt;
 │   ├── login&lt;br /&gt;
 │   ├── newusers&lt;br /&gt;
 │   ├── other&lt;br /&gt;
 │   ├── passwd&lt;br /&gt;
 │   ├── runuser&lt;br /&gt;
 │   ├── runuser-l&lt;br /&gt;
 │   ├── sshd&lt;br /&gt;
 │   ├── su&lt;br /&gt;
 │   ├── systemd-user&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   ├── userdel&lt;br /&gt;
 │   └── usermod&lt;br /&gt;
 ├── passwd&lt;br /&gt;
 ├── profile&lt;br /&gt;
 ├── protocols&lt;br /&gt;
 ├── request-key.conf&lt;br /&gt;
 ├── request-key.d&lt;br /&gt;
 ├── rpc&lt;br /&gt;
 ├── securetty&lt;br /&gt;
 ├── security&lt;br /&gt;
 │   ├── access.conf&lt;br /&gt;
 │   ├── group.conf&lt;br /&gt;
 │   ├── limits.conf&lt;br /&gt;
 │   ├── limits.d&lt;br /&gt;
 │   ├── namespace.conf&lt;br /&gt;
 │   ├── namespace.d&lt;br /&gt;
 │   ├── namespace.init&lt;br /&gt;
 │   ├── pam_env.conf&lt;br /&gt;
 │   └── time.conf&lt;br /&gt;
 ├── services&lt;br /&gt;
 ├── shadow&lt;br /&gt;
 ├── shells&lt;br /&gt;
 ├── skel&lt;br /&gt;
 ├── smack&lt;br /&gt;
 │   ├── accesses.d&lt;br /&gt;
 │   └── cipso.d&lt;br /&gt;
 ├── ssh&lt;br /&gt;
 │   ├── moduli&lt;br /&gt;
 │   ├── ssh_config&lt;br /&gt;
 │   ├── sshd_config&lt;br /&gt;
 │   └── sshd_config_readonly&lt;br /&gt;
 ├── ssl&lt;br /&gt;
 │   ├── certs&lt;br /&gt;
 │   │   ├── 02265526.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority_-_G2.crt&lt;br /&gt;
 │   │   ├── 024dc131.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Microsec_e-Szigno_Root_CA.crt&lt;br /&gt;
 │   │   ├── 03179a64.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_EV_Root_CA.crt&lt;br /&gt;
 ...&lt;br /&gt;
 │   │   └── XRamp_Global_CA_Root.pem -&amp;gt; /usr/share/ca-certificates/mozilla/XRamp_Global_CA_Root.crt&lt;br /&gt;
 │   ├── openssl.cnf&lt;br /&gt;
 │   └── private&lt;br /&gt;
 ├── sysctl.d&lt;br /&gt;
 ├── systemd&lt;br /&gt;
 │   ├── journald.conf&lt;br /&gt;
 │   ├── logind.conf&lt;br /&gt;
 │   ├── network&lt;br /&gt;
 │   ├── system&lt;br /&gt;
 │   │   ├── bluetooth.target.wants&lt;br /&gt;
 │   │   │   └── bluetooth.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── ctrl-alt-del.target -&amp;gt; ../../../lib/systemd/system/reboot.target&lt;br /&gt;
 │   │   ├── dbus-org.bluez.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── default.target -&amp;gt; /lib/systemd/system/multi-user.target&lt;br /&gt;
 │   │   ├── getty.target.wants&lt;br /&gt;
 │   │   │   └── getty@tty1.service -&amp;gt; ../../../../lib/systemd/system/getty@.service&lt;br /&gt;
 │   │   ├── local-fs.target.wants&lt;br /&gt;
 │   │   │   └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   │   ├── multi-user.target.wants&lt;br /&gt;
 │   │   │   ├── auditd.service -&amp;gt; /lib/systemd/system/auditd.service&lt;br /&gt;
 │   │   │   ├── connman.service -&amp;gt; /lib/systemd/system/connman.service&lt;br /&gt;
 │   │   │   ├── machines.target -&amp;gt; ../../../../lib/systemd/system/machines.target&lt;br /&gt;
 │   │   │   └── remote-fs.target -&amp;gt; ../../../../lib/systemd/system/remote-fs.target&lt;br /&gt;
 │   │   ├── network.target.wants&lt;br /&gt;
 │   │   │   ├── ip6tables.service -&amp;gt; /lib/systemd/system/ip6tables.service&lt;br /&gt;
 │   │   │   └── iptables.service -&amp;gt; /lib/systemd/system/iptables.service&lt;br /&gt;
 │   │   ├── sockets.target.wants&lt;br /&gt;
 │   │   │   └── sshd.socket -&amp;gt; /lib/systemd/system/sshd.socket&lt;br /&gt;
 │   │   ├── sysinit.target.wants&lt;br /&gt;
 │   │   │   ├── run-postinsts.service -&amp;gt; /lib/systemd/system/run-postinsts.service&lt;br /&gt;
 │   │   │   └── systemd-timesyncd.service -&amp;gt; ../../../../lib/systemd/system/systemd-timesyncd.service&lt;br /&gt;
 │   │   └── systemd-random-seed.service.wants&lt;br /&gt;
 │   │       └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   ├── timesyncd.conf&lt;br /&gt;
 │   ├── user&lt;br /&gt;
 │   └── user.conf&lt;br /&gt;
 ├── terminfo&lt;br /&gt;
 │   ├── a&lt;br /&gt;
 │   │   └── ansi&lt;br /&gt;
 │   ├── d&lt;br /&gt;
 │   │   └── dumb&lt;br /&gt;
 │   ├── l&lt;br /&gt;
 │   │   └── linux&lt;br /&gt;
 │   ├── r&lt;br /&gt;
 │   │   └── rxvt&lt;br /&gt;
 │   ├── s&lt;br /&gt;
 │   │   ├── screen&lt;br /&gt;
 │   │   ├── screen-256color&lt;br /&gt;
 │   │   └── sun&lt;br /&gt;
 │   ├── v&lt;br /&gt;
 │   │   ├── vt100&lt;br /&gt;
 │   │   ├── vt102&lt;br /&gt;
 │   │   ├── vt200&lt;br /&gt;
 │   │   ├── vt220&lt;br /&gt;
 │   │   └── vt52&lt;br /&gt;
 │   └── x&lt;br /&gt;
 │       ├── xterm -&amp;gt; xterm-color&lt;br /&gt;
 │       ├── xterm-256color&lt;br /&gt;
 │       ├── xterm-color&lt;br /&gt;
 │       └── xterm-xfree86&lt;br /&gt;
 ├── timestamp&lt;br /&gt;
 ├── tmpfiles.d&lt;br /&gt;
 │   ├── 00-create-volatile.conf&lt;br /&gt;
 │   ├── audit-volatile.conf&lt;br /&gt;
 │   └── connman_resolvconf.conf&lt;br /&gt;
 ├── udev&lt;br /&gt;
 │   ├── hwdb.d&lt;br /&gt;
 │   ├── rules.d&lt;br /&gt;
 │   │   ├── touchscreen.rules&lt;br /&gt;
 │   │   └── udev-smack-default.rules&lt;br /&gt;
 │   └── udev.conf&lt;br /&gt;
 ├── udhcpc.d&lt;br /&gt;
 │   └── 50default&lt;br /&gt;
 ├── version&lt;br /&gt;
 ├── wpa_supplicant.conf&lt;br /&gt;
 └── xdg&lt;br /&gt;
     └── systemd&lt;br /&gt;
         └── user -&amp;gt; ../../systemd/user&lt;br /&gt;
 &lt;br /&gt;
 62 directories, 500 files&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24533</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24533"/>
		<updated>2017-03-01T16:04:32Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Definition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc and /var are entirely empty when booting. No state persists across reboots, hence the name. A more relaxed version of this preserves config files in /etc, but still allows them to be removed at any time to do a factory reset.&lt;br /&gt;
&lt;br /&gt;
See http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Ideally, an OS component itself knows how to update the default configuration with small, independent configuration fragments in /etc, i.e. the actual configuration is constructed dynamically at runtime. systemd works like that.&lt;br /&gt;
&lt;br /&gt;
Less suitable, but still &amp;quot;stateless&amp;quot; is an OS component which reads a configuration file from /etc if it exists and falls back to some read-only default when it doesn&#039;t. This is less suitable when a real human creates the configuration in /etc because that person then has to ensure that updated system defaults get copied into the config file in /etc, but it may work when the file is created using some tool that can be re-run after an update.&lt;br /&gt;
&lt;br /&gt;
Finally, an OS component can be configured to ignore /etc entirely and just read its configuration files from a read-only location. It can then still be configured when building the OS, but not locally. Depending on the use-cases, such local modifications might not be needed.&lt;br /&gt;
&lt;br /&gt;
Some legacy components use /etc as location for files created at runtime. This is undesirable because it makes it less obvious for an admin which files in /etc may be modified, but if the files get recreated without data loss after a factory reset or system update, then using /etc is acceptable.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It supports STATELESS_RELOCATE_pn-&amp;lt;recipe&amp;gt; = &amp;quot;True&amp;quot; for compiling a recipe such that it uses a read-only sysconfig directory. STATELESS_MV is for cases where a recipe puts files into /etc in do_install that can also be elsewhere. STATELESS_RM is for items that can be removed. The same exists as STATELESS_RM/MV_ROOTFS for items created as part of package installation or rootfs functions.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. It does not yet enforce an empty /etc. Instead one has to run &amp;quot;bitbake refkit-image-common:do_rootfs&amp;quot; and check the content of /etc manually.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* use STATELESS_MV_pn-&amp;lt;recipe&amp;gt; to avoid repackaging other recipes&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_ETC_WHITELIST&lt;br /&gt;
** STATELESS_RM/MV sorted by pn-&amp;lt;reciped&amp;gt; (alphabetically)&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** special python functions&lt;br /&gt;
&lt;br /&gt;
refkit-image-common is stateless once /etc is empty after do_rootfs and the resulting image works without problems. Right now, it still has the following content:&lt;br /&gt;
&lt;br /&gt;
 $ tree tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 ├── asound.conf&lt;br /&gt;
 ├── audisp&lt;br /&gt;
 │   ├── audispd.conf&lt;br /&gt;
 │   └── plugins.d&lt;br /&gt;
 │       ├── af_unix.conf&lt;br /&gt;
 │       └── syslog.conf&lt;br /&gt;
 ├── audit&lt;br /&gt;
 │   ├── auditd.conf&lt;br /&gt;
 │   ├── audit.rules&lt;br /&gt;
 │   └── rules.d&lt;br /&gt;
 │       └── audit.rules&lt;br /&gt;
 ├── bluetooth&lt;br /&gt;
 │   ├── input.conf&lt;br /&gt;
 │   └── network.conf&lt;br /&gt;
 ├── build&lt;br /&gt;
 ├── busybox.links.nosuid&lt;br /&gt;
 ├── busybox.links.suid&lt;br /&gt;
 ├── ca-certificates&lt;br /&gt;
 │   └── update.d&lt;br /&gt;
 ├── ca-certificates.conf&lt;br /&gt;
 ├── dbus-1&lt;br /&gt;
 │   ├── session.conf&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   └── system.d&lt;br /&gt;
 │       ├── bluetooth.conf&lt;br /&gt;
 │       ├── connman.conf&lt;br /&gt;
 │       ├── dbus-wpa_supplicant.conf&lt;br /&gt;
 │       ├── org.freedesktop.hostname1.conf&lt;br /&gt;
 │       ├── org.freedesktop.locale1.conf&lt;br /&gt;
 │       ├── org.freedesktop.login1.conf&lt;br /&gt;
 │       ├── org.freedesktop.machine1.conf&lt;br /&gt;
 │       ├── org.freedesktop.systemd1.conf&lt;br /&gt;
 │       └── org.freedesktop.timedate1.conf&lt;br /&gt;
 ├── default&lt;br /&gt;
 │   ├── auditd&lt;br /&gt;
 │   ├── mountall&lt;br /&gt;
 │   ├── usbd&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   └── volatiles&lt;br /&gt;
 │       ├── 99_dbus&lt;br /&gt;
 │       ├── 99_pam&lt;br /&gt;
 │       ├── 99_sshd&lt;br /&gt;
 │       └── 99_wpa_supplicant&lt;br /&gt;
 ├── depmod.d&lt;br /&gt;
 ├── environment&lt;br /&gt;
 ├── filesystems&lt;br /&gt;
 ├── fstab&lt;br /&gt;
 ├── group&lt;br /&gt;
 ├── gshadow&lt;br /&gt;
 ├── host.conf&lt;br /&gt;
 ├── hostname&lt;br /&gt;
 ├── hosts&lt;br /&gt;
 ├── init.d&lt;br /&gt;
 │   └── smack&lt;br /&gt;
 ├── inputrc&lt;br /&gt;
 ├── issue&lt;br /&gt;
 ├── issue.net&lt;br /&gt;
 ├── ld.so.conf&lt;br /&gt;
 ├── libaudit.conf&lt;br /&gt;
 ├── libnl&lt;br /&gt;
 │   ├── classid&lt;br /&gt;
 │   └── pktloc&lt;br /&gt;
 ├── login.defs&lt;br /&gt;
 ├── machine-id&lt;br /&gt;
 ├── mke2fs.conf&lt;br /&gt;
 ├── modprobe.d&lt;br /&gt;
 ├── modules-load.d&lt;br /&gt;
 │   ├── iwlwifi.conf&lt;br /&gt;
 │   └── uio.conf&lt;br /&gt;
 ├── motd&lt;br /&gt;
 ├── mtab -&amp;gt; /proc/mounts&lt;br /&gt;
 ├── network&lt;br /&gt;
 │   ├── if-down.d&lt;br /&gt;
 │   ├── if-post-down.d&lt;br /&gt;
 │   │   └── wpa-supplicant -&amp;gt; ../if-pre-up.d/wpa-supplicant&lt;br /&gt;
 │   └── if-pre-up.d&lt;br /&gt;
 │       └── wpa-supplicant&lt;br /&gt;
 ├── nsswitch.conf&lt;br /&gt;
 ├── os-release&lt;br /&gt;
 ├── pam.d&lt;br /&gt;
 │   ├── chage&lt;br /&gt;
 │   ├── chfn&lt;br /&gt;
 │   ├── chgpasswd&lt;br /&gt;
 │   ├── chpasswd&lt;br /&gt;
 │   ├── chsh&lt;br /&gt;
 │   ├── common-account&lt;br /&gt;
 │   ├── common-auth&lt;br /&gt;
 │   ├── common-password&lt;br /&gt;
 │   ├── common-session&lt;br /&gt;
 │   ├── common-session-noninteractive&lt;br /&gt;
 │   ├── groupadd&lt;br /&gt;
 │   ├── groupdel&lt;br /&gt;
 │   ├── groupmems&lt;br /&gt;
 │   ├── groupmod&lt;br /&gt;
 │   ├── login&lt;br /&gt;
 │   ├── newusers&lt;br /&gt;
 │   ├── other&lt;br /&gt;
 │   ├── passwd&lt;br /&gt;
 │   ├── runuser&lt;br /&gt;
 │   ├── runuser-l&lt;br /&gt;
 │   ├── sshd&lt;br /&gt;
 │   ├── su&lt;br /&gt;
 │   ├── systemd-user&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   ├── userdel&lt;br /&gt;
 │   └── usermod&lt;br /&gt;
 ├── passwd&lt;br /&gt;
 ├── profile&lt;br /&gt;
 ├── protocols&lt;br /&gt;
 ├── request-key.conf&lt;br /&gt;
 ├── request-key.d&lt;br /&gt;
 ├── rpc&lt;br /&gt;
 ├── securetty&lt;br /&gt;
 ├── security&lt;br /&gt;
 │   ├── access.conf&lt;br /&gt;
 │   ├── group.conf&lt;br /&gt;
 │   ├── limits.conf&lt;br /&gt;
 │   ├── limits.d&lt;br /&gt;
 │   ├── namespace.conf&lt;br /&gt;
 │   ├── namespace.d&lt;br /&gt;
 │   ├── namespace.init&lt;br /&gt;
 │   ├── pam_env.conf&lt;br /&gt;
 │   └── time.conf&lt;br /&gt;
 ├── services&lt;br /&gt;
 ├── shadow&lt;br /&gt;
 ├── shells&lt;br /&gt;
 ├── skel&lt;br /&gt;
 ├── smack&lt;br /&gt;
 │   ├── accesses.d&lt;br /&gt;
 │   └── cipso.d&lt;br /&gt;
 ├── ssh&lt;br /&gt;
 │   ├── moduli&lt;br /&gt;
 │   ├── ssh_config&lt;br /&gt;
 │   ├── sshd_config&lt;br /&gt;
 │   └── sshd_config_readonly&lt;br /&gt;
 ├── ssl&lt;br /&gt;
 │   ├── certs&lt;br /&gt;
 │   │   ├── 02265526.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority_-_G2.crt&lt;br /&gt;
 │   │   ├── 024dc131.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Microsec_e-Szigno_Root_CA.crt&lt;br /&gt;
 │   │   ├── 03179a64.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_EV_Root_CA.crt&lt;br /&gt;
 ...&lt;br /&gt;
 │   │   └── XRamp_Global_CA_Root.pem -&amp;gt; /usr/share/ca-certificates/mozilla/XRamp_Global_CA_Root.crt&lt;br /&gt;
 │   ├── openssl.cnf&lt;br /&gt;
 │   └── private&lt;br /&gt;
 ├── sysctl.d&lt;br /&gt;
 ├── systemd&lt;br /&gt;
 │   ├── journald.conf&lt;br /&gt;
 │   ├── logind.conf&lt;br /&gt;
 │   ├── network&lt;br /&gt;
 │   ├── system&lt;br /&gt;
 │   │   ├── bluetooth.target.wants&lt;br /&gt;
 │   │   │   └── bluetooth.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── ctrl-alt-del.target -&amp;gt; ../../../lib/systemd/system/reboot.target&lt;br /&gt;
 │   │   ├── dbus-org.bluez.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── default.target -&amp;gt; /lib/systemd/system/multi-user.target&lt;br /&gt;
 │   │   ├── getty.target.wants&lt;br /&gt;
 │   │   │   └── getty@tty1.service -&amp;gt; ../../../../lib/systemd/system/getty@.service&lt;br /&gt;
 │   │   ├── local-fs.target.wants&lt;br /&gt;
 │   │   │   └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   │   ├── multi-user.target.wants&lt;br /&gt;
 │   │   │   ├── auditd.service -&amp;gt; /lib/systemd/system/auditd.service&lt;br /&gt;
 │   │   │   ├── connman.service -&amp;gt; /lib/systemd/system/connman.service&lt;br /&gt;
 │   │   │   ├── machines.target -&amp;gt; ../../../../lib/systemd/system/machines.target&lt;br /&gt;
 │   │   │   └── remote-fs.target -&amp;gt; ../../../../lib/systemd/system/remote-fs.target&lt;br /&gt;
 │   │   ├── network.target.wants&lt;br /&gt;
 │   │   │   ├── ip6tables.service -&amp;gt; /lib/systemd/system/ip6tables.service&lt;br /&gt;
 │   │   │   └── iptables.service -&amp;gt; /lib/systemd/system/iptables.service&lt;br /&gt;
 │   │   ├── sockets.target.wants&lt;br /&gt;
 │   │   │   └── sshd.socket -&amp;gt; /lib/systemd/system/sshd.socket&lt;br /&gt;
 │   │   ├── sysinit.target.wants&lt;br /&gt;
 │   │   │   ├── run-postinsts.service -&amp;gt; /lib/systemd/system/run-postinsts.service&lt;br /&gt;
 │   │   │   └── systemd-timesyncd.service -&amp;gt; ../../../../lib/systemd/system/systemd-timesyncd.service&lt;br /&gt;
 │   │   └── systemd-random-seed.service.wants&lt;br /&gt;
 │   │       └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   ├── timesyncd.conf&lt;br /&gt;
 │   ├── user&lt;br /&gt;
 │   └── user.conf&lt;br /&gt;
 ├── terminfo&lt;br /&gt;
 │   ├── a&lt;br /&gt;
 │   │   └── ansi&lt;br /&gt;
 │   ├── d&lt;br /&gt;
 │   │   └── dumb&lt;br /&gt;
 │   ├── l&lt;br /&gt;
 │   │   └── linux&lt;br /&gt;
 │   ├── r&lt;br /&gt;
 │   │   └── rxvt&lt;br /&gt;
 │   ├── s&lt;br /&gt;
 │   │   ├── screen&lt;br /&gt;
 │   │   ├── screen-256color&lt;br /&gt;
 │   │   └── sun&lt;br /&gt;
 │   ├── v&lt;br /&gt;
 │   │   ├── vt100&lt;br /&gt;
 │   │   ├── vt102&lt;br /&gt;
 │   │   ├── vt200&lt;br /&gt;
 │   │   ├── vt220&lt;br /&gt;
 │   │   └── vt52&lt;br /&gt;
 │   └── x&lt;br /&gt;
 │       ├── xterm -&amp;gt; xterm-color&lt;br /&gt;
 │       ├── xterm-256color&lt;br /&gt;
 │       ├── xterm-color&lt;br /&gt;
 │       └── xterm-xfree86&lt;br /&gt;
 ├── timestamp&lt;br /&gt;
 ├── tmpfiles.d&lt;br /&gt;
 │   ├── 00-create-volatile.conf&lt;br /&gt;
 │   ├── audit-volatile.conf&lt;br /&gt;
 │   └── connman_resolvconf.conf&lt;br /&gt;
 ├── udev&lt;br /&gt;
 │   ├── hwdb.d&lt;br /&gt;
 │   ├── rules.d&lt;br /&gt;
 │   │   ├── touchscreen.rules&lt;br /&gt;
 │   │   └── udev-smack-default.rules&lt;br /&gt;
 │   └── udev.conf&lt;br /&gt;
 ├── udhcpc.d&lt;br /&gt;
 │   └── 50default&lt;br /&gt;
 ├── version&lt;br /&gt;
 ├── wpa_supplicant.conf&lt;br /&gt;
 └── xdg&lt;br /&gt;
     └── systemd&lt;br /&gt;
         └── user -&amp;gt; ../../systemd/user&lt;br /&gt;
 &lt;br /&gt;
 62 directories, 500 files&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24532</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24532"/>
		<updated>2017-03-01T16:00:21Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Definition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc is reserved entirely for local, machine specific customizations. Default OS configuration must be stored elsewhere or be compiled into the binaries. In such a distro, the OS must be able to boot with an entirely empty /etc.&lt;br /&gt;
&lt;br /&gt;
See http://0pointer.net/blog/projects/stateless.html for more information.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Ideally, an OS component itself knows how to update the default configuration with small, independent configuration fragments in /etc, i.e. the actual configuration is constructed dynamically at runtime. systemd works like that.&lt;br /&gt;
&lt;br /&gt;
Less suitable, but still &amp;quot;stateless&amp;quot; is an OS component which reads a configuration file from /etc if it exists and falls back to some read-only default when it doesn&#039;t. This is less suitable when a real human creates the configuration in /etc because that person then has to ensure that updated system defaults get copied into the config file in /etc, but it may work when the file is created using some tool that can be re-run after an update.&lt;br /&gt;
&lt;br /&gt;
Finally, an OS component can be configured to ignore /etc entirely and just read its configuration files from a read-only location. It can then still be configured when building the OS, but not locally. Depending on the use-cases, such local modifications might not be needed.&lt;br /&gt;
&lt;br /&gt;
Some legacy components use /etc as location for files created at runtime. This is undesirable because it makes it less obvious for an admin which files in /etc may be modified, but if the files get recreated without data loss after a factory reset or system update, then using /etc is acceptable.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It supports STATELESS_RELOCATE_pn-&amp;lt;recipe&amp;gt; = &amp;quot;True&amp;quot; for compiling a recipe such that it uses a read-only sysconfig directory. STATELESS_MV is for cases where a recipe puts files into /etc in do_install that can also be elsewhere. STATELESS_RM is for items that can be removed. The same exists as STATELESS_RM/MV_ROOTFS for items created as part of package installation or rootfs functions.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. It does not yet enforce an empty /etc. Instead one has to run &amp;quot;bitbake refkit-image-common:do_rootfs&amp;quot; and check the content of /etc manually.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* use STATELESS_MV_pn-&amp;lt;recipe&amp;gt; to avoid repackaging other recipes&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_ETC_WHITELIST&lt;br /&gt;
** STATELESS_RM/MV sorted by pn-&amp;lt;reciped&amp;gt; (alphabetically)&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** special python functions&lt;br /&gt;
&lt;br /&gt;
refkit-image-common is stateless once /etc is empty after do_rootfs and the resulting image works without problems. Right now, it still has the following content:&lt;br /&gt;
&lt;br /&gt;
 $ tree tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 ├── asound.conf&lt;br /&gt;
 ├── audisp&lt;br /&gt;
 │   ├── audispd.conf&lt;br /&gt;
 │   └── plugins.d&lt;br /&gt;
 │       ├── af_unix.conf&lt;br /&gt;
 │       └── syslog.conf&lt;br /&gt;
 ├── audit&lt;br /&gt;
 │   ├── auditd.conf&lt;br /&gt;
 │   ├── audit.rules&lt;br /&gt;
 │   └── rules.d&lt;br /&gt;
 │       └── audit.rules&lt;br /&gt;
 ├── bluetooth&lt;br /&gt;
 │   ├── input.conf&lt;br /&gt;
 │   └── network.conf&lt;br /&gt;
 ├── build&lt;br /&gt;
 ├── busybox.links.nosuid&lt;br /&gt;
 ├── busybox.links.suid&lt;br /&gt;
 ├── ca-certificates&lt;br /&gt;
 │   └── update.d&lt;br /&gt;
 ├── ca-certificates.conf&lt;br /&gt;
 ├── dbus-1&lt;br /&gt;
 │   ├── session.conf&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   └── system.d&lt;br /&gt;
 │       ├── bluetooth.conf&lt;br /&gt;
 │       ├── connman.conf&lt;br /&gt;
 │       ├── dbus-wpa_supplicant.conf&lt;br /&gt;
 │       ├── org.freedesktop.hostname1.conf&lt;br /&gt;
 │       ├── org.freedesktop.locale1.conf&lt;br /&gt;
 │       ├── org.freedesktop.login1.conf&lt;br /&gt;
 │       ├── org.freedesktop.machine1.conf&lt;br /&gt;
 │       ├── org.freedesktop.systemd1.conf&lt;br /&gt;
 │       └── org.freedesktop.timedate1.conf&lt;br /&gt;
 ├── default&lt;br /&gt;
 │   ├── auditd&lt;br /&gt;
 │   ├── mountall&lt;br /&gt;
 │   ├── usbd&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   └── volatiles&lt;br /&gt;
 │       ├── 99_dbus&lt;br /&gt;
 │       ├── 99_pam&lt;br /&gt;
 │       ├── 99_sshd&lt;br /&gt;
 │       └── 99_wpa_supplicant&lt;br /&gt;
 ├── depmod.d&lt;br /&gt;
 ├── environment&lt;br /&gt;
 ├── filesystems&lt;br /&gt;
 ├── fstab&lt;br /&gt;
 ├── group&lt;br /&gt;
 ├── gshadow&lt;br /&gt;
 ├── host.conf&lt;br /&gt;
 ├── hostname&lt;br /&gt;
 ├── hosts&lt;br /&gt;
 ├── init.d&lt;br /&gt;
 │   └── smack&lt;br /&gt;
 ├── inputrc&lt;br /&gt;
 ├── issue&lt;br /&gt;
 ├── issue.net&lt;br /&gt;
 ├── ld.so.conf&lt;br /&gt;
 ├── libaudit.conf&lt;br /&gt;
 ├── libnl&lt;br /&gt;
 │   ├── classid&lt;br /&gt;
 │   └── pktloc&lt;br /&gt;
 ├── login.defs&lt;br /&gt;
 ├── machine-id&lt;br /&gt;
 ├── mke2fs.conf&lt;br /&gt;
 ├── modprobe.d&lt;br /&gt;
 ├── modules-load.d&lt;br /&gt;
 │   ├── iwlwifi.conf&lt;br /&gt;
 │   └── uio.conf&lt;br /&gt;
 ├── motd&lt;br /&gt;
 ├── mtab -&amp;gt; /proc/mounts&lt;br /&gt;
 ├── network&lt;br /&gt;
 │   ├── if-down.d&lt;br /&gt;
 │   ├── if-post-down.d&lt;br /&gt;
 │   │   └── wpa-supplicant -&amp;gt; ../if-pre-up.d/wpa-supplicant&lt;br /&gt;
 │   └── if-pre-up.d&lt;br /&gt;
 │       └── wpa-supplicant&lt;br /&gt;
 ├── nsswitch.conf&lt;br /&gt;
 ├── os-release&lt;br /&gt;
 ├── pam.d&lt;br /&gt;
 │   ├── chage&lt;br /&gt;
 │   ├── chfn&lt;br /&gt;
 │   ├── chgpasswd&lt;br /&gt;
 │   ├── chpasswd&lt;br /&gt;
 │   ├── chsh&lt;br /&gt;
 │   ├── common-account&lt;br /&gt;
 │   ├── common-auth&lt;br /&gt;
 │   ├── common-password&lt;br /&gt;
 │   ├── common-session&lt;br /&gt;
 │   ├── common-session-noninteractive&lt;br /&gt;
 │   ├── groupadd&lt;br /&gt;
 │   ├── groupdel&lt;br /&gt;
 │   ├── groupmems&lt;br /&gt;
 │   ├── groupmod&lt;br /&gt;
 │   ├── login&lt;br /&gt;
 │   ├── newusers&lt;br /&gt;
 │   ├── other&lt;br /&gt;
 │   ├── passwd&lt;br /&gt;
 │   ├── runuser&lt;br /&gt;
 │   ├── runuser-l&lt;br /&gt;
 │   ├── sshd&lt;br /&gt;
 │   ├── su&lt;br /&gt;
 │   ├── systemd-user&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   ├── userdel&lt;br /&gt;
 │   └── usermod&lt;br /&gt;
 ├── passwd&lt;br /&gt;
 ├── profile&lt;br /&gt;
 ├── protocols&lt;br /&gt;
 ├── request-key.conf&lt;br /&gt;
 ├── request-key.d&lt;br /&gt;
 ├── rpc&lt;br /&gt;
 ├── securetty&lt;br /&gt;
 ├── security&lt;br /&gt;
 │   ├── access.conf&lt;br /&gt;
 │   ├── group.conf&lt;br /&gt;
 │   ├── limits.conf&lt;br /&gt;
 │   ├── limits.d&lt;br /&gt;
 │   ├── namespace.conf&lt;br /&gt;
 │   ├── namespace.d&lt;br /&gt;
 │   ├── namespace.init&lt;br /&gt;
 │   ├── pam_env.conf&lt;br /&gt;
 │   └── time.conf&lt;br /&gt;
 ├── services&lt;br /&gt;
 ├── shadow&lt;br /&gt;
 ├── shells&lt;br /&gt;
 ├── skel&lt;br /&gt;
 ├── smack&lt;br /&gt;
 │   ├── accesses.d&lt;br /&gt;
 │   └── cipso.d&lt;br /&gt;
 ├── ssh&lt;br /&gt;
 │   ├── moduli&lt;br /&gt;
 │   ├── ssh_config&lt;br /&gt;
 │   ├── sshd_config&lt;br /&gt;
 │   └── sshd_config_readonly&lt;br /&gt;
 ├── ssl&lt;br /&gt;
 │   ├── certs&lt;br /&gt;
 │   │   ├── 02265526.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority_-_G2.crt&lt;br /&gt;
 │   │   ├── 024dc131.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Microsec_e-Szigno_Root_CA.crt&lt;br /&gt;
 │   │   ├── 03179a64.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_EV_Root_CA.crt&lt;br /&gt;
 ...&lt;br /&gt;
 │   │   └── XRamp_Global_CA_Root.pem -&amp;gt; /usr/share/ca-certificates/mozilla/XRamp_Global_CA_Root.crt&lt;br /&gt;
 │   ├── openssl.cnf&lt;br /&gt;
 │   └── private&lt;br /&gt;
 ├── sysctl.d&lt;br /&gt;
 ├── systemd&lt;br /&gt;
 │   ├── journald.conf&lt;br /&gt;
 │   ├── logind.conf&lt;br /&gt;
 │   ├── network&lt;br /&gt;
 │   ├── system&lt;br /&gt;
 │   │   ├── bluetooth.target.wants&lt;br /&gt;
 │   │   │   └── bluetooth.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── ctrl-alt-del.target -&amp;gt; ../../../lib/systemd/system/reboot.target&lt;br /&gt;
 │   │   ├── dbus-org.bluez.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── default.target -&amp;gt; /lib/systemd/system/multi-user.target&lt;br /&gt;
 │   │   ├── getty.target.wants&lt;br /&gt;
 │   │   │   └── getty@tty1.service -&amp;gt; ../../../../lib/systemd/system/getty@.service&lt;br /&gt;
 │   │   ├── local-fs.target.wants&lt;br /&gt;
 │   │   │   └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   │   ├── multi-user.target.wants&lt;br /&gt;
 │   │   │   ├── auditd.service -&amp;gt; /lib/systemd/system/auditd.service&lt;br /&gt;
 │   │   │   ├── connman.service -&amp;gt; /lib/systemd/system/connman.service&lt;br /&gt;
 │   │   │   ├── machines.target -&amp;gt; ../../../../lib/systemd/system/machines.target&lt;br /&gt;
 │   │   │   └── remote-fs.target -&amp;gt; ../../../../lib/systemd/system/remote-fs.target&lt;br /&gt;
 │   │   ├── network.target.wants&lt;br /&gt;
 │   │   │   ├── ip6tables.service -&amp;gt; /lib/systemd/system/ip6tables.service&lt;br /&gt;
 │   │   │   └── iptables.service -&amp;gt; /lib/systemd/system/iptables.service&lt;br /&gt;
 │   │   ├── sockets.target.wants&lt;br /&gt;
 │   │   │   └── sshd.socket -&amp;gt; /lib/systemd/system/sshd.socket&lt;br /&gt;
 │   │   ├── sysinit.target.wants&lt;br /&gt;
 │   │   │   ├── run-postinsts.service -&amp;gt; /lib/systemd/system/run-postinsts.service&lt;br /&gt;
 │   │   │   └── systemd-timesyncd.service -&amp;gt; ../../../../lib/systemd/system/systemd-timesyncd.service&lt;br /&gt;
 │   │   └── systemd-random-seed.service.wants&lt;br /&gt;
 │   │       └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   ├── timesyncd.conf&lt;br /&gt;
 │   ├── user&lt;br /&gt;
 │   └── user.conf&lt;br /&gt;
 ├── terminfo&lt;br /&gt;
 │   ├── a&lt;br /&gt;
 │   │   └── ansi&lt;br /&gt;
 │   ├── d&lt;br /&gt;
 │   │   └── dumb&lt;br /&gt;
 │   ├── l&lt;br /&gt;
 │   │   └── linux&lt;br /&gt;
 │   ├── r&lt;br /&gt;
 │   │   └── rxvt&lt;br /&gt;
 │   ├── s&lt;br /&gt;
 │   │   ├── screen&lt;br /&gt;
 │   │   ├── screen-256color&lt;br /&gt;
 │   │   └── sun&lt;br /&gt;
 │   ├── v&lt;br /&gt;
 │   │   ├── vt100&lt;br /&gt;
 │   │   ├── vt102&lt;br /&gt;
 │   │   ├── vt200&lt;br /&gt;
 │   │   ├── vt220&lt;br /&gt;
 │   │   └── vt52&lt;br /&gt;
 │   └── x&lt;br /&gt;
 │       ├── xterm -&amp;gt; xterm-color&lt;br /&gt;
 │       ├── xterm-256color&lt;br /&gt;
 │       ├── xterm-color&lt;br /&gt;
 │       └── xterm-xfree86&lt;br /&gt;
 ├── timestamp&lt;br /&gt;
 ├── tmpfiles.d&lt;br /&gt;
 │   ├── 00-create-volatile.conf&lt;br /&gt;
 │   ├── audit-volatile.conf&lt;br /&gt;
 │   └── connman_resolvconf.conf&lt;br /&gt;
 ├── udev&lt;br /&gt;
 │   ├── hwdb.d&lt;br /&gt;
 │   ├── rules.d&lt;br /&gt;
 │   │   ├── touchscreen.rules&lt;br /&gt;
 │   │   └── udev-smack-default.rules&lt;br /&gt;
 │   └── udev.conf&lt;br /&gt;
 ├── udhcpc.d&lt;br /&gt;
 │   └── 50default&lt;br /&gt;
 ├── version&lt;br /&gt;
 ├── wpa_supplicant.conf&lt;br /&gt;
 └── xdg&lt;br /&gt;
     └── systemd&lt;br /&gt;
         └── user -&amp;gt; ../../systemd/user&lt;br /&gt;
 &lt;br /&gt;
 62 directories, 500 files&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24531</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24531"/>
		<updated>2017-03-01T15:59:41Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Status and goals for &amp;quot;stateless&amp;quot; in Yocto */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc is reserved entirely for local, machine specific customizations. Default OS configuration must be stored elsewhere or be compiled into the binaries. In such a distro, the OS must be able to boot with an entirely empty /etc.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Ideally, an OS component itself knows how to update the default configuration with small, independent configuration fragments in /etc, i.e. the actual configuration is constructed dynamically at runtime. systemd works like that.&lt;br /&gt;
&lt;br /&gt;
Less suitable, but still &amp;quot;stateless&amp;quot; is an OS component which reads a configuration file from /etc if it exists and falls back to some read-only default when it doesn&#039;t. This is less suitable when a real human creates the configuration in /etc because that person then has to ensure that updated system defaults get copied into the config file in /etc, but it may work when the file is created using some tool that can be re-run after an update.&lt;br /&gt;
&lt;br /&gt;
Finally, an OS component can be configured to ignore /etc entirely and just read its configuration files from a read-only location. It can then still be configured when building the OS, but not locally. Depending on the use-cases, such local modifications might not be needed.&lt;br /&gt;
&lt;br /&gt;
Some legacy components use /etc as location for files created at runtime. This is undesirable because it makes it less obvious for an admin which files in /etc may be modified, but if the files get recreated without data loss after a factory reset or system update, then using /etc is acceptable.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that. Related Bugzilla entries are https://bugzilla.yoctoproject.org/show_bug.cgi?id=9527, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1593&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It supports STATELESS_RELOCATE_pn-&amp;lt;recipe&amp;gt; = &amp;quot;True&amp;quot; for compiling a recipe such that it uses a read-only sysconfig directory. STATELESS_MV is for cases where a recipe puts files into /etc in do_install that can also be elsewhere. STATELESS_RM is for items that can be removed. The same exists as STATELESS_RM/MV_ROOTFS for items created as part of package installation or rootfs functions.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. It does not yet enforce an empty /etc. Instead one has to run &amp;quot;bitbake refkit-image-common:do_rootfs&amp;quot; and check the content of /etc manually.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* use STATELESS_MV_pn-&amp;lt;recipe&amp;gt; to avoid repackaging other recipes&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_ETC_WHITELIST&lt;br /&gt;
** STATELESS_RM/MV sorted by pn-&amp;lt;reciped&amp;gt; (alphabetically)&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** special python functions&lt;br /&gt;
&lt;br /&gt;
refkit-image-common is stateless once /etc is empty after do_rootfs and the resulting image works without problems. Right now, it still has the following content:&lt;br /&gt;
&lt;br /&gt;
 $ tree tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 ├── asound.conf&lt;br /&gt;
 ├── audisp&lt;br /&gt;
 │   ├── audispd.conf&lt;br /&gt;
 │   └── plugins.d&lt;br /&gt;
 │       ├── af_unix.conf&lt;br /&gt;
 │       └── syslog.conf&lt;br /&gt;
 ├── audit&lt;br /&gt;
 │   ├── auditd.conf&lt;br /&gt;
 │   ├── audit.rules&lt;br /&gt;
 │   └── rules.d&lt;br /&gt;
 │       └── audit.rules&lt;br /&gt;
 ├── bluetooth&lt;br /&gt;
 │   ├── input.conf&lt;br /&gt;
 │   └── network.conf&lt;br /&gt;
 ├── build&lt;br /&gt;
 ├── busybox.links.nosuid&lt;br /&gt;
 ├── busybox.links.suid&lt;br /&gt;
 ├── ca-certificates&lt;br /&gt;
 │   └── update.d&lt;br /&gt;
 ├── ca-certificates.conf&lt;br /&gt;
 ├── dbus-1&lt;br /&gt;
 │   ├── session.conf&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   └── system.d&lt;br /&gt;
 │       ├── bluetooth.conf&lt;br /&gt;
 │       ├── connman.conf&lt;br /&gt;
 │       ├── dbus-wpa_supplicant.conf&lt;br /&gt;
 │       ├── org.freedesktop.hostname1.conf&lt;br /&gt;
 │       ├── org.freedesktop.locale1.conf&lt;br /&gt;
 │       ├── org.freedesktop.login1.conf&lt;br /&gt;
 │       ├── org.freedesktop.machine1.conf&lt;br /&gt;
 │       ├── org.freedesktop.systemd1.conf&lt;br /&gt;
 │       └── org.freedesktop.timedate1.conf&lt;br /&gt;
 ├── default&lt;br /&gt;
 │   ├── auditd&lt;br /&gt;
 │   ├── mountall&lt;br /&gt;
 │   ├── usbd&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   └── volatiles&lt;br /&gt;
 │       ├── 99_dbus&lt;br /&gt;
 │       ├── 99_pam&lt;br /&gt;
 │       ├── 99_sshd&lt;br /&gt;
 │       └── 99_wpa_supplicant&lt;br /&gt;
 ├── depmod.d&lt;br /&gt;
 ├── environment&lt;br /&gt;
 ├── filesystems&lt;br /&gt;
 ├── fstab&lt;br /&gt;
 ├── group&lt;br /&gt;
 ├── gshadow&lt;br /&gt;
 ├── host.conf&lt;br /&gt;
 ├── hostname&lt;br /&gt;
 ├── hosts&lt;br /&gt;
 ├── init.d&lt;br /&gt;
 │   └── smack&lt;br /&gt;
 ├── inputrc&lt;br /&gt;
 ├── issue&lt;br /&gt;
 ├── issue.net&lt;br /&gt;
 ├── ld.so.conf&lt;br /&gt;
 ├── libaudit.conf&lt;br /&gt;
 ├── libnl&lt;br /&gt;
 │   ├── classid&lt;br /&gt;
 │   └── pktloc&lt;br /&gt;
 ├── login.defs&lt;br /&gt;
 ├── machine-id&lt;br /&gt;
 ├── mke2fs.conf&lt;br /&gt;
 ├── modprobe.d&lt;br /&gt;
 ├── modules-load.d&lt;br /&gt;
 │   ├── iwlwifi.conf&lt;br /&gt;
 │   └── uio.conf&lt;br /&gt;
 ├── motd&lt;br /&gt;
 ├── mtab -&amp;gt; /proc/mounts&lt;br /&gt;
 ├── network&lt;br /&gt;
 │   ├── if-down.d&lt;br /&gt;
 │   ├── if-post-down.d&lt;br /&gt;
 │   │   └── wpa-supplicant -&amp;gt; ../if-pre-up.d/wpa-supplicant&lt;br /&gt;
 │   └── if-pre-up.d&lt;br /&gt;
 │       └── wpa-supplicant&lt;br /&gt;
 ├── nsswitch.conf&lt;br /&gt;
 ├── os-release&lt;br /&gt;
 ├── pam.d&lt;br /&gt;
 │   ├── chage&lt;br /&gt;
 │   ├── chfn&lt;br /&gt;
 │   ├── chgpasswd&lt;br /&gt;
 │   ├── chpasswd&lt;br /&gt;
 │   ├── chsh&lt;br /&gt;
 │   ├── common-account&lt;br /&gt;
 │   ├── common-auth&lt;br /&gt;
 │   ├── common-password&lt;br /&gt;
 │   ├── common-session&lt;br /&gt;
 │   ├── common-session-noninteractive&lt;br /&gt;
 │   ├── groupadd&lt;br /&gt;
 │   ├── groupdel&lt;br /&gt;
 │   ├── groupmems&lt;br /&gt;
 │   ├── groupmod&lt;br /&gt;
 │   ├── login&lt;br /&gt;
 │   ├── newusers&lt;br /&gt;
 │   ├── other&lt;br /&gt;
 │   ├── passwd&lt;br /&gt;
 │   ├── runuser&lt;br /&gt;
 │   ├── runuser-l&lt;br /&gt;
 │   ├── sshd&lt;br /&gt;
 │   ├── su&lt;br /&gt;
 │   ├── systemd-user&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   ├── userdel&lt;br /&gt;
 │   └── usermod&lt;br /&gt;
 ├── passwd&lt;br /&gt;
 ├── profile&lt;br /&gt;
 ├── protocols&lt;br /&gt;
 ├── request-key.conf&lt;br /&gt;
 ├── request-key.d&lt;br /&gt;
 ├── rpc&lt;br /&gt;
 ├── securetty&lt;br /&gt;
 ├── security&lt;br /&gt;
 │   ├── access.conf&lt;br /&gt;
 │   ├── group.conf&lt;br /&gt;
 │   ├── limits.conf&lt;br /&gt;
 │   ├── limits.d&lt;br /&gt;
 │   ├── namespace.conf&lt;br /&gt;
 │   ├── namespace.d&lt;br /&gt;
 │   ├── namespace.init&lt;br /&gt;
 │   ├── pam_env.conf&lt;br /&gt;
 │   └── time.conf&lt;br /&gt;
 ├── services&lt;br /&gt;
 ├── shadow&lt;br /&gt;
 ├── shells&lt;br /&gt;
 ├── skel&lt;br /&gt;
 ├── smack&lt;br /&gt;
 │   ├── accesses.d&lt;br /&gt;
 │   └── cipso.d&lt;br /&gt;
 ├── ssh&lt;br /&gt;
 │   ├── moduli&lt;br /&gt;
 │   ├── ssh_config&lt;br /&gt;
 │   ├── sshd_config&lt;br /&gt;
 │   └── sshd_config_readonly&lt;br /&gt;
 ├── ssl&lt;br /&gt;
 │   ├── certs&lt;br /&gt;
 │   │   ├── 02265526.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority_-_G2.crt&lt;br /&gt;
 │   │   ├── 024dc131.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Microsec_e-Szigno_Root_CA.crt&lt;br /&gt;
 │   │   ├── 03179a64.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_EV_Root_CA.crt&lt;br /&gt;
 ...&lt;br /&gt;
 │   │   └── XRamp_Global_CA_Root.pem -&amp;gt; /usr/share/ca-certificates/mozilla/XRamp_Global_CA_Root.crt&lt;br /&gt;
 │   ├── openssl.cnf&lt;br /&gt;
 │   └── private&lt;br /&gt;
 ├── sysctl.d&lt;br /&gt;
 ├── systemd&lt;br /&gt;
 │   ├── journald.conf&lt;br /&gt;
 │   ├── logind.conf&lt;br /&gt;
 │   ├── network&lt;br /&gt;
 │   ├── system&lt;br /&gt;
 │   │   ├── bluetooth.target.wants&lt;br /&gt;
 │   │   │   └── bluetooth.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── ctrl-alt-del.target -&amp;gt; ../../../lib/systemd/system/reboot.target&lt;br /&gt;
 │   │   ├── dbus-org.bluez.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── default.target -&amp;gt; /lib/systemd/system/multi-user.target&lt;br /&gt;
 │   │   ├── getty.target.wants&lt;br /&gt;
 │   │   │   └── getty@tty1.service -&amp;gt; ../../../../lib/systemd/system/getty@.service&lt;br /&gt;
 │   │   ├── local-fs.target.wants&lt;br /&gt;
 │   │   │   └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   │   ├── multi-user.target.wants&lt;br /&gt;
 │   │   │   ├── auditd.service -&amp;gt; /lib/systemd/system/auditd.service&lt;br /&gt;
 │   │   │   ├── connman.service -&amp;gt; /lib/systemd/system/connman.service&lt;br /&gt;
 │   │   │   ├── machines.target -&amp;gt; ../../../../lib/systemd/system/machines.target&lt;br /&gt;
 │   │   │   └── remote-fs.target -&amp;gt; ../../../../lib/systemd/system/remote-fs.target&lt;br /&gt;
 │   │   ├── network.target.wants&lt;br /&gt;
 │   │   │   ├── ip6tables.service -&amp;gt; /lib/systemd/system/ip6tables.service&lt;br /&gt;
 │   │   │   └── iptables.service -&amp;gt; /lib/systemd/system/iptables.service&lt;br /&gt;
 │   │   ├── sockets.target.wants&lt;br /&gt;
 │   │   │   └── sshd.socket -&amp;gt; /lib/systemd/system/sshd.socket&lt;br /&gt;
 │   │   ├── sysinit.target.wants&lt;br /&gt;
 │   │   │   ├── run-postinsts.service -&amp;gt; /lib/systemd/system/run-postinsts.service&lt;br /&gt;
 │   │   │   └── systemd-timesyncd.service -&amp;gt; ../../../../lib/systemd/system/systemd-timesyncd.service&lt;br /&gt;
 │   │   └── systemd-random-seed.service.wants&lt;br /&gt;
 │   │       └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   ├── timesyncd.conf&lt;br /&gt;
 │   ├── user&lt;br /&gt;
 │   └── user.conf&lt;br /&gt;
 ├── terminfo&lt;br /&gt;
 │   ├── a&lt;br /&gt;
 │   │   └── ansi&lt;br /&gt;
 │   ├── d&lt;br /&gt;
 │   │   └── dumb&lt;br /&gt;
 │   ├── l&lt;br /&gt;
 │   │   └── linux&lt;br /&gt;
 │   ├── r&lt;br /&gt;
 │   │   └── rxvt&lt;br /&gt;
 │   ├── s&lt;br /&gt;
 │   │   ├── screen&lt;br /&gt;
 │   │   ├── screen-256color&lt;br /&gt;
 │   │   └── sun&lt;br /&gt;
 │   ├── v&lt;br /&gt;
 │   │   ├── vt100&lt;br /&gt;
 │   │   ├── vt102&lt;br /&gt;
 │   │   ├── vt200&lt;br /&gt;
 │   │   ├── vt220&lt;br /&gt;
 │   │   └── vt52&lt;br /&gt;
 │   └── x&lt;br /&gt;
 │       ├── xterm -&amp;gt; xterm-color&lt;br /&gt;
 │       ├── xterm-256color&lt;br /&gt;
 │       ├── xterm-color&lt;br /&gt;
 │       └── xterm-xfree86&lt;br /&gt;
 ├── timestamp&lt;br /&gt;
 ├── tmpfiles.d&lt;br /&gt;
 │   ├── 00-create-volatile.conf&lt;br /&gt;
 │   ├── audit-volatile.conf&lt;br /&gt;
 │   └── connman_resolvconf.conf&lt;br /&gt;
 ├── udev&lt;br /&gt;
 │   ├── hwdb.d&lt;br /&gt;
 │   ├── rules.d&lt;br /&gt;
 │   │   ├── touchscreen.rules&lt;br /&gt;
 │   │   └── udev-smack-default.rules&lt;br /&gt;
 │   └── udev.conf&lt;br /&gt;
 ├── udhcpc.d&lt;br /&gt;
 │   └── 50default&lt;br /&gt;
 ├── version&lt;br /&gt;
 ├── wpa_supplicant.conf&lt;br /&gt;
 └── xdg&lt;br /&gt;
     └── systemd&lt;br /&gt;
         └── user -&amp;gt; ../../systemd/user&lt;br /&gt;
 &lt;br /&gt;
 62 directories, 500 files&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24530</id>
		<title>Stateless</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stateless&amp;diff=24530"/>
		<updated>2017-03-01T15:54:51Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: Created page with &amp;quot;== Definition ==  A &amp;quot;stateless&amp;quot; distro is one where /etc is reserved entirely for local, machine specific customizations. Default OS configuration must be stored elsewhere or ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Definition ==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;stateless&amp;quot; distro is one where /etc is reserved entirely for local, machine specific customizations. Default OS configuration must be stored elsewhere or be compiled into the binaries. In such a distro, the OS must be able to boot with an entirely empty /etc.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
In a stateless image, factory reset can be achieved by wiping out the content of /etc.&lt;br /&gt;
&lt;br /&gt;
A system update can be done without touching local configuration files.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Configuration files in /etc may become incompatible with an updated OS. That is a problem that needs to be solved by the person or tool which created these incompatible local configuration files. It can be mitigated a bit by keeping the configuration API of OS components stable across updates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Ideally, an OS component itself knows how to update the default configuration with small, independent configuration fragments in /etc, i.e. the actual configuration is constructed dynamically at runtime. systemd works like that.&lt;br /&gt;
&lt;br /&gt;
Less suitable, but still &amp;quot;stateless&amp;quot; is an OS component which reads a configuration file from /etc if it exists and falls back to some read-only default when it doesn&#039;t. This is less suitable when a real human creates the configuration in /etc because that person then has to ensure that updated system defaults get copied into the config file in /etc, but it may work when the file is created using some tool that can be re-run after an update.&lt;br /&gt;
&lt;br /&gt;
Finally, an OS component can be configured to ignore /etc entirely and just read its configuration files from a read-only location. It can then still be configured when building the OS, but not locally. Depending on the use-cases, such local modifications might not be needed.&lt;br /&gt;
&lt;br /&gt;
Some legacy components use /etc as location for files created at runtime. This is undesirable because it makes it less obvious for an admin which files in /etc may be modified, but if the files get recreated without data loss after a factory reset or system update, then using /etc is acceptable.&lt;br /&gt;
&lt;br /&gt;
== Status and goals for &amp;quot;stateless&amp;quot; in Yocto ==&lt;br /&gt;
&lt;br /&gt;
Stateless support does not exit in current Yocto. Work is under way to improve that.&lt;br /&gt;
&lt;br /&gt;
It is not realistic to make all components in Yocto stateless. This will only work for some selected components and thus only those images using those components. The initial goal is to make the &amp;quot;refkit-image-common&amp;quot; from the IoT OS Reference Kit stateless. In that image, at least the following local configuration changes are meant to work:&lt;br /&gt;
* adding users and groups with user/groupadd&lt;br /&gt;
* replacing the default motd&lt;br /&gt;
&lt;br /&gt;
The current prototype is hosted in https://github.com/pohly/intel-iot-refkit/tree/stateless&lt;br /&gt;
&lt;br /&gt;
The generic mechanism is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/classes/stateless.bbclass. It supports STATELESS_RELOCATE_pn-&amp;lt;recipe&amp;gt; = &amp;quot;True&amp;quot; for compiling a recipe such that it uses a read-only sysconfig directory. STATELESS_MV is for cases where a recipe puts files into /etc in do_install that can also be elsewhere. STATELESS_RM is for items that can be removed. The same exists as STATELESS_RM/MV_ROOTFS for items created as part of package installation or rootfs functions.&lt;br /&gt;
&lt;br /&gt;
The actual configuration used for Refkit is https://github.com/pohly/intel-iot-refkit/blob/stateless/meta-refkit/conf/distro/include/stateless.inc. It does not yet enforce an empty /etc. Instead one has to run &amp;quot;bitbake refkit-image-common:do_rootfs&amp;quot; and check the content of /etc manually.&lt;br /&gt;
&lt;br /&gt;
Some BKMs for gradually moving content out of /etc:&lt;br /&gt;
&lt;br /&gt;
* use STATELESS_MV_pn-&amp;lt;recipe&amp;gt; to avoid repackaging other recipes&lt;br /&gt;
* precede each entry with a detailed technical explanation of why the change is working&lt;br /&gt;
* sort entries in the file as follows:&lt;br /&gt;
** header&lt;br /&gt;
** STATELESS_ETC_WHITELIST&lt;br /&gt;
** STATELESS_RM/MV sorted by pn-&amp;lt;reciped&amp;gt; (alphabetically)&lt;br /&gt;
** STATELESS_RM_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** STATELESS_MV_ROOTFS (no particular order, add at the bottom)&lt;br /&gt;
** special python functions&lt;br /&gt;
&lt;br /&gt;
refkit-image-common is stateless once /etc is empty after do_rootfs and the resulting image works without problems. Right now, it still has the following content:&lt;br /&gt;
&lt;br /&gt;
 $ tree tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 tmp-glibc/work/intel_corei7_64-refkit-linux/refkit-image-common/1.0-r0/rootfs/etc/&lt;br /&gt;
 ├── asound.conf&lt;br /&gt;
 ├── audisp&lt;br /&gt;
 │   ├── audispd.conf&lt;br /&gt;
 │   └── plugins.d&lt;br /&gt;
 │       ├── af_unix.conf&lt;br /&gt;
 │       └── syslog.conf&lt;br /&gt;
 ├── audit&lt;br /&gt;
 │   ├── auditd.conf&lt;br /&gt;
 │   ├── audit.rules&lt;br /&gt;
 │   └── rules.d&lt;br /&gt;
 │       └── audit.rules&lt;br /&gt;
 ├── bluetooth&lt;br /&gt;
 │   ├── input.conf&lt;br /&gt;
 │   └── network.conf&lt;br /&gt;
 ├── build&lt;br /&gt;
 ├── busybox.links.nosuid&lt;br /&gt;
 ├── busybox.links.suid&lt;br /&gt;
 ├── ca-certificates&lt;br /&gt;
 │   └── update.d&lt;br /&gt;
 ├── ca-certificates.conf&lt;br /&gt;
 ├── dbus-1&lt;br /&gt;
 │   ├── session.conf&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   └── system.d&lt;br /&gt;
 │       ├── bluetooth.conf&lt;br /&gt;
 │       ├── connman.conf&lt;br /&gt;
 │       ├── dbus-wpa_supplicant.conf&lt;br /&gt;
 │       ├── org.freedesktop.hostname1.conf&lt;br /&gt;
 │       ├── org.freedesktop.locale1.conf&lt;br /&gt;
 │       ├── org.freedesktop.login1.conf&lt;br /&gt;
 │       ├── org.freedesktop.machine1.conf&lt;br /&gt;
 │       ├── org.freedesktop.systemd1.conf&lt;br /&gt;
 │       └── org.freedesktop.timedate1.conf&lt;br /&gt;
 ├── default&lt;br /&gt;
 │   ├── auditd&lt;br /&gt;
 │   ├── mountall&lt;br /&gt;
 │   ├── usbd&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   └── volatiles&lt;br /&gt;
 │       ├── 99_dbus&lt;br /&gt;
 │       ├── 99_pam&lt;br /&gt;
 │       ├── 99_sshd&lt;br /&gt;
 │       └── 99_wpa_supplicant&lt;br /&gt;
 ├── depmod.d&lt;br /&gt;
 ├── environment&lt;br /&gt;
 ├── filesystems&lt;br /&gt;
 ├── fstab&lt;br /&gt;
 ├── group&lt;br /&gt;
 ├── gshadow&lt;br /&gt;
 ├── host.conf&lt;br /&gt;
 ├── hostname&lt;br /&gt;
 ├── hosts&lt;br /&gt;
 ├── init.d&lt;br /&gt;
 │   └── smack&lt;br /&gt;
 ├── inputrc&lt;br /&gt;
 ├── issue&lt;br /&gt;
 ├── issue.net&lt;br /&gt;
 ├── ld.so.conf&lt;br /&gt;
 ├── libaudit.conf&lt;br /&gt;
 ├── libnl&lt;br /&gt;
 │   ├── classid&lt;br /&gt;
 │   └── pktloc&lt;br /&gt;
 ├── login.defs&lt;br /&gt;
 ├── machine-id&lt;br /&gt;
 ├── mke2fs.conf&lt;br /&gt;
 ├── modprobe.d&lt;br /&gt;
 ├── modules-load.d&lt;br /&gt;
 │   ├── iwlwifi.conf&lt;br /&gt;
 │   └── uio.conf&lt;br /&gt;
 ├── motd&lt;br /&gt;
 ├── mtab -&amp;gt; /proc/mounts&lt;br /&gt;
 ├── network&lt;br /&gt;
 │   ├── if-down.d&lt;br /&gt;
 │   ├── if-post-down.d&lt;br /&gt;
 │   │   └── wpa-supplicant -&amp;gt; ../if-pre-up.d/wpa-supplicant&lt;br /&gt;
 │   └── if-pre-up.d&lt;br /&gt;
 │       └── wpa-supplicant&lt;br /&gt;
 ├── nsswitch.conf&lt;br /&gt;
 ├── os-release&lt;br /&gt;
 ├── pam.d&lt;br /&gt;
 │   ├── chage&lt;br /&gt;
 │   ├── chfn&lt;br /&gt;
 │   ├── chgpasswd&lt;br /&gt;
 │   ├── chpasswd&lt;br /&gt;
 │   ├── chsh&lt;br /&gt;
 │   ├── common-account&lt;br /&gt;
 │   ├── common-auth&lt;br /&gt;
 │   ├── common-password&lt;br /&gt;
 │   ├── common-session&lt;br /&gt;
 │   ├── common-session-noninteractive&lt;br /&gt;
 │   ├── groupadd&lt;br /&gt;
 │   ├── groupdel&lt;br /&gt;
 │   ├── groupmems&lt;br /&gt;
 │   ├── groupmod&lt;br /&gt;
 │   ├── login&lt;br /&gt;
 │   ├── newusers&lt;br /&gt;
 │   ├── other&lt;br /&gt;
 │   ├── passwd&lt;br /&gt;
 │   ├── runuser&lt;br /&gt;
 │   ├── runuser-l&lt;br /&gt;
 │   ├── sshd&lt;br /&gt;
 │   ├── su&lt;br /&gt;
 │   ├── systemd-user&lt;br /&gt;
 │   ├── useradd&lt;br /&gt;
 │   ├── userdel&lt;br /&gt;
 │   └── usermod&lt;br /&gt;
 ├── passwd&lt;br /&gt;
 ├── profile&lt;br /&gt;
 ├── protocols&lt;br /&gt;
 ├── request-key.conf&lt;br /&gt;
 ├── request-key.d&lt;br /&gt;
 ├── rpc&lt;br /&gt;
 ├── securetty&lt;br /&gt;
 ├── security&lt;br /&gt;
 │   ├── access.conf&lt;br /&gt;
 │   ├── group.conf&lt;br /&gt;
 │   ├── limits.conf&lt;br /&gt;
 │   ├── limits.d&lt;br /&gt;
 │   ├── namespace.conf&lt;br /&gt;
 │   ├── namespace.d&lt;br /&gt;
 │   ├── namespace.init&lt;br /&gt;
 │   ├── pam_env.conf&lt;br /&gt;
 │   └── time.conf&lt;br /&gt;
 ├── services&lt;br /&gt;
 ├── shadow&lt;br /&gt;
 ├── shells&lt;br /&gt;
 ├── skel&lt;br /&gt;
 ├── smack&lt;br /&gt;
 │   ├── accesses.d&lt;br /&gt;
 │   └── cipso.d&lt;br /&gt;
 ├── ssh&lt;br /&gt;
 │   ├── moduli&lt;br /&gt;
 │   ├── ssh_config&lt;br /&gt;
 │   ├── sshd_config&lt;br /&gt;
 │   └── sshd_config_readonly&lt;br /&gt;
 ├── ssl&lt;br /&gt;
 │   ├── certs&lt;br /&gt;
 │   │   ├── 02265526.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Entrust_Root_Certification_Authority_-_G2.crt&lt;br /&gt;
 │   │   ├── 024dc131.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Microsec_e-Szigno_Root_CA.crt&lt;br /&gt;
 │   │   ├── 03179a64.0 -&amp;gt; /usr/share/ca-certificates/mozilla/Staat_der_Nederlanden_EV_Root_CA.crt&lt;br /&gt;
 ...&lt;br /&gt;
 │   │   └── XRamp_Global_CA_Root.pem -&amp;gt; /usr/share/ca-certificates/mozilla/XRamp_Global_CA_Root.crt&lt;br /&gt;
 │   ├── openssl.cnf&lt;br /&gt;
 │   └── private&lt;br /&gt;
 ├── sysctl.d&lt;br /&gt;
 ├── systemd&lt;br /&gt;
 │   ├── journald.conf&lt;br /&gt;
 │   ├── logind.conf&lt;br /&gt;
 │   ├── network&lt;br /&gt;
 │   ├── system&lt;br /&gt;
 │   │   ├── bluetooth.target.wants&lt;br /&gt;
 │   │   │   └── bluetooth.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── ctrl-alt-del.target -&amp;gt; ../../../lib/systemd/system/reboot.target&lt;br /&gt;
 │   │   ├── dbus-org.bluez.service -&amp;gt; /lib/systemd/system/bluetooth.service&lt;br /&gt;
 │   │   ├── default.target -&amp;gt; /lib/systemd/system/multi-user.target&lt;br /&gt;
 │   │   ├── getty.target.wants&lt;br /&gt;
 │   │   │   └── getty@tty1.service -&amp;gt; ../../../../lib/systemd/system/getty@.service&lt;br /&gt;
 │   │   ├── local-fs.target.wants&lt;br /&gt;
 │   │   │   └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   │   ├── multi-user.target.wants&lt;br /&gt;
 │   │   │   ├── auditd.service -&amp;gt; /lib/systemd/system/auditd.service&lt;br /&gt;
 │   │   │   ├── connman.service -&amp;gt; /lib/systemd/system/connman.service&lt;br /&gt;
 │   │   │   ├── machines.target -&amp;gt; ../../../../lib/systemd/system/machines.target&lt;br /&gt;
 │   │   │   └── remote-fs.target -&amp;gt; ../../../../lib/systemd/system/remote-fs.target&lt;br /&gt;
 │   │   ├── network.target.wants&lt;br /&gt;
 │   │   │   ├── ip6tables.service -&amp;gt; /lib/systemd/system/ip6tables.service&lt;br /&gt;
 │   │   │   └── iptables.service -&amp;gt; /lib/systemd/system/iptables.service&lt;br /&gt;
 │   │   ├── sockets.target.wants&lt;br /&gt;
 │   │   │   └── sshd.socket -&amp;gt; /lib/systemd/system/sshd.socket&lt;br /&gt;
 │   │   ├── sysinit.target.wants&lt;br /&gt;
 │   │   │   ├── run-postinsts.service -&amp;gt; /lib/systemd/system/run-postinsts.service&lt;br /&gt;
 │   │   │   └── systemd-timesyncd.service -&amp;gt; ../../../../lib/systemd/system/systemd-timesyncd.service&lt;br /&gt;
 │   │   └── systemd-random-seed.service.wants&lt;br /&gt;
 │   │       └── var-volatile-lib.service -&amp;gt; /lib/systemd/system/var-volatile-lib.service&lt;br /&gt;
 │   ├── system.conf&lt;br /&gt;
 │   ├── timesyncd.conf&lt;br /&gt;
 │   ├── user&lt;br /&gt;
 │   └── user.conf&lt;br /&gt;
 ├── terminfo&lt;br /&gt;
 │   ├── a&lt;br /&gt;
 │   │   └── ansi&lt;br /&gt;
 │   ├── d&lt;br /&gt;
 │   │   └── dumb&lt;br /&gt;
 │   ├── l&lt;br /&gt;
 │   │   └── linux&lt;br /&gt;
 │   ├── r&lt;br /&gt;
 │   │   └── rxvt&lt;br /&gt;
 │   ├── s&lt;br /&gt;
 │   │   ├── screen&lt;br /&gt;
 │   │   ├── screen-256color&lt;br /&gt;
 │   │   └── sun&lt;br /&gt;
 │   ├── v&lt;br /&gt;
 │   │   ├── vt100&lt;br /&gt;
 │   │   ├── vt102&lt;br /&gt;
 │   │   ├── vt200&lt;br /&gt;
 │   │   ├── vt220&lt;br /&gt;
 │   │   └── vt52&lt;br /&gt;
 │   └── x&lt;br /&gt;
 │       ├── xterm -&amp;gt; xterm-color&lt;br /&gt;
 │       ├── xterm-256color&lt;br /&gt;
 │       ├── xterm-color&lt;br /&gt;
 │       └── xterm-xfree86&lt;br /&gt;
 ├── timestamp&lt;br /&gt;
 ├── tmpfiles.d&lt;br /&gt;
 │   ├── 00-create-volatile.conf&lt;br /&gt;
 │   ├── audit-volatile.conf&lt;br /&gt;
 │   └── connman_resolvconf.conf&lt;br /&gt;
 ├── udev&lt;br /&gt;
 │   ├── hwdb.d&lt;br /&gt;
 │   ├── rules.d&lt;br /&gt;
 │   │   ├── touchscreen.rules&lt;br /&gt;
 │   │   └── udev-smack-default.rules&lt;br /&gt;
 │   └── udev.conf&lt;br /&gt;
 ├── udhcpc.d&lt;br /&gt;
 │   └── 50default&lt;br /&gt;
 ├── version&lt;br /&gt;
 ├── wpa_supplicant.conf&lt;br /&gt;
 └── xdg&lt;br /&gt;
     └── systemd&lt;br /&gt;
         └── user -&amp;gt; ../../systemd/user&lt;br /&gt;
 &lt;br /&gt;
 62 directories, 500 files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
There are other solutions with similar goals. However, stateless has some properties that, when it is applicable, make stateless a better solution.&lt;br /&gt;
&lt;br /&gt;
=== overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The OS configuration files are in /etc. At runtime, an overlay is activated. Editing items in /etc then stores a new copy of the modified files in the overlay. A system update is done when the overlay is not active.&lt;br /&gt;
&lt;br /&gt;
Drawback: files in the overlay continue to shadow an updated system configuration, i.e. new settings from the updated OS configuration files are ignored. Addressing this would require merging potentially complex files during an update.&lt;br /&gt;
&lt;br /&gt;
=== config generator ===&lt;br /&gt;
&lt;br /&gt;
Instead of allowing local modifications in the normal /etc configuration files, one or more additional config files are used. A tool takes those files and the default system configuration to produce the actual content of /etc, either by writing to it directly or into an overlay.&lt;br /&gt;
&lt;br /&gt;
Drawback: custom solution, the normal tools like &amp;quot;useradd&amp;quot; do not work; no such generator exists (?) and thus would have to be written from scratch&lt;br /&gt;
Advantage: full control over the format of allowed configuration changes; the generator can be updated together with the OS so that the output always matches what the OS components expect&lt;br /&gt;
&lt;br /&gt;
Such a config generator can be combined with a stateless distro.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=23728</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=23728"/>
		<updated>2017-02-08T14:58:02Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: add place holder for RAUC&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
Some talks at Embedded Linux Conference presented an overview of the current mechanisms:&lt;br /&gt;
* How do you update your embedded Linux devices? by Daniel Sangorrin / Keijiro Yano http://events.linuxfoundation.org/sites/events/files/slides/linuxcon-japan-2016-softwre-updates-sangorrin.pdf&lt;br /&gt;
* Comparison of Linux Software Update Technologies by Matt Porter http://events.linuxfoundation.org/sites/events/files/slides/Comparison%20of%20Linux%20Software%20Update%20Technologies_0.pdf. Video at https://youtu.be/pdHV9H9nZks?list=PLbzoR-pLrL6pRFP6SOywVJWdEHlmQE51q. Full paper done for Automotive Grade Linux (AGL) here: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-May/002061.html&lt;br /&gt;
* Software update for IoT: the current state of play by Chris Simmonds http://de.slideshare.net/chrissimmonds/software-update-for-iot-the-current-state-of-play&lt;br /&gt;
* OSS Remote Firmware Updates for IoT-like Projects by Silvano Cirujano Cuesta http://events.linuxfoundation.org/sites/events/files/slides/OSS_Remote_Firmware_Updates_for_IoT-like_Projects.pdf&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dependencies on boot loader, number and kind of partitions, etc. Flexible mechanisms make no or only few assumptions about the system, but typically then require additional work to integrate with a specific setup.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible&lt;br /&gt;
| read/write&lt;br /&gt;
| HTTP(S) server, local media&lt;br /&gt;
| depends on setup&lt;br /&gt;
| relatively stable, under active development&lt;br /&gt;
| [http://git.yoctoproject.org/cgit/cgit.cgi/meta-swupd meta-swupd]&lt;br /&gt;
| moderate, suitable for frequent updates&lt;br /&gt;
| minimal download, needs sufficient free space in rootfs&lt;br /&gt;
| favors fast updates over failure resilience&lt;br /&gt;
| some planning required&lt;br /&gt;
| minimal, reboot optional&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Signed update data, HTTPS transfer protection.&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/sbabic/swupdate sbabic&#039;s swupdate]&lt;br /&gt;
| block-based&lt;br /&gt;
| flexible&lt;br /&gt;
| depends on setup&lt;br /&gt;
| local and remote (plain HTTP(S) or custom server)&lt;br /&gt;
| depends on setup&lt;br /&gt;
| Code relatively stable, 3 months release cycle&lt;br /&gt;
| [https://github.com/sbabic/meta-swupdate meta-swupdate]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| no builtin mechanism, to be added as part of system&lt;br /&gt;
| easy to use (but requires customization!?)&lt;br /&gt;
| reboot required&lt;br /&gt;
| signed and encrypted images, HTTPS&lt;br /&gt;
|-&lt;br /&gt;
! [https://mender.io/ Mender]&lt;br /&gt;
| block-based&lt;br /&gt;
| fixed, U-Boot as boot loader&lt;br /&gt;
| conceptually read-only&lt;br /&gt;
| remote&lt;br /&gt;
| Complete rootfs, including kernel.&lt;br /&gt;
| in development&lt;br /&gt;
| [https://github.com/mendersoftware/meta-mender meta-mender]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| integrated rollback&lt;br /&gt;
| easy when using meta-mender&lt;br /&gt;
| reboot required&lt;br /&gt;
| HTTPS&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/ostreedev/ostree OSTree]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible, but supports only limited set of bootloaders&lt;br /&gt;
| read/write, OS trees bind mounted read-only, /etc and /var writable&lt;br /&gt;
| local and remote repositories&lt;br /&gt;
| kernel and filesystem&lt;br /&gt;
| relatively stable, significant user base, under active development&lt;br /&gt;
| meta-ostree (WIP), [https://github.com/advancedtelematic/meta-updater meta-updater] (public)&lt;br /&gt;
| generating commits based on new builds, storing them in repository&lt;br /&gt;
| updating local repository, hard links for sharing unchanged content between deployments&lt;br /&gt;
| rollback to a different deployed OS tree&lt;br /&gt;
| some work required&lt;br /&gt;
| reboot required&lt;br /&gt;
| GPG-signed commits&lt;br /&gt;
|-&lt;br /&gt;
| [https://fosdem.org/2017/schedule/event/secure_safe_embedded_updates/ Robust Auto-Update Controller (RAUC)]&lt;br /&gt;
| block based?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: swupd updates files in a single partition. Other than that, it makes no assumptions about disk layout, filesystem and boot mechanism.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Files provided by the OS are read-only, everything else is read/write (/etc, /var) and preserved during updates. OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
;Updates from&lt;br /&gt;
: Uses libcurl to fetch update data and thus supports all URL schemes supported by libcurl, in particular http(s) and local files.&lt;br /&gt;
;Updates what&lt;br /&gt;
: swupd itself updates files in the rootfs, other components then need to be updated (boot loader, kernel, firmware, ...) then need be updated via custom plugins.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Used and maintained in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype). Code changes not written for Clear Linux OS tend to get merged only slowly or not at all (examples: [https://github.com/clearlinux/swupd-server/pull/25 assumption about filesystem], [https://github.com/clearlinux/swupd-server/pull/26 error checking], [https://github.com/clearlinux/swupd-client/pull/71 path configuration]).&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Layer available, not part of Yocto releases, experimental. Supports building incremental updates (= only changes since last build are stored for new build) and deltas (= optimized update pack for specific previous builds, typically major milestones).&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). When using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs. Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left. Updating files while system services are running reduces downtime, but is also more risky if system services aren&#039;t prepared for it. Could be extended to do updates without that risk, at the expense of increased downtime.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Upgrade path must be considered as part of release process (deltas, incompatible changes).&lt;br /&gt;
;Downtime&lt;br /&gt;
: Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot depending on what was updated (not automated at the moment in meta-swupd layer).&lt;br /&gt;
;Security&lt;br /&gt;
: Compatible with Linux IMA, Smack, SELinux. Conceptually incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of update data (not integrated into meta-swupd yet).&lt;br /&gt;
&lt;br /&gt;
== babic&#039;s SWUpdate ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: There is no constraint how software is stored. SWUPdate supports raw flash (NOR, NAND), UBI volumes, disk partitions or can update files (provided in a tarball) into an existing filesystem. Each artifact can be stored on a different storage device.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: No constrain where software is stored. During an update, a single partition, multiple partitions or generically multiple different storages can be updated.&lt;br /&gt;
:&lt;br /&gt;
: SWUpdate is often used in one of the following setup:&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : The system reboots in maintenance mode and SWUpdate is started from a Ramdisk. Just one copy of the Software is stored into the system.&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : two copies of the software (rootfs, kernel) are stored into the system and SWUpdate installs the stand-by copy.&lt;br /&gt;
;Updates from&lt;br /&gt;
:&lt;br /&gt;
:* local provisioning : USB, SD, etc.&lt;br /&gt;
:* generic URL : HTTP(S), FTP. It uses the libcurl library and supports what libcurl provides.&lt;br /&gt;
:* Webserver : SWUpdate integrates a Webserver (moongoose)&lt;br /&gt;
:* External Backend connector (suricatta mode) to bind with an external backend server. Currently, the Hawkbit server is supported https://github.com/eclipse/hawkbit. Open to further backends.&lt;br /&gt;
;Updates what&lt;br /&gt;
:&lt;br /&gt;
:* bootloader (risky !)&lt;br /&gt;
:* kernel&lt;br /&gt;
:* interface to bootloader (U-Boot) Allows to change u-boot variables and allow to use plugins to make changes to other bootloaders.&lt;br /&gt;
;* disk partitions&lt;br /&gt;
;* provide interface to update FPGAs, external microcontrollers, etc.&lt;br /&gt;
;* custom handlers: an interface allows to add own installers written in C or in LUA.&lt;br /&gt;
;Resources on client&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : meta-swupdate provides recipe to generate a compressed ramdisk with small footprint. Including support for signed image, the whole rootfs is ~4MB. The minimal requirement for a complete rescue (bootloader, kernel for SWUpdate and ramdisk) is 8MB. This allows to put the rescue in a small storage like a SPI-NOR, while the software is stored on another and bigger device (NAND, eMMC).&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. No additional space is required if the image is directly streamed to the stand-by copy.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: There are no recovery mechanism built in. If the bootloader has the capability to check if a boot failed, it could boot in maintenance mode again.&lt;br /&gt;
; Downtime&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : There is need to reboot in maintenance mode and once the image is installed, needs to reboot again with the new production image. &lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; :  Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime. &lt;br /&gt;
;Security&lt;br /&gt;
:&lt;br /&gt;
:* Connection with HTTPS to the external the server.&lt;br /&gt;
:* Signed images : it is possible to sign the images used for the update in order to check its integrity.&lt;br /&gt;
:* Split in several processes: connection to the internet can run with a different userid / groupid as the installer. The installer runs often with high privileges because it has to write the hardware.&lt;br /&gt;
:* Support for encrypted artifacts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mender ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dual rootfs partitions with two extra partitions, a boot and a data partition. Depends on U-Boot as boot loader for the automatic rollback.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Stored in one active and one passive partition, read/write while in use, but modifications to it get lost during updates when switching partitions. Kernel is stored on rootfs.&lt;br /&gt;
; Updates from&lt;br /&gt;
: Mender server and/or HTTPS server&lt;br /&gt;
;Code stability&lt;br /&gt;
: Master branch under development. There is a stable branch, but it&#039;s lacking many basic features.&lt;br /&gt;
;Resources on server&lt;br /&gt;
: Needs to store one compressed rootfs image for each update, plus small meta data section.&lt;br /&gt;
;Resources on client&lt;br /&gt;
: Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. Needs no additional space on device beyond the partitions, space for the Mender binary, and a tiny local database.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Automatic rollback if the device either fails to boot, or the Mender daemon cannot connect to the Mender server afterwards.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Relatively easy to [https://docs.mender.io/Artifacts/Building-Mender-Yocto-image build with Yocto]. More complex if [https://mender.io/blog/porting-mender-to-a-non-yocto-build-system not using Yocto].&lt;br /&gt;
;Downtime&lt;br /&gt;
: Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime.&lt;br /&gt;
;Security&lt;br /&gt;
: Secure connection to the server (TLS). Signing not currently supported, but planned.&lt;br /&gt;
&lt;br /&gt;
== OSTree ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
:Only limited set of bootloaders supported (those that support [http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec The Boot Loader Specification] and some exceptions). The root file system has to have the /boot directory managed by OSTree. The actual deployed OS trees have certain conventions and requirements. For example, /etc and /var need to be writable, while /usr is mounted read-only.&lt;br /&gt;
;Rootfs&lt;br /&gt;
:Files provided by OS are expected to be in /usr, which is mounted read-only. /etc and /var are writable.&lt;br /&gt;
;Updates from&lt;br /&gt;
:Local and remote repostories. OSTree works by replicating a repository to the target device and then &amp;quot;checking out&amp;quot; deployment directories from the repository. Local and HTTP methods for replicating the repository are available.&lt;br /&gt;
;Updates what&lt;br /&gt;
:OSTree (atomically) updates root file system trees and the kernel. If anything else needs to be updated, it needs to happen by running custom code on the target device.&lt;br /&gt;
;Code stability&lt;br /&gt;
:OSTree is relatively stable. It&#039;s used by many distributions and projects, such as Fedora Atomic and Flatpak. OSTree is under active development and has an open-source community around it.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
:Meta-ostree layer is work in progress.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
:OSTree generates &amp;quot;commit objects&amp;quot; based on the filesystem changes between builds. These commit objects are stored in a commit chain the same way as git does. The commit objects transmitted over the network as binary diffs when the remote and local repositories are synchronized.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
:Client has the local copy of the repository. The repository contains the objects, which map to the files on the OS trees. The deployments of the OS trees (or &amp;quot;checkouts&amp;quot; in git termininology) are made using hard links to the repository content. This means that the required space is only increased when the data changes: the static data files are shared between deployments.&lt;br /&gt;
:OSTree allows deleting of data. This means that the full operating system history doesn&#039;t need to be stored in the repository. A typical OSTree-based system might have two deployed OS trees: one that is being currently used and one fallback.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
:OSTree controls the booting to the different deployed trees using bootloader entries. If booting a deployed OS tree fails, a different bootloader entry can be chosen for booting into a different OS tree.&lt;br /&gt;
;Complexity&lt;br /&gt;
:Some work is needed to fit the root filesystem into the conventions that OSTree likes. Some documentation of the needed steps [https://ostree.readthedocs.io/en/latest/manual/adapting-existing/ is available here].&lt;br /&gt;
;Downtime&lt;br /&gt;
:Reboot is required after updates. Changing between deployed OS trees is done by selecting a different boot loader entry.&lt;br /&gt;
;Security&lt;br /&gt;
:The commits can be signed with GPG-based signatures. OSTree repositories store file extended attributes, which means that the security mechanisms using extended attributes should be functional with OSTree.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=22940</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=22940"/>
		<updated>2017-01-16T15:23:14Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: add link to meta-updater&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
Some talks at Embedded Linux Conference presented an overview of the current mechanisms:&lt;br /&gt;
* How do you update your embedded Linux devices? by Daniel Sangorrin / Keijiro Yano http://events.linuxfoundation.org/sites/events/files/slides/linuxcon-japan-2016-softwre-updates-sangorrin.pdf&lt;br /&gt;
* Comparison of Linux Software Update Technologies by Matt Porter http://events.linuxfoundation.org/sites/events/files/slides/Comparison%20of%20Linux%20Software%20Update%20Technologies_0.pdf. Video at https://youtu.be/pdHV9H9nZks?list=PLbzoR-pLrL6pRFP6SOywVJWdEHlmQE51q. Full paper done for Automotive Grade Linux (AGL) here: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-May/002061.html&lt;br /&gt;
* Software update for IoT: the current state of play by Chris Simmonds http://de.slideshare.net/chrissimmonds/software-update-for-iot-the-current-state-of-play&lt;br /&gt;
* OSS Remote Firmware Updates for IoT-like Projects by Silvano Cirujano Cuesta http://events.linuxfoundation.org/sites/events/files/slides/OSS_Remote_Firmware_Updates_for_IoT-like_Projects.pdf&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dependencies on boot loader, number and kind of partitions, etc. Flexible mechanisms make no or only few assumptions about the system, but typically then require additional work to integrate with a specific setup.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible&lt;br /&gt;
| read/write&lt;br /&gt;
| HTTP(S) server, local media&lt;br /&gt;
| depends on setup&lt;br /&gt;
| relatively stable, under active development&lt;br /&gt;
| [http://git.yoctoproject.org/cgit/cgit.cgi/meta-swupd meta-swupd]&lt;br /&gt;
| moderate, suitable for frequent updates&lt;br /&gt;
| minimal download, needs sufficient free space in rootfs&lt;br /&gt;
| favors fast updates over failure resilience&lt;br /&gt;
| some planning required&lt;br /&gt;
| minimal, reboot optional&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Signed update data, HTTPS transfer protection.&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/sbabic/swupdate sbabic&#039;s swupdate]&lt;br /&gt;
| block-based&lt;br /&gt;
| flexible&lt;br /&gt;
| depends on setup&lt;br /&gt;
| local and remote (plain HTTP(S) or custom server)&lt;br /&gt;
| depends on setup&lt;br /&gt;
| Code relatively stable, 3 months release cycle&lt;br /&gt;
| [https://github.com/sbabic/meta-swupdate meta-swupdate]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| no builtin mechanism, to be added as part of system&lt;br /&gt;
| easy to use (but requires customization!?)&lt;br /&gt;
| reboot required&lt;br /&gt;
| signed and encrypted images, HTTPS&lt;br /&gt;
|-&lt;br /&gt;
! [https://mender.io/ Mender]&lt;br /&gt;
| block-based&lt;br /&gt;
| fixed, U-Boot as boot loader&lt;br /&gt;
| conceptually read-only&lt;br /&gt;
| remote&lt;br /&gt;
| Complete rootfs, including kernel.&lt;br /&gt;
| in development&lt;br /&gt;
| [https://github.com/mendersoftware/meta-mender meta-mender]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| integrated rollback&lt;br /&gt;
| easy when using meta-mender&lt;br /&gt;
| reboot required&lt;br /&gt;
| HTTPS&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/ostreedev/ostree OSTree]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible, but supports only limited set of bootloaders&lt;br /&gt;
| read/write, OS trees bind mounted read-only, /etc and /var writable&lt;br /&gt;
| local and remote repositories&lt;br /&gt;
| kernel and filesystem&lt;br /&gt;
| relatively stable, significant user base, under active development&lt;br /&gt;
| meta-ostree (WIP), [https://github.com/advancedtelematic/meta-updater meta-updater] (public)&lt;br /&gt;
| generating commits based on new builds, storing them in repository&lt;br /&gt;
| updating local repository, hard links for sharing unchanged content between deployments&lt;br /&gt;
| rollback to a different deployed OS tree&lt;br /&gt;
| some work required&lt;br /&gt;
| reboot required&lt;br /&gt;
| GPG-signed commits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: swupd updates files in a single partition. Other than that, it makes no assumptions about disk layout, filesystem and boot mechanism.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Files provided by the OS are read-only, everything else is read/write (/etc, /var) and preserved during updates. OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
;Updates from&lt;br /&gt;
: Uses libcurl to fetch update data and thus supports all URL schemes supported by libcurl, in particular http(s) and local files.&lt;br /&gt;
;Updates what&lt;br /&gt;
: swupd itself updates files in the rootfs, other components then need to be updated (boot loader, kernel, firmware, ...) then need be updated via custom plugins.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Used and maintained in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype). Code changes not written for Clear Linux OS tend to get merged only slowly or not at all (examples: [https://github.com/clearlinux/swupd-server/pull/25 assumption about filesystem], [https://github.com/clearlinux/swupd-server/pull/26 error checking], [https://github.com/clearlinux/swupd-client/pull/71 path configuration]).&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Layer available, not part of Yocto releases, experimental. Supports building incremental updates (= only changes since last build are stored for new build) and deltas (= optimized update pack for specific previous builds, typically major milestones).&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). When using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs. Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left. Updating files while system services are running reduces downtime, but is also more risky if system services aren&#039;t prepared for it. Could be extended to do updates without that risk, at the expense of increased downtime.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Upgrade path must be considered as part of release process (deltas, incompatible changes).&lt;br /&gt;
;Downtime&lt;br /&gt;
: Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot depending on what was updated (not automated at the moment in meta-swupd layer).&lt;br /&gt;
;Security&lt;br /&gt;
: Compatible with Linux IMA, Smack, SELinux. Conceptually incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of update data (not integrated into meta-swupd yet).&lt;br /&gt;
&lt;br /&gt;
== babic&#039;s SWUpdate ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: There is no constraint how software is stored. SWUPdate supports raw flash (NOR, NAND), UBI volumes, disk partitions or can update files (provided in a tarball) into an existing filesystem. Each artifact can be stored on a different storage device.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: No constrain where software is stored. During an update, a single partition, multiple partitions or generically multiple different storages can be updated.&lt;br /&gt;
:&lt;br /&gt;
: SWUpdate is often used in one of the following setup:&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : The system reboots in maintenance mode and SWUpdate is started from a Ramdisk. Just one copy of the Software is stored into the system.&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : two copies of the software (rootfs, kernel) are stored into the system and SWUpdate installs the stand-by copy.&lt;br /&gt;
;Updates from&lt;br /&gt;
:&lt;br /&gt;
:* local provisioning : USB, SD, etc.&lt;br /&gt;
:* generic URL : HTTP(S), FTP. It uses the libcurl library and supports what libcurl provides.&lt;br /&gt;
:* Webserver : SWUpdate integrates a Webserver (moongoose)&lt;br /&gt;
:* External Backend connector (suricatta mode) to bind with an external backend server. Currently, the Hawkbit server is supported https://github.com/eclipse/hawkbit. Open to further backends.&lt;br /&gt;
;Updates what&lt;br /&gt;
:&lt;br /&gt;
:* bootloader (risky !)&lt;br /&gt;
:* kernel&lt;br /&gt;
:* interface to bootloader (U-Boot) Allows to change u-boot variables and allow to use plugins to make changes to other bootloaders.&lt;br /&gt;
;* disk partitions&lt;br /&gt;
;* provide interface to update FPGAs, external microcontrollers, etc.&lt;br /&gt;
;* custom handlers: an interface allows to add own installers written in C or in LUA.&lt;br /&gt;
;Resources on client&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : meta-swupdate provides recipe to generate a compressed ramdisk with small footprint. Including support for signed image, the whole rootfs is ~4MB. The minimal requirement for a complete rescue (bootloader, kernel for SWUpdate and ramdisk) is 8MB. This allows to put the rescue in a small storage like a SPI-NOR, while the software is stored on another and bigger device (NAND, eMMC).&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. No additional space is required if the image is directly streamed to the stand-by copy.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: There are no recovery mechanism built in. If the bootloader has the capability to check if a boot failed, it could boot in maintenance mode again.&lt;br /&gt;
; Downtime&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : There is need to reboot in maintenance mode and once the image is installed, needs to reboot again with the new production image. &lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; :  Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime. &lt;br /&gt;
;Security&lt;br /&gt;
:&lt;br /&gt;
:* Connection with HTTPS to the external the server.&lt;br /&gt;
:* Signed images : it is possible to sign the images used for the update in order to check its integrity.&lt;br /&gt;
:* Split in several processes: connection to the internet can run with a different userid / groupid as the installer. The installer runs often with high privileges because it has to write the hardware.&lt;br /&gt;
:* Support for encrypted artifacts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mender ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dual rootfs partitions with two extra partitions, a boot and a data partition. Depends on U-Boot as boot loader for the automatic rollback.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Stored in one active and one passive partition, read/write while in use, but modifications to it get lost during updates when switching partitions. Kernel is stored on rootfs.&lt;br /&gt;
; Updates from&lt;br /&gt;
: Mender server and/or HTTPS server&lt;br /&gt;
;Code stability&lt;br /&gt;
: Master branch under development. There is a stable branch, but it&#039;s lacking many basic features.&lt;br /&gt;
;Resources on server&lt;br /&gt;
: Needs to store one compressed rootfs image for each update, plus small meta data section.&lt;br /&gt;
;Resources on client&lt;br /&gt;
: Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. Needs no additional space on device beyond the partitions, space for the Mender binary, and a tiny local database.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Automatic rollback if the device either fails to boot, or the Mender daemon cannot connect to the Mender server afterwards.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Relatively easy to [https://docs.mender.io/Artifacts/Building-Mender-Yocto-image build with Yocto]. More complex if [https://mender.io/blog/porting-mender-to-a-non-yocto-build-system not using Yocto].&lt;br /&gt;
;Downtime&lt;br /&gt;
: Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime.&lt;br /&gt;
;Security&lt;br /&gt;
: Secure connection to the server (TLS). Signing not currently supported, but planned.&lt;br /&gt;
&lt;br /&gt;
== OSTree ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
:Only limited set of bootloaders supported (those that support [http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec The Boot Loader Specification] and some exceptions). The root file system has to have the /boot directory managed by OSTree. The actual deployed OS trees have certain conventions and requirements. For example, /etc and /var need to be writable, while /usr is mounted read-only.&lt;br /&gt;
;Rootfs&lt;br /&gt;
:Files provided by OS are expected to be in /usr, which is mounted read-only. /etc and /var are writable.&lt;br /&gt;
;Updates from&lt;br /&gt;
:Local and remote repostories. OSTree works by replicating a repository to the target device and then &amp;quot;checking out&amp;quot; deployment directories from the repository. Local and HTTP methods for replicating the repository are available.&lt;br /&gt;
;Updates what&lt;br /&gt;
:OSTree (atomically) updates root file system trees and the kernel. If anything else needs to be updated, it needs to happen by running custom code on the target device.&lt;br /&gt;
;Code stability&lt;br /&gt;
:OSTree is relatively stable. It&#039;s used by many distributions and projects, such as Fedora Atomic and Flatpak. OSTree is under active development and has an open-source community around it.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
:Meta-ostree layer is work in progress.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
:OSTree generates &amp;quot;commit objects&amp;quot; based on the filesystem changes between builds. These commit objects are stored in a commit chain the same way as git does. The commit objects transmitted over the network as binary diffs when the remote and local repositories are synchronized.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
:Client has the local copy of the repository. The repository contains the objects, which map to the files on the OS trees. The deployments of the OS trees (or &amp;quot;checkouts&amp;quot; in git termininology) are made using hard links to the repository content. This means that the required space is only increased when the data changes: the static data files are shared between deployments.&lt;br /&gt;
:OSTree allows deleting of data. This means that the full operating system history doesn&#039;t need to be stored in the repository. A typical OSTree-based system might have two deployed OS trees: one that is being currently used and one fallback.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
:OSTree controls the booting to the different deployed trees using bootloader entries. If booting a deployed OS tree fails, a different bootloader entry can be chosen for booting into a different OS tree.&lt;br /&gt;
;Complexity&lt;br /&gt;
:Some work is needed to fit the root filesystem into the conventions that OSTree likes. Some documentation of the needed steps [https://ostree.readthedocs.io/en/latest/manual/adapting-existing/ is available here].&lt;br /&gt;
;Downtime&lt;br /&gt;
:Reboot is required after updates. Changing between deployed OS trees is done by selecting a different boot loader entry.&lt;br /&gt;
;Security&lt;br /&gt;
:The commits can be signed with GPG-based signatures. OSTree repositories store file extended attributes, which means that the security mechanisms using extended attributes should be functional with OSTree.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21977</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21977"/>
		<updated>2016-12-12T08:42:11Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: swupd pull request examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
Some talks at Embedded Linux Conference presented an overview of the current mechanisms:&lt;br /&gt;
* How do you update your embedded Linux devices? by Daniel Sangorrin / Keijiro Yano http://events.linuxfoundation.org/sites/events/files/slides/linuxcon-japan-2016-softwre-updates-sangorrin.pdf&lt;br /&gt;
* Comparison of Linux Software Update Technologies by Matt Porter http://events.linuxfoundation.org/sites/events/files/slides/Comparison%20of%20Linux%20Software%20Update%20Technologies_0.pdf. Video at https://youtu.be/pdHV9H9nZks?list=PLbzoR-pLrL6pRFP6SOywVJWdEHlmQE51q. Full paper done for Automotive Grade Linux (AGL) here: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-May/002061.html&lt;br /&gt;
* Software update for IoT: the current state of play by Chris Simmonds http://de.slideshare.net/chrissimmonds/software-update-for-iot-the-current-state-of-play&lt;br /&gt;
* OSS Remote Firmware Updates for IoT-like Projects by Silvano Cirujano Cuesta http://events.linuxfoundation.org/sites/events/files/slides/OSS_Remote_Firmware_Updates_for_IoT-like_Projects.pdf&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dependencies on boot loader, number and kind of partitions, etc. Flexible mechanisms make no or only few assumptions about the system, but typically then require additional work to integrate with a specific setup.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible&lt;br /&gt;
| read/write&lt;br /&gt;
| HTTP(S) server, local media&lt;br /&gt;
| depends on setup&lt;br /&gt;
| relatively stable, under active development&lt;br /&gt;
| [http://git.yoctoproject.org/cgit/cgit.cgi/meta-swupd meta-swupd]&lt;br /&gt;
| moderate, suitable for frequent updates&lt;br /&gt;
| minimal download, needs sufficient free space in rootfs&lt;br /&gt;
| favors fast updates over failure resilience&lt;br /&gt;
| some planning required&lt;br /&gt;
| minimal, reboot optional&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Signed update data, HTTPS transfer protection.&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/sbabic/swupdate sbabic&#039;s swupdate]&lt;br /&gt;
| block-based&lt;br /&gt;
| flexible&lt;br /&gt;
| depends on setup&lt;br /&gt;
| local and remote (plain HTTP(S) or custom server)&lt;br /&gt;
| depends on setup&lt;br /&gt;
| Code relatively stable, 3 months release cycle&lt;br /&gt;
| [https://github.com/sbabic/meta-swupdate meta-swupdate]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| no builtin mechanism, to be added as part of system&lt;br /&gt;
| easy to use (but requires customization!?)&lt;br /&gt;
| reboot required&lt;br /&gt;
| signed and encrypted images, HTTPS&lt;br /&gt;
|-&lt;br /&gt;
! [https://mender.io/ Mender]&lt;br /&gt;
| block-based&lt;br /&gt;
| fixed, U-Boot as boot loader&lt;br /&gt;
| conceptually read-only&lt;br /&gt;
| remote&lt;br /&gt;
| Complete rootfs, including kernel.&lt;br /&gt;
| in development&lt;br /&gt;
| [https://github.com/mendersoftware/meta-mender meta-mender]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| integrated rollback&lt;br /&gt;
| easy when using meta-mender&lt;br /&gt;
| reboot required&lt;br /&gt;
| HTTPS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TODO: add OSTree (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10704)&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: swupd updates files in a single partition. Other than that, it makes no assumptions about disk layout, filesystem and boot mechanism.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Files provided by the OS are read-only, everything else is read/write (/etc, /var) and preserved during updates. OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
;Updates from&lt;br /&gt;
: Uses libcurl to fetch update data and thus supports all URL schemes supported by libcurl, in particular http(s) and local files.&lt;br /&gt;
;Updates what&lt;br /&gt;
: swupd itself updates files in the rootfs, other components then need to be updated (boot loader, kernel, firmware, ...) then need be updated via custom plugins.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Used and maintained in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype). Code changes not written for Clear Linux OS tend to get merged only slowly or not at all (examples: [https://github.com/clearlinux/swupd-server/pull/25 assumption about filesystem], [https://github.com/clearlinux/swupd-server/pull/26 error checking], [https://github.com/clearlinux/swupd-client/pull/71 path configuration]).&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Layer available, not part of Yocto releases, experimental. Supports building incremental updates (= only changes since last build are stored for new build) and deltas (= optimized update pack for specific previous builds, typically major milestones).&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). When using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs. Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left. Updating files while system services are running reduces downtime, but is also more risky if system services aren&#039;t prepared for it. Could be extended to do updates without that risk, at the expense of increased downtime.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Upgrade path must be considered as part of release process (deltas, incompatible changes).&lt;br /&gt;
;Downtime&lt;br /&gt;
: Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot depending on what was updated (not automated at the moment in meta-swupd layer).&lt;br /&gt;
;Security&lt;br /&gt;
: Compatible with Linux IMA, Smack, SELinux. Conceptually incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of update data (not integrated into meta-swupd yet).&lt;br /&gt;
&lt;br /&gt;
== babic&#039;s SWUpdate ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: There is no constraint how software is stored. SWUPdate supports raw flash (NOR, NAND), UBI volumes, disk partitions or can update files (provided in a tarball) into an existing filesystem. Each artifact can be stored on a different storage device.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: No constrain where software is stored. During an update, a single partition, multiple partitions or generically multiple different storages can be updated.&lt;br /&gt;
:&lt;br /&gt;
: SWUpdate is often used in one of the following setup:&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : The system reboots in maintenance mode and SWUpdate is started from a Ramdisk. Just one copy of the Software is stored into the system.&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : two copies of the software (rootfs, kernel) are stored into the system and SWUpdate installs the stand-by copy.&lt;br /&gt;
;Updates from&lt;br /&gt;
:&lt;br /&gt;
:* local provisioning : USB, SD, etc.&lt;br /&gt;
:* generic URL : HTTP(S), FTP. It uses the libcurl library and supports what libcurl provides.&lt;br /&gt;
:* Webserver : SWUpdate integrates a Webserver (moongoose)&lt;br /&gt;
:* External Backend connector (suricatta mode) to bind with an external backend server. Currently, the Hawkbit server is supported https://github.com/eclipse/hawkbit. Open to further backends.&lt;br /&gt;
;Updates what&lt;br /&gt;
:&lt;br /&gt;
:* bootloader (risky !)&lt;br /&gt;
:* kernel&lt;br /&gt;
:* interface to bootloader (U-Boot) Allows to change u-boot variables and allow to use plugins to make changes to other bootloaders.&lt;br /&gt;
;* disk partitions&lt;br /&gt;
;* provide interface to update FPGAs, external microcontrollers, etc.&lt;br /&gt;
;* custom handlers: an interface allows to add own installers written in C or in LUA.&lt;br /&gt;
;Resources on client&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : meta-swupdate provides recipe to generate a compressed ramdisk with small footprint. Including support for signed image, the whole rootfs is ~4MB. The minimal requirement for a complete rescue (bootloader, kernel for SWUpdate and ramdisk) is 8MB. This allows to put the rescue in a small storage like a SPI-NOR, while the software is stored on another and bigger device (NAND, eMMC).&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. No additional space is required if the image is directly streamed to the stand-by copy.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: There are no recovery mechanism built in. If the bootloader has the capability to check if a boot failed, it could boot in maintenance mode again.&lt;br /&gt;
; Downtime&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : There is need to reboot in maintenance mode and once the image is installed, needs to reboot again with the new production image. &lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; :  Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime. &lt;br /&gt;
;Security&lt;br /&gt;
:&lt;br /&gt;
:* Connection with HTTPS to the external the server.&lt;br /&gt;
:* Signed images : it is possible to sign the images used for the update in order to check its integrity.&lt;br /&gt;
:* Split in several processes: connection to the internet can run with a different userid / groupid as the installer. The installer runs often with high privileges because it has to write the hardware.&lt;br /&gt;
:* Support for encrypted artifacts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mender ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dual rootfs partitions with two extra partitions, a boot and a data partition. Depends on U-Boot as boot loader for the automatic rollback.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Stored in one active and one passive partition, read/write while in use, but modifications to it get lost during updates when switching partitions. Kernel is stored on rootfs.&lt;br /&gt;
; Updates from&lt;br /&gt;
: Mender server and/or HTTPS server&lt;br /&gt;
;Code stability&lt;br /&gt;
: Master branch under development. There is a stable branch, but it&#039;s lacking many basic features.&lt;br /&gt;
;Resources on server&lt;br /&gt;
: Needs to store one compressed rootfs image for each update, plus small meta data section.&lt;br /&gt;
;Resources on client&lt;br /&gt;
: Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. Needs no additional space on device beyond the partitions, space for the Mender binary, and a tiny local database.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Automatic rollback if the device either fails to boot, or the Mender daemon cannot connect to the Mender server afterwards.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Relatively easy to [https://docs.mender.io/Artifacts/Building-Mender-Yocto-image build with Yocto]. More complex if [https://mender.io/blog/porting-mender-to-a-non-yocto-build-system not using Yocto].&lt;br /&gt;
;Downtime&lt;br /&gt;
: Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime.&lt;br /&gt;
;Security&lt;br /&gt;
: Secure connection to the server (TLS). Signing not currently supported, but planned.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21948</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21948"/>
		<updated>2016-12-09T15:12:17Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: Mender + U-Boot dependency&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
Some talks at Embedded Linux Conference presented an overview of the current mechanisms:&lt;br /&gt;
* How do you update your embedded Linux devices? by Daniel Sangorrin / Keijiro Yano http://events.linuxfoundation.org/sites/events/files/slides/linuxcon-japan-2016-softwre-updates-sangorrin.pdf&lt;br /&gt;
* Comparison of Linux Software Update Technologies by Matt Porter http://events.linuxfoundation.org/sites/events/files/slides/Comparison%20of%20Linux%20Software%20Update%20Technologies_0.pdf. Video at https://youtu.be/pdHV9H9nZks?list=PLbzoR-pLrL6pRFP6SOywVJWdEHlmQE51q. Full paper done for Automotive Grade Linux (AGL) here: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-May/002061.html&lt;br /&gt;
* Software update for IoT: the current state of play by Chris Simmonds http://de.slideshare.net/chrissimmonds/software-update-for-iot-the-current-state-of-play&lt;br /&gt;
* OSS Remote Firmware Updates for IoT-like Projects by Silvano Cirujano Cuesta http://events.linuxfoundation.org/sites/events/files/slides/OSS_Remote_Firmware_Updates_for_IoT-like_Projects.pdf&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dependencies on boot loader, number and kind of partitions, etc. Flexible mechanisms make no or only few assumptions about the system, but typically then require additional work to integrate with a specific setup.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible&lt;br /&gt;
| read/write&lt;br /&gt;
| HTTP(S) server, local media&lt;br /&gt;
| depends on setup&lt;br /&gt;
| relatively stable, under active development&lt;br /&gt;
| [http://git.yoctoproject.org/cgit/cgit.cgi/meta-swupd meta-swupd]&lt;br /&gt;
| moderate, suitable for frequent updates&lt;br /&gt;
| minimal download, needs sufficient free space in rootfs&lt;br /&gt;
| favors fast updates over failure resilience&lt;br /&gt;
| some planning required&lt;br /&gt;
| minimal, reboot optional&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Signed update data, HTTPS transfer protection.&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/sbabic/swupdate sbabic&#039;s swupdate]&lt;br /&gt;
| block-based&lt;br /&gt;
| flexible&lt;br /&gt;
| depends on setup&lt;br /&gt;
| local and remote (plain HTTP(S) or custom server)&lt;br /&gt;
| depends on setup&lt;br /&gt;
| Code relatively stable, 3 months release cycle&lt;br /&gt;
| [https://github.com/sbabic/meta-swupdate meta-swupdate]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| no builtin mechanism, to be added as part of system&lt;br /&gt;
| easy to use (but requires customization!?)&lt;br /&gt;
| reboot required&lt;br /&gt;
| signed and encrypted images, HTTPS&lt;br /&gt;
|-&lt;br /&gt;
! [https://mender.io/ Mender]&lt;br /&gt;
| block-based&lt;br /&gt;
| fixed, U-Boot as boot loader&lt;br /&gt;
| conceptually read-only&lt;br /&gt;
| remote&lt;br /&gt;
| Complete rootfs, including kernel.&lt;br /&gt;
| in development&lt;br /&gt;
| [https://github.com/mendersoftware/meta-mender meta-mender]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| integrated rollback&lt;br /&gt;
| easy when using meta-mender&lt;br /&gt;
| reboot required&lt;br /&gt;
| HTTPS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TODO: add OSTree (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10704)&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: swupd updates files in a single partition. Other than that, it makes no assumptions about disk layout, filesystem and boot mechanism.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Files provided by the OS are read-only, everything else is read/write (/etc, /var) and preserved during updates. OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
;Updates from&lt;br /&gt;
: Uses libcurl to fetch update data and thus supports all URL schemes supported by libcurl, in particular http(s) and local files.&lt;br /&gt;
;Updates what&lt;br /&gt;
: swupd itself updates files in the rootfs, other components then need to be updated (boot loader, kernel, firmware, ...) then need be updated via custom plugins.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Used and maintained in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype). Code changes not written for Clear Linux OS tend to get merged only slowly.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Layer available, not part of Yocto releases, experimental. Supports building incremental updates (= only changes since last build are stored for new build) and deltas (= optimized update pack for specific previous builds, typically major milestones).&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). When using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs. Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left. Updating files while system services are running reduces downtime, but is also more risky if system services aren&#039;t prepared for it. Could be extended to do updates without that risk, at the expense of increased downtime.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Upgrade path must be considered as part of release process (deltas, incompatible changes).&lt;br /&gt;
;Downtime&lt;br /&gt;
: Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot depending on what was updated (not automated at the moment in meta-swupd layer).&lt;br /&gt;
;Security&lt;br /&gt;
: Compatible with Linux IMA, Smack, SELinux. Conceptually incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of update data (not integrated into meta-swupd yet).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== babic&#039;s SWUpdate ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: There is no constraint how software is stored. SWUPdate supports raw flash (NOR, NAND), UBI volumes, disk partitions or can update files (provided in a tarball) into an existing filesystem. Each artifact can be stored on a different storage device.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: No constrain where software is stored. During an update, a single partition, multiple partitions or generically multiple different storages can be updated.&lt;br /&gt;
:&lt;br /&gt;
: SWUpdate is often used in one of the following setup:&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : The system reboots in maintenance mode and SWUpdate is started from a Ramdisk. Just one copy of the Software is stored into the system.&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : two copies of the software (rootfs, kernel) are stored into the system and SWUpdate installs the stand-by copy.&lt;br /&gt;
;Updates from&lt;br /&gt;
:&lt;br /&gt;
:* local provisioning : USB, SD, etc.&lt;br /&gt;
:* generic URL : HTTP(S), FTP. It uses the libcurl library and supports what libcurl provides.&lt;br /&gt;
:* Webserver : SWUpdate integrates a Webserver (moongoose)&lt;br /&gt;
:* External Backend connector (suricatta mode) to bind with an external backend server. Currently, the Hawkbit server is supported https://github.com/eclipse/hawkbit. Open to further backends.&lt;br /&gt;
;Updates what&lt;br /&gt;
:&lt;br /&gt;
:* bootloader (risky !)&lt;br /&gt;
:* kernel&lt;br /&gt;
:* interface to bootloader (U-Boot) Allows to change u-boot variables and allow to use plugins to make changes to other bootloaders.&lt;br /&gt;
;* disk partitions&lt;br /&gt;
;* provide interface to update FPGAs, external microcontrollers, etc.&lt;br /&gt;
;* custom handlers: an interface allows to add own installers written in C or in LUA.&lt;br /&gt;
;Resources on client&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : meta-swupdate provides recipe to generate a compressed ramdisk with small footprint. Including support for signed image, the whole rootfs is ~4MB. The minimal requirement for a complete rescue (bootloader, kernel for SWUpdate and ramdisk) is 8MB. This allows to put the rescue in a small storage like a SPI-NOR, while the software is stored on another and bigger device (NAND, eMMC).&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. No additional space is required if the image is directly streamed to the stand-by copy.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: There are no recovery mechanism built in. If the bootloader has the capability to check if a boot failed, it could boot in maintenance mode again.&lt;br /&gt;
; Downtime&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : There is need to reboot in maintenance mode and once the image is installed, needs to reboot again with the new production image. &lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; :  Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime. &lt;br /&gt;
;Security&lt;br /&gt;
:&lt;br /&gt;
:* Connection with HTTPS to the external the server.&lt;br /&gt;
:* Signed images : it is possible to sign the images used for the update in order to check its integrity.&lt;br /&gt;
:* Split in several processes: connection to the internet can run with a different userid / groupid as the installer. The installer runs often with high privileges because it has to write the hardware.&lt;br /&gt;
:* Support for encrypted artifacts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mender ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dual rootfs partitions with two extra partitions, a boot and a data partition. Depends on U-Boot as boot loader for the automatic rollback.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Stored in one active and one passive partition, read/write while in use, but modifications to it get lost during updates when switching partitions. Kernel is stored on rootfs.&lt;br /&gt;
; Updates from&lt;br /&gt;
: Mender server and/or HTTPS server&lt;br /&gt;
;Code stability&lt;br /&gt;
: Master branch under development. There is a stable branch, but it&#039;s lacking many basic features.&lt;br /&gt;
;Resources on server&lt;br /&gt;
: Needs to store one compressed rootfs image for each update, plus small meta data section.&lt;br /&gt;
;Resources on client&lt;br /&gt;
: Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. Needs no additional space on device beyond the partitions, space for the Mender binary, and a tiny local database.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Automatic rollback if the device either fails to boot, or the Mender daemon cannot connect to the Mender server afterwards.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Relatively easy to [https://docs.mender.io/Artifacts/Building-Mender-Yocto-image build with Yocto]. More complex if [https://mender.io/blog/porting-mender-to-a-non-yocto-build-system not using Yocto].&lt;br /&gt;
;Downtime&lt;br /&gt;
: Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime.&lt;br /&gt;
;Security&lt;br /&gt;
: Secure connection to the server (TLS). Signing not currently supported, but planned.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21947</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21947"/>
		<updated>2016-12-09T15:04:35Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
Some talks at Embedded Linux Conference presented an overview of the current mechanisms:&lt;br /&gt;
* How do you update your embedded Linux devices? by Daniel Sangorrin / Keijiro Yano http://events.linuxfoundation.org/sites/events/files/slides/linuxcon-japan-2016-softwre-updates-sangorrin.pdf&lt;br /&gt;
* Comparison of Linux Software Update Technologies by Matt Porter http://events.linuxfoundation.org/sites/events/files/slides/Comparison%20of%20Linux%20Software%20Update%20Technologies_0.pdf. Video at https://youtu.be/pdHV9H9nZks?list=PLbzoR-pLrL6pRFP6SOywVJWdEHlmQE51q. Full paper done for Automotive Grade Linux (AGL) here: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-May/002061.html&lt;br /&gt;
* Software update for IoT: the current state of play by Chris Simmonds http://de.slideshare.net/chrissimmonds/software-update-for-iot-the-current-state-of-play&lt;br /&gt;
* OSS Remote Firmware Updates for IoT-like Projects by Silvano Cirujano Cuesta http://events.linuxfoundation.org/sites/events/files/slides/OSS_Remote_Firmware_Updates_for_IoT-like_Projects.pdf&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dependencies on boot loader, number and kind of partitions, etc. Flexible mechanisms make no or only few assumptions about the system, but typically then require additional work to integrate with a specific setup.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible&lt;br /&gt;
| read/write&lt;br /&gt;
| HTTP(S) server, local media&lt;br /&gt;
| depends on setup&lt;br /&gt;
| relatively stable, under active development&lt;br /&gt;
| [http://git.yoctoproject.org/cgit/cgit.cgi/meta-swupd meta-swupd]&lt;br /&gt;
| moderate, suitable for frequent updates&lt;br /&gt;
| minimal download, needs sufficient free space in rootfs&lt;br /&gt;
| favors fast updates over failure resilience&lt;br /&gt;
| some planning required&lt;br /&gt;
| minimal, reboot optional&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Signed update data, HTTPS transfer protection.&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/sbabic/swupdate sbabic&#039;s swupdate]&lt;br /&gt;
| block-based&lt;br /&gt;
| flexible&lt;br /&gt;
| depends on setup&lt;br /&gt;
| local and remote (plain HTTP(S) or custom server)&lt;br /&gt;
| depends on setup&lt;br /&gt;
| Code relatively stable, 3 months release cycle&lt;br /&gt;
| [https://github.com/sbabic/meta-swupdate meta-swupdate]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| no builtin mechanism, to be added as part of system&lt;br /&gt;
| easy to use (but requires customization!?)&lt;br /&gt;
| reboot required&lt;br /&gt;
| signed and encrypted images, HTTPS&lt;br /&gt;
|-&lt;br /&gt;
! [https://mender.io/ Mender]&lt;br /&gt;
| block-based&lt;br /&gt;
| fixed&lt;br /&gt;
| conceptually read-only&lt;br /&gt;
| remote&lt;br /&gt;
| Complete rootfs, including kernel.&lt;br /&gt;
| in development&lt;br /&gt;
| [https://github.com/mendersoftware/meta-mender meta-mender]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| integrated rollback&lt;br /&gt;
| easy when using meta-mender&lt;br /&gt;
| reboot required&lt;br /&gt;
| HTTPS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TODO: add OSTree (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10704)&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: swupd updates files in a single partition. Other than that, it makes no assumptions about disk layout, filesystem and boot mechanism.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Files provided by the OS are read-only, everything else is read/write (/etc, /var) and preserved during updates. OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
;Updates from&lt;br /&gt;
: Uses libcurl to fetch update data and thus supports all URL schemes supported by libcurl, in particular http(s) and local files.&lt;br /&gt;
;Updates what&lt;br /&gt;
: swupd itself updates files in the rootfs, other components then need to be updated (boot loader, kernel, firmware, ...) then need be updated via custom plugins.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Used and maintained in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype). Code changes not written for Clear Linux OS tend to get merged only slowly.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Layer available, not part of Yocto releases, experimental. Supports building incremental updates (= only changes since last build are stored for new build) and deltas (= optimized update pack for specific previous builds, typically major milestones).&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). When using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs. Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left. Updating files while system services are running reduces downtime, but is also more risky if system services aren&#039;t prepared for it. Could be extended to do updates without that risk, at the expense of increased downtime.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Upgrade path must be considered as part of release process (deltas, incompatible changes).&lt;br /&gt;
;Downtime&lt;br /&gt;
: Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot depending on what was updated (not automated at the moment in meta-swupd layer).&lt;br /&gt;
;Security&lt;br /&gt;
: Compatible with Linux IMA, Smack, SELinux. Conceptually incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of update data (not integrated into meta-swupd yet).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== babic&#039;s SWUpdate ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: There is no constraint how software is stored. SWUPdate supports raw flash (NOR, NAND), UBI volumes, disk partitions or can update files (provided in a tarball) into an existing filesystem. Each artifact can be stored on a different storage device.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: No constrain where software is stored. During an update, a single partition, multiple partitions or generically multiple different storages can be updated.&lt;br /&gt;
:&lt;br /&gt;
: SWUpdate is often used in one of the following setup:&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : The system reboots in maintenance mode and SWUpdate is started from a Ramdisk. Just one copy of the Software is stored into the system.&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : two copies of the software (rootfs, kernel) are stored into the system and SWUpdate installs the stand-by copy.&lt;br /&gt;
;Updates from&lt;br /&gt;
:&lt;br /&gt;
:* local provisioning : USB, SD, etc.&lt;br /&gt;
:* generic URL : HTTP(S), FTP. It uses the libcurl library and supports what libcurl provides.&lt;br /&gt;
:* Webserver : SWUpdate integrates a Webserver (moongoose)&lt;br /&gt;
:* External Backend connector (suricatta mode) to bind with an external backend server. Currently, the Hawkbit server is supported https://github.com/eclipse/hawkbit. Open to further backends.&lt;br /&gt;
;Updates what&lt;br /&gt;
:&lt;br /&gt;
:* bootloader (risky !)&lt;br /&gt;
:* kernel&lt;br /&gt;
:* interface to bootloader (U-Boot) Allows to change u-boot variables and allow to use plugins to make changes to other bootloaders.&lt;br /&gt;
;* disk partitions&lt;br /&gt;
;* provide interface to update FPGAs, external microcontrollers, etc.&lt;br /&gt;
;* custom handlers: an interface allows to add own installers written in C or in LUA.&lt;br /&gt;
;Resources on client&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : meta-swupdate provides recipe to generate a compressed ramdisk with small footprint. Including support for signed image, the whole rootfs is ~4MB. The minimal requirement for a complete rescue (bootloader, kernel for SWUpdate and ramdisk) is 8MB. This allows to put the rescue in a small storage like a SPI-NOR, while the software is stored on another and bigger device (NAND, eMMC).&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. No additional space is required if the image is directly streamed to the stand-by copy.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: There are no recovery mechanism built in. If the bootloader has the capability to check if a boot failed, it could boot in maintenance mode again.&lt;br /&gt;
; Downtime&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : There is need to reboot in maintenance mode and once the image is installed, needs to reboot again with the new production image. &lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; :  Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime. &lt;br /&gt;
;Security&lt;br /&gt;
:&lt;br /&gt;
:* Connection with HTTPS to the external the server.&lt;br /&gt;
:* Signed images : it is possible to sign the images used for the update in order to check its integrity.&lt;br /&gt;
:* Split in several processes: connection to the internet can run with a different userid / groupid as the installer. The installer runs often with high privileges because it has to write the hardware.&lt;br /&gt;
:* Support for encrypted artifacts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mender ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dual rootfs partitions with two extra partitions, a boot and a data partition.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Stored in one active and one passive partition, read/write while in use, but modifications to it get lost during updates when switching partitions. Kernel is stored on rootfs.&lt;br /&gt;
; Updates from&lt;br /&gt;
: Mender server and/or HTTPS server&lt;br /&gt;
;Code stability&lt;br /&gt;
: Master branch under development. There is a stable branch, but it&#039;s lacking many basic features.&lt;br /&gt;
;Resources on server&lt;br /&gt;
: Needs to store one compressed rootfs image for each update, plus small meta data section.&lt;br /&gt;
;Resources on client&lt;br /&gt;
: Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. Needs no additional space on device beyond the partitions, space for the Mender binary, and a tiny local database.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Automatic rollback if the device either fails to boot, or the Mender daemon cannot connect to the Mender server afterwards.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Relatively easy to [https://docs.mender.io/Artifacts/Building-Mender-Yocto-image build with Yocto]. More complex if [https://mender.io/blog/porting-mender-to-a-non-yocto-build-system not using Yocto].&lt;br /&gt;
;Downtime&lt;br /&gt;
: Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime.&lt;br /&gt;
;Security&lt;br /&gt;
: Secure connection to the server (TLS). Signing not currently supported, but planned.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21946</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21946"/>
		<updated>2016-12-09T14:48:23Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: summary in table, details in sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
A similar comparison was done for Automotive Grade Linux (AGL) here: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-May/002061.html&lt;br /&gt;
&lt;br /&gt;
Some talks at Embedded Linux Conference presented an overview of the current mechanisms:&lt;br /&gt;
* How do you update your embedded Linux devices? by Daniel Sangorrin / Keijiro Yano http://events.linuxfoundation.org/sites/events/files/slides/linuxcon-japan-2016-softwre-updates-sangorrin.pdf&lt;br /&gt;
* Comparison of Linux Software Update Technologies by Matt Porter http://events.linuxfoundation.org/sites/events/files/slides/Comparison%20of%20Linux%20Software%20Update%20Technologies_0.pdf. Video at https://youtu.be/pdHV9H9nZks?list=PLbzoR-pLrL6pRFP6SOywVJWdEHlmQE51q&lt;br /&gt;
* Software update for IoT: the current state of play by Chris Simmonds http://de.slideshare.net/chrissimmonds/software-update-for-iot-the-current-state-of-play&lt;br /&gt;
* OSS Remote Firmware Updates for IoT-like Projects by Silvano Cirujano Cuesta http://events.linuxfoundation.org/sites/events/files/slides/OSS_Remote_Firmware_Updates_for_IoT-like_Projects.pdf&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dependencies on boot loader, number and kind of partitions, etc. Flexible mechanisms make no or only few assumptions about the system, but typically then require additional work to integrate with a specific setup.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| flexible&lt;br /&gt;
| read/write&lt;br /&gt;
| HTTP(S) server, local media&lt;br /&gt;
| depends on setup&lt;br /&gt;
| relatively stable, under active development&lt;br /&gt;
| [http://git.yoctoproject.org/cgit/cgit.cgi/meta-swupd meta-swupd]&lt;br /&gt;
| moderate, suitable for frequent updates&lt;br /&gt;
| minimal download, needs sufficient free space in rootfs&lt;br /&gt;
| favors fast updates over failure resilience&lt;br /&gt;
| some planning required&lt;br /&gt;
| minimal, reboot optional&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Signed update data, HTTPS transfer protection.&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/sbabic/swupdate sbabic&#039;s swupdate]&lt;br /&gt;
| block-based&lt;br /&gt;
| flexible&lt;br /&gt;
| depends on setup&lt;br /&gt;
| local and remote (plain HTTP(S) or custom server)&lt;br /&gt;
| depends on setup&lt;br /&gt;
| Code relatively stable, 3 months release cycle&lt;br /&gt;
| [https://github.com/sbabic/meta-swupdate meta-swupdate]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| no builtin mechanism, to be added as part of system&lt;br /&gt;
| easy to use (but requires customization!?)&lt;br /&gt;
| reboot required&lt;br /&gt;
| signed and encrypted images, HTTPS&lt;br /&gt;
|-&lt;br /&gt;
! [https://mender.io/ Mender]&lt;br /&gt;
| block-based&lt;br /&gt;
| fixed&lt;br /&gt;
| conceptually read-only&lt;br /&gt;
| remote&lt;br /&gt;
| Complete rootfs, including kernel.&lt;br /&gt;
| in development&lt;br /&gt;
| [https://github.com/mendersoftware/meta-mender meta-mender]&lt;br /&gt;
| archives full image per build&lt;br /&gt;
| download and write full image&lt;br /&gt;
| integrated rollback&lt;br /&gt;
| easy when using meta-mender&lt;br /&gt;
| reboot required&lt;br /&gt;
| HTTPS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TODO: add OSTree (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10704)&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: swupd updates files in a single partition. Other than that, it makes no assumptions about disk layout, filesystem and boot mechanism.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Files provided by the OS are read-only, everything else is read/write (/etc, /var) and preserved during updates. OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
;Updates from&lt;br /&gt;
: Uses libcurl to fetch update data and thus supports all URL schemes supported by libcurl, in particular http(s) and local files.&lt;br /&gt;
;Updates what&lt;br /&gt;
: swupd itself updates files in the rootfs, other components then need to be updated (boot loader, kernel, firmware, ...) then need be updated via custom plugins.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Used and maintained in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype). Code changes not written for Clear Linux OS tend to get merged only slowly.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Layer available, not part of Yocto releases, experimental. Supports building incremental updates (= only changes since last build are stored for new build) and deltas (= optimized update pack for specific previous builds, typically major milestones).&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). When using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs. Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left. Updating files while system services are running reduces downtime, but is also more risky if system services aren&#039;t prepared for it. Could be extended to do updates without that risk, at the expense of increased downtime.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Upgrade path must be considered as part of release process (deltas, incompatible changes).&lt;br /&gt;
;Downtime&lt;br /&gt;
: Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot depending on what was updated (not automated at the moment in meta-swupd layer).&lt;br /&gt;
;Security&lt;br /&gt;
: Compatible with Linux IMA, Smack, SELinux. Conceptually incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of update data (not integrated into meta-swupd yet).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== babic&#039;s SWUpdate ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: There is no constraint how software is stored. SWUPdate supports raw flash (NOR, NAND), UBI volumes, disk partitions or can update files (provided in a tarball) into an existing filesystem. Each artifact can be stored on a different storage device.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: No constrain where software is stored. During an update, a single partition, multiple partitions or generically multiple different storages can be updated.&lt;br /&gt;
:&lt;br /&gt;
: SWUpdate is often used in one of the following setup:&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : The system reboots in maintenance mode and SWUpdate is started from a Ramdisk. Just one copy of the Software is stored into the system.&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : two copies of the software (rootfs, kernel) are stored into the system and SWUpdate installs the stand-by copy.&lt;br /&gt;
;Updates from&lt;br /&gt;
:&lt;br /&gt;
:* local provisioning : USB, SD, etc.&lt;br /&gt;
:* generic URL : HTTP(S), FTP. It uses the libcurl library and supports what libcurl provides.&lt;br /&gt;
:* Webserver : SWUpdate integrates a Webserver (moongoose)&lt;br /&gt;
:* External Backend connector (suricatta mode) to bind with an external backend server. Currently, the Hawkbit server is supported https://github.com/eclipse/hawkbit. Open to further backends.&lt;br /&gt;
;Updates what&lt;br /&gt;
:&lt;br /&gt;
:* bootloader (risky !)&lt;br /&gt;
:* kernel&lt;br /&gt;
:* interface to bootloader (U-Boot) Allows to change u-boot variables and allow to use plugins to make changes to other bootloaders.&lt;br /&gt;
;* disk partitions&lt;br /&gt;
;* provide interface to update FPGAs, external microcontrollers, etc.&lt;br /&gt;
;* custom handlers: an interface allows to add own installers written in C or in LUA.&lt;br /&gt;
;Resources on client&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : meta-swupdate provides recipe to generate a compressed ramdisk with small footprint. Including support for signed image, the whole rootfs is ~4MB. The minimal requirement for a complete rescue (bootloader, kernel for SWUpdate and ramdisk) is 8MB. This allows to put the rescue in a small storage like a SPI-NOR, while the software is stored on another and bigger device (NAND, eMMC).&lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; : Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. No additional space is required if the image is directly streamed to the stand-by copy.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: There are no recovery mechanism built in. If the bootloader has the capability to check if a boot failed, it could boot in maintenance mode again.&lt;br /&gt;
; Downtime&lt;br /&gt;
:&lt;br /&gt;
:* &#039;&#039;&#039;rescue&#039;&#039;&#039; : There is need to reboot in maintenance mode and once the image is installed, needs to reboot again with the new production image. &lt;br /&gt;
:* &#039;&#039;&#039;dual-copy&#039;&#039;&#039; :  Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime. &lt;br /&gt;
;Security&lt;br /&gt;
:&lt;br /&gt;
:* Connection with HTTPS to the external the server.&lt;br /&gt;
:* Signed images : it is possible to sign the images used for the update in order to check its integrity.&lt;br /&gt;
:* Split in several processes: connection to the internet can run with a different userid / groupid as the installer. The installer runs often with high privileges because it has to write the hardware.&lt;br /&gt;
:* Support for encrypted artifacts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mender ==&lt;br /&gt;
&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Dual rootfs partitions with two extra partitions, a boot and a data partition.&lt;br /&gt;
;Rootfs&lt;br /&gt;
: Stored in one active and one passive partition, read/write while in use, but modifications to it get lost during updates when switching partitions. Kernel is stored on rootfs.&lt;br /&gt;
; Updates from&lt;br /&gt;
: Mender server and/or HTTPS server&lt;br /&gt;
;Code stability&lt;br /&gt;
: Master branch under development. There is a stable branch, but it&#039;s lacking many basic features.&lt;br /&gt;
;Resources on server&lt;br /&gt;
: Needs to store one compressed rootfs image for each update, plus small meta data section.&lt;br /&gt;
;Resources on client&lt;br /&gt;
: Needs active/passive rootfs partition, and bandwidth to download compressed rootfs image. Needs no additional space on device beyond the partitions, space for the Mender binary, and a tiny local database.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Automatic rollback if the device either fails to boot, or the Mender daemon cannot connect to the Mender server afterwards.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Relatively easy to [https://docs.mender.io/Artifacts/Building-Mender-Yocto-image build with Yocto]. More complex if [https://mender.io/blog/porting-mender-to-a-non-yocto-build-system not using Yocto].&lt;br /&gt;
;Downtime&lt;br /&gt;
: Update is downloaded and applied during normal operation. Afterwards one reboot is required, no other downtime.&lt;br /&gt;
;Security&lt;br /&gt;
: Secure connection to the server (TLS). Signing not currently supported, but planned.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21871</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21871"/>
		<updated>2016-12-06T09:43:05Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
A similar comparison was done for Automotive Grade Linux (AGL) here: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-May/002061.html&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| Files in the rootfs, boot loader and kernel via plugins&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Upgrade path must be considered as part of release process (deltas, incompatible changes)&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of downloaded files.&lt;br /&gt;
|-&lt;br /&gt;
! [https://github.com/sbabic/swupdate sbabic&#039;s swupdate]&lt;br /&gt;
| block-based&lt;br /&gt;
| A complete partition. Arbitrary disk layout, kernel, filesystem and boot mechanism.&lt;br /&gt;
| Read only. Partiton must not be mounted. Device must boot from maintenance image (could be in another partition in the same disk).&lt;br /&gt;
| Local provisioning of image file or use mongoose HTTP server.&lt;br /&gt;
| Complete partition. Allows to change u-boot variables and allow to use plugins to make changes to other bootloaders.&lt;br /&gt;
| Code relatively stable, but there is only a master branch and no versioning.&lt;br /&gt;
| [https://github.com/sbabic/meta-swupdate meta-swupdate] (Not part of the Yocto project).&lt;br /&gt;
| Just need to build the update image and package it with a configuration file (sw-description).&lt;br /&gt;
| It needs to have at least two partition; production and maintenance. To perform the update it requires to download the image file to the maintenance partition, so it requires the maintenance partition needs to be big enough to hold the image file.&lt;br /&gt;
| There are no recovery mechanism built in. If the bootloader has the capability to check if a boot failed, it could boot in maintenance mode again.&lt;br /&gt;
| This updater is very easy to use and setup, even if not using the OE layer.&lt;br /&gt;
| There is need to reboot in maintenance mode and once the image is installed, needs to reboot again with the new production image.&lt;br /&gt;
| It is possible to sign the images used for the update in order to check its integrity.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TODO: add OSTree (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10704) and mender.io (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10703)&lt;br /&gt;
TODO: move text from table into the sections of the individual mechanisms to keep the table short. Perhaps just keep a rating (&amp;quot;low/middle/high complexity&amp;quot;) above in some of the columns? Rating would be relative to each other.&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
TODO: when using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs.&lt;br /&gt;
&lt;br /&gt;
== SWUpdate ==&lt;br /&gt;
&lt;br /&gt;
TODO: additional explanations?&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21816</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21816"/>
		<updated>2016-12-01T07:42:33Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
A similar comparison was done for Automotive Grade Linux (AGL) here: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-May/002061.html&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| Files in the rootfs, boot loader and kernel via plugins&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Upgrade path must be considered as part of release process (deltas, incompatible changes)&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of downloaded files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TODO: add OSTree (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10704) and mender.io (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10703)&lt;br /&gt;
TODO: move text from table into the sections of the individual mechanisms to keep the table short. Perhaps just keep a rating (&amp;quot;low/middle/high complexity&amp;quot;) above in some of the columns? Rating would be relative to each other.&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
TODO: when using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21664</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21664"/>
		<updated>2016-11-28T12:54:52Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Comparison */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| Files in the rootfs, boot loader and kernel via plugins&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Upgrade path must be considered as part of release process (deltas, incompatible changes)&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of downloaded files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TODO: add OSTree (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10704) and mender.io (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10703)&lt;br /&gt;
TODO: move text from table into the sections of the individual mechanisms to keep the table short. Perhaps just keep a rating (&amp;quot;low/middle/high complexity&amp;quot;) above in some of the columns? Rating would be relative to each other.&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
TODO: when using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21663</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21663"/>
		<updated>2016-11-28T12:51:53Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Comparison */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, security track record in existing deployments, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others (usability). Also includes how difficult is to set up the mechanism because of dependencies.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| Files in the rootfs, boot loader and kernel via plugins&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Upgrade path must be considered as part of release process (deltas, incompatible changes)&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of downloaded files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TODO: add OSTree (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10704) and mender.io (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10703)&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
TODO: when using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21636</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21636"/>
		<updated>2016-11-25T10:04:27Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Comparison */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| Files in the rootfs, boot loader and kernel via plugins&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Upgrade path must be considered as part of release process (deltas, incompatible changes)&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of downloaded files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TODO: add OSTree (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10704) and mender.io (https://bugzilla.yoctoproject.org/show_bug.cgi?id=10703)&lt;br /&gt;
&lt;br /&gt;
== swupd ==&lt;br /&gt;
&lt;br /&gt;
TODO: when using swupd purely as update mechanism (i.e. no bundles), space requirement on the server could be reduced to linear with the number of modified files by not creating the zero packs.&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21629</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21629"/>
		<updated>2016-11-24T20:34:53Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: added complexity and &amp;quot;updates what&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Updates what&lt;br /&gt;
: describes which parts of the overall system the mechanism updates.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Complexity&lt;br /&gt;
: Some mechanisms are harder to use correctly than others.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates what&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Complexity&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| Files in the rootfs, boot loader and kernel via plugins&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Upgrade path must be considered as part of release process (deltas, incompatible changes)&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of downloaded files.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21627</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21627"/>
		<updated>2016-11-24T20:16:30Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Comparison */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of downloaded files.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21625</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21625"/>
		<updated>2016-11-24T20:06:11Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Comparison */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition has to be the same for all devices and that devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of downloaded files.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21612</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21612"/>
		<updated>2016-11-24T16:18:29Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition cannot be changed locally. Devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [https://clearlinux.org/documentation/swupdate_about_sw_update.html swupd]&lt;br /&gt;
| file-based&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture signing] to protect integrity of downloaded files.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21611</id>
		<title>System Update</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=System_Update&amp;diff=21611"/>
		<updated>2016-11-24T16:17:17Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: Created page with &amp;quot;== Introduction ==  This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will supp...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page compares different system update mechanisms. The purpose is to help the project with picking a suitable mechanism that the project then will support going forward. Users may find this page relevant for picking a mechanism that suits their specific needs.&lt;br /&gt;
&lt;br /&gt;
A system update mechanism must ensure that a device running an older release of the operating systems runs with a more recent release when the update mechanism is done. This includes updating everything that defines the system (rootfs, kernel, bootloader, etc.), restarting running processes and potentially a reboot. An ideal mechanism:&lt;br /&gt;
* never ends up in an inconsistent state (atomic update),&lt;br /&gt;
* always keeps the device usable (fallback to previous state when there are problems, or at least supporting a recovery mode),&lt;br /&gt;
* requires little additional resources (disk space, RAM),&lt;br /&gt;
* minimizes downtime while updating,&lt;br /&gt;
* works in combination with security technology (integrity protection),&lt;br /&gt;
* is secure (does not install or execute software created by an attacker).&lt;br /&gt;
&lt;br /&gt;
These are conflicting requirements. Different mechanisms will have different strengths and weaknesses. Therefore the first chapter provides a more detailed definition of the different aspects and has a table comparing the mechanisms. The following sections then describe each mechanism in more detail.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
;Type&lt;br /&gt;
: &#039;&#039;Block-based&#039;&#039; update mechanisms directly modify blocks in the partition(s) that they update, without going through the filesystem. This implies that the partition cannot be changed locally. Devices must use exactly the same partition size. &#039;&#039;File-based&#039;&#039; update mechanisms modify files and directories. Therefore devices with different partition sizes can use the same update data and it may be possible to update without a reboot.&lt;br /&gt;
;Disk layout&lt;br /&gt;
: Boot loader, number and kind of partitions, ...&lt;br /&gt;
;Rootfs&lt;br /&gt;
: The partition which contains the OS. May be strictly read-only (block-based update mechanisms) or read/write (file-based). Some update mechanisms support installing and updating a subset of the full OS.&lt;br /&gt;
;Updates from&lt;br /&gt;
: describes from where the update mechanism gets the update.&lt;br /&gt;
;Code stability&lt;br /&gt;
: Based on how long the code has been in use, personal experience, etc.&lt;br /&gt;
;OE/Yocto integration&lt;br /&gt;
: Whether the mechanism is already available and who supports it.&lt;br /&gt;
;Resource requirements on server&lt;br /&gt;
: affect both build time and long-term storage capacity. Likely to depend on the complexity of the changes.&lt;br /&gt;
;Resource requirements on client&lt;br /&gt;
: Amount of temporary disk space, CPU/network load, ..., again for different scenarios.&lt;br /&gt;
;Failure resilience&lt;br /&gt;
: Summarizes how the mechanism copes with potential problems.&lt;br /&gt;
;Downtime&lt;br /&gt;
: How long normal operation of the device needs to be interrupted for an update.&lt;br /&gt;
;Security&lt;br /&gt;
: Compatibility with other technology, protection of the update mechanism itself.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Mechanism&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Type&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Disk layout&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Rootfs&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Updates from&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Code stability&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|OE/Yocto integration&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;|Resource requirements&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Failure resilience&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Downtime&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot;|Security&lt;br /&gt;
|-&lt;br /&gt;
! on server&lt;br /&gt;
! on client&lt;br /&gt;
|-&lt;br /&gt;
! [swupd https://clearlinux.org/documentation/swupdate_about_sw_update.html]&lt;br /&gt;
| file-based&lt;br /&gt;
| HTTP(S) server&lt;br /&gt;
| All files in a single partition. Arbitrary disk layout, filesystem and boot mechanism.&lt;br /&gt;
| Read/write. Files provided by the OS are read-only, everything else is read/write (/etc, /var). OS can be split up into a core OS (always installed) and optional bundles which may or may not be installed.&lt;br /&gt;
| Used in Clear Linux OS. Code relatively stable, but would benefit from a rewrite (evolved from a prototype).&lt;br /&gt;
| meta-swupd (work in progress, not part of the Yocto project). No support for automatically updating at the moment.&lt;br /&gt;
| Build time and storage for each update linear with total number of files (file system analysis, zero packs) plus linear with number of modified files (compression). Optionally can prepare deltas from certain previous builds, which is linear with the number of modified files since each of those builds.&lt;br /&gt;
| In the best case (delta prepared by server), a single archive with just some file diffs gets downloaded, unpacked and applied. In other cases, each new or modified file gets downloaded and unpacked. Staging new content needs free space in the rootfs partition, i.e. partition must be at least twice as large as the base OS.&lt;br /&gt;
| No recovery mechanism built into swupd itself. Short period of time where interrupted update may leave behind inconsistent rootfs. No updates possible when there is not enough free space left.&lt;br /&gt;
| Downloading and staging in parallel to normal operation. Services are kept running until after the update, at which point the device admin needs to restart services or reboot (needs to be automated).&lt;br /&gt;
| Compatible with Linux IMA, Smack, SELinux. Incompatible with dm-verity. Relies on HTTPS and (optionally) [signing https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel%C2%AE-architecture] to protect integrity of downloaded files.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Projects&amp;diff=21610</id>
		<title>Projects</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Projects&amp;diff=21610"/>
		<updated>2016-11-24T11:51:54Z</updated>

		<summary type="html">&lt;p&gt;Patrick Ohly: /* Welcome to the Projects Page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to the Projects Page ==&lt;br /&gt;
* [[AutoBuilder]]&lt;br /&gt;
* [[Poky]]&lt;br /&gt;
* [[Eclipse Plug-in]]&lt;br /&gt;
* [[Anjuta Plug-in]]&lt;br /&gt;
* [[Pseudo]]&lt;br /&gt;
* [[Cross-Prelink]]&lt;br /&gt;
* [[QA]]&lt;br /&gt;
* [[Documentation]]&lt;br /&gt;
* [[BSPs]]&lt;br /&gt;
* [[Tracing and Profiling]]&lt;br /&gt;
* Linux Kernel&lt;br /&gt;
** [[Linux_Kernel/Boot_Time|Boot Time]]&lt;br /&gt;
** [[Linux_kernel/Image_Size|Image Size]]&lt;br /&gt;
* [[Multilib]]&lt;br /&gt;
* [[BitBake/GUI|BitBake GUI&#039;s]]&lt;br /&gt;
* [[x32 abi]]&lt;br /&gt;
* [[Build Appliance Design]]&lt;br /&gt;
* [[Toaster]]&lt;br /&gt;
* [[OpenGL pass-through in QEMU]]&lt;br /&gt;
* [[Running an x86 Yocto Linux image under QEMU KVM]]&lt;br /&gt;
* [[Web Application for Interactive Kiosk Devices]]&lt;br /&gt;
* [[Virtualization with KVM]]&lt;br /&gt;
* [[Poky-Tiny]]&lt;br /&gt;
* [[System Update]]&lt;br /&gt;
* [[Wayland]]&lt;br /&gt;
&lt;br /&gt;
== Archived Projects ==&lt;br /&gt;
* [[SDK Generator]]&lt;br /&gt;
* [[Hob2 (Hob v2)]]&lt;br /&gt;
* [[DLNA Media Server Virtual Appliance]]&lt;br /&gt;
* [[Swabber]]&lt;br /&gt;
* [[Baryon]]&lt;br /&gt;
* [[ELC2013kiosk_demo]]&lt;/div&gt;</summary>
		<author><name>Patrick Ohly</name></author>
	</entry>
</feed>