thoughts on data and backward and forward compatibility

Adriana Kobylak anoo at linux.ibm.com
Fri Nov 8 08:17:50 AEDT 2019


Thanks Brad for putting this together.


> The following are guidelines and examples to help decide the location
> in which you place your data.

For additional details, refer to the FHS - 
https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf


> ---
> /etc
> ---
> Further complicating the process, other applications or users may
> write data here and that data must be “merged” during any
> migration process.

Even further, /etc is mounted as an overlayfs that has its own 
restrictions on renaming/deleting files 
(https://en.wikipedia.org/wiki/OverlayFS). The overlay is either mounted 
over / or /etc depending if you want to preserve the rest of the 
filesystem as read-only.


> —--
> /var/lib/<package>
> —--
> This is dynamic, mutable data.  If your application writes data, it
> should go here (with one exception below).  Just like in /etc, data
> here is also hard to maintain forward and backward compatibility, and
> just like in /etc, applications need to support old and new data
> formats simultaneously or have data migration.  Applications other
> than the consumer or end-users should not modify data here so data
> merging is not required.

The cereal package can be used to store data and supports versioning for 
when changes are desired. Multiple apps already use it in OpenBMC.


More information about the openbmc mailing list