diff options
Diffstat (limited to 'meta/recipes-core/initscripts/initscripts-1.0')
| -rw-r--r-- | meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh | 19 |
1 files changed, 19 insertions, 0 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 new file mode 100644 index 0000000000..3a295eea0b --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | . /etc/default/rcS | ||
| 4 | |||
| 5 | [ "$ROOTFS_READ_ONLY" = "no" ] && exit 0 | ||
| 6 | |||
| 7 | # Make sure unionfs is in /proc/filesystems | ||
| 8 | if ! grep -q unionfs /proc/filesystems; then | ||
| 9 | echo "ERROR: unionfs not supported by kernel!" | ||
| 10 | exit 1 | ||
| 11 | fi | ||
| 12 | |||
| 13 | mkdir -p /var/volatile/lib | ||
| 14 | mount -t unionfs -o dirs=/var/volatile/lib:/var/lib=ro none /var/lib | ||
| 15 | |||
| 16 | if [ $? != 0 ]; then | ||
| 17 | echo "ERROR: Union mount failed!" | ||
| 18 | exit 1 | ||
| 19 | fi | ||
