summaryrefslogtreecommitdiff
path: root/recipes-core/initrdscripts
diff options
context:
space:
mode:
authorMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2019-12-03 14:43:56 +0000
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-20 19:50:22 +0300
commit5beaf22becf61256e257c0f252692d36ec3b9df2 (patch)
tree26a06edfc00ebb688e7d9fe0c40b294d1d9f9736 /recipes-core/initrdscripts
parentbbdf318b3fe7a16eec94aa527531f1f93e4dee86 (diff)
downloadmeta-mlinux-5beaf22becf61256e257c0f252692d36ec3b9df2.tar.gz
meta-mlinux-5beaf22becf61256e257c0f252692d36ec3b9df2.tar.bz2
meta-mlinux-5beaf22becf61256e257c0f252692d36ec3b9df2.zip
create additional .persistent directory on user_data partition and bind-mount it as /var/persistent.
Diffstat (limited to 'recipes-core/initrdscripts')
-rwxr-xr-xrecipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh b/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh
index fccb40f..7cc23bf 100755
--- a/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh
+++ b/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh
@@ -328,6 +328,13 @@ mount_and_boot() {
$MOUNT -n --move $ROOT_ROMOUNT ${ROOT_MOUNT}/$ROOT_ROMOUNT
$MOUNT -n --move $ROOT_RWMOUNT ${ROOT_MOUNT}/$ROOT_RWMOUNT
+
+ # Create persistent storage directory and bind-mount it as /var/persistent.
+ # The directory name starts with "." so "rm -rf" will skip it on read-write file system reset.
+ mkdir -p ${ROOT_MOUNT}/$ROOT_RWMOUNT/.persistent
+ mkdir -p ${ROOT_MOUNT}/var/persistent
+ $MOUNT -n --bind ${ROOT_MOUNT}/$ROOT_RWMOUNT/.persistent ${ROOT_MOUNT}/var/persistent
+
if ((DO_STOP)) ; then
fatal "Initramfs Shell mode selected -- bash shell"
fi