Commit 88c54c50 authored by Simon McVittie's avatar Simon McVittie

Move description of application layout to Application Layout

Reviewed-by: default avatarMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Signed-off-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D4054
parent 58a54723
......@@ -686,6 +686,69 @@ allowed by a permissions flag, they must not exist.
are owned by `$uid`, with permissions `u=rwx,og-rwx` for privacy (in
other words, only accessible by the owner or by root).
### Physical layout
The application-visible directories in `/var/Applications` and `/Applications`
are only mount points. Applications' real storage is situated on the general
storage volume, in the following layout:
```
<general storage volume>
├─app-bundles/
│ ├─com.example.MyApp/ (store app-bundle)
│ │ ├─current → version-1.2.2-1 (symbolic link)
│ │ ├─rollback → version-1.0.8-2 (symbolic link)
│ │ ├─version-1.0.8-2/
│ │ │ ├─static/ (subvolume)
│ │ │ │ ├─bin/
│ │ │ │ └─share/ (etc.)
│ │ │ └─variable/ (subvolume)
│ │ │ └─users/
│ │ │ └─1001/
│ │ │ ├─cache/
│ │ │ ├─config/
│ │ │ └─data/ (etc.)
│ │ └─version-1.2.2-1/
│ │ ├─static/ (subvolume)
│ │ └─variable/ (subvolume)
│ └─org.apertis.Frampton/ (store app-bundle)
│ ├─current → version-2.5.1-1 (symbolic link)
│ └─version-2.5.1-1/
│ └─variable/ (subvolume)
… <other directories subvolumes unrelated to application bundles>
```
The `static` and `variable` directories are `btrfs` subvolumes so that they
can be copied using snapshots, while the other directories shown may be
either subvolumes or ordinary directories. The `current` and `rollback`
symbolic links indicate the currently active version, and the version to
which a rollback would move, respectively.
Built-in application bundles do not have a `static` subvolume, because their
static files are part of `/usr` on the read-only operating system volume.
All other filenames in this hierarchy are reserved for the application manager,
which may create temporary directories and symbolic links during its operation.
It must create these in such a way that it can recover from abrupt power loss
at any point, for example by making careful use of POSIX atomic filesystem
operations to implement "transactions".
During normal operation, the subvolumes would be mounted as follows:
```
com.example.MyApp/current/static → /Applications/com.example.MyApp
com.example.MyApp/current/variable → /var/Applications/com.example.MyApp
org.apertis.Frampton/current/variable → /var/Applications/org.apertis.Frampton
```
so that the expected paths such as
`/var/Applications/com.example.MyApp/users/1001/config/` are made available.
Only one subvolume per application is mounted – under normal
circumstances, this will be the one with the highest version. After a
system rollback it might be an older version if the most recent is
unlaunchable.
### Installation and upgrading
Suppose we are installing `com.example.MyApp` version 2, or upgrading
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment