summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
index 1a0328d63e..bd445ddb07 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
@@ -31,8 +31,13 @@ if [ "$1" = "start" ] ; then
31 if [ `is_on_read_only_partition /var/lib` = "yes" ]; then 31 if [ `is_on_read_only_partition /var/lib` = "yes" ]; then
32 grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile 32 grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile
33 mkdir -p /var/volatile/lib 33 mkdir -p /var/volatile/lib
34 cp -a /var/lib/* /var/volatile/lib 34 mkdir -p /var/volatile/.lib-work
35 mount --bind /var/volatile/lib /var/lib 35 # Try to mount using overlay, which is much faster than copying
36 # files. If that fails, fallback to the slower copy
37 if ! mount -t overlay overlay -olowerdir=/var/lib,upperdir=/var/volatile/lib,workdir=/var/volatile/.lib-work /var/lib > /dev/null 2>&1; then
38 cp -a /var/lib/* /var/volatile/lib
39 mount --bind /var/volatile/lib /var/lib
40 fi
36 fi 41 fi
37fi 42fi
38 43