Enable local persistent storage
Machine-specific data, such as SSH keys, should not be included in the immutable root filesystem image, as this would prevent multiple machines running from the same image. These few files can be stored locally, on the SD card on eMMC flash. The first time a machine boots up using this image, its local storage is initialized. This involves creating a new filesystem on the block device and generating SSH host keys. Once the storage is initialized, it is remounted read-only. All subsequent mounts are read-only as well.
This commit is contained in:
16
overlay/etc/systemd/system/init-localstorage.service
Normal file
16
overlay/etc/systemd/system/init-localstorage.service
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Initialize Local Storage
|
||||
DefaultDependencies=no
|
||||
After=local-fs-pre.target
|
||||
After=run-storage.mount
|
||||
Before=etc-ssh.mount
|
||||
Before=local-fs.target
|
||||
Conflicts=shutdown.target
|
||||
ConditionPathExists=!/run/storage/ssh
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/libexec/init-localstorage.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=run-storage.mount
|
||||
@@ -0,0 +1 @@
|
||||
../init-localstorage.service
|
||||
Reference in New Issue
Block a user