-
Notifications
You must be signed in to change notification settings - Fork 0
Persistence
Version 7.0 introduces a new persistent-files service, enhancing how configurations and data persist across boots. This addition requires a dedicated mount point for /var/prstnt
, alongside traditional mount points such as /boot
and /home
. Below, we outline the differences between earlier versions and 7.0, and provide clear instructions for setting up persistent storage.
-
Mount Points:
- The typical setup included mount points for
/boot
and/home
. - These mount points functioned as expected, but there was no service to specifically manage persistence for individual files.
- The typical setup included mount points for
-
Persistence:
- Files persisted implicitly based on the contents of the
/home
directory or other user-defined partitions.
- Files persisted implicitly based on the contents of the
-
Persistent-Files Service:
- Introduces fine-grained control over file persistence. Specific files must be explicitly listed in configuration files under
/etc/persistent-files.d/
. - Files not explicitly listed are not retained across boots, even if they reside in
/var/prstnt
or other monitored directories.
- Introduces fine-grained control over file persistence. Specific files must be explicitly listed in configuration files under
-
New Mount Point for
/var/prstnt
:- A dedicated EXT4 partition mounted at
/var/prstnt
is required to store persistent files managed by thepersistent-files
service. - Existing mount points for
/boot
and/home
remain unchanged.
- A dedicated EXT4 partition mounted at
To configure the required mount points, update your thinstation.conf.buildtime
file as follows:
MOUNT_0="LABEL=boot /boot auto x-mount.mkdir,defaults 0 0"
MOUNT_1="LABEL=home /home auto x-mount.mkdir,defaults 0 0"
MOUNT_2="LABEL=prstnt /var/prstnt auto x-mount.mkdir,defaults 0 0"
-
Explanation:
-
LABEL=boot
: For the boot partition (FAT32). Needed if booting from flash or hd -
LABEL=home
: For the home partition (EXT4). Needed if you want user settings to persist -
LABEL=prstnt
: A new EXT4 partition dedicated to the persistent-files service.
-
- Example, create three partitions:
-
FAT32 labeled
boot
. -
EXT4 labeled
home
. -
EXT4 labeled
prstnt
.
-
FAT32 labeled
- The
/ts/bin/flash
script can automate this process if the drive is installed in the build system.
-
File-Based Persistence:
- The
persistent-files
service requires explicit definitions of files to persist. - Create configuration files under
/build/packages/mypackage/etc/persistent-files.d/
, naming them descriptively (e.g.,mypackage.conf
).
Example:
/build/packages/mypackage/etc/persistent-files.d/mypackage.conf
/etc/myapp/config.ini
- The
-
Granular File Control:
- Persistence is determined by file paths listed in the configuration files.
- Directory monitoring does not persist all contents by default; only the explicitly listed files will persist.
-
Verify Setup:
- After setup, ensure
/var/prstnt
is mounted and files specified in/etc/persistent-files.d/
persist across reboots.
- After setup, ensure
-
Mount Points:
- Confirm
/var/prstnt
,/boot
, and/home
are correctly mounted using themount
command or inspecting/etc/fstab
.
- Confirm
-
File Persistence:
- Reboot the system and verify that only the files listed in
/etc/persistent-files.d/
are retained across boots.
- Reboot the system and verify that only the files listed in
-
Backward Compatibility:
- For systems upgraded from earlier versions, ensure that a
/var/prstnt
partition is created and configured. - Without this mount point, the
persistent-files
service will not function correctly in version 7.0.
- For systems upgraded from earlier versions, ensure that a
-
Advanced Mount Points:
- Additional partitions can be defined using the same syntax in
thinstation.conf.buildtime
.
- Additional partitions can be defined using the same syntax in
-
Legacy Behavior:
- Mount points like
/boot
and/home
still operate as they did in prior versions, but persistence for specific files now depends on thepersistent-files
service.
- Mount points like
With these instructions, you can seamlessly transition from earlier versions to 7.0 while taking advantage of the enhanced persistent file management system.