aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
blob: 3a295eea0b66e572b9c6602fe9a4c12905e275c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

. /etc/default/rcS

[ "$ROOTFS_READ_ONLY" = "no" ] && exit 0

# Make sure unionfs is in /proc/filesystems
if ! grep -q unionfs /proc/filesystems; then
    echo "ERROR: unionfs not supported by kernel!"
    exit 1
fi

mkdir -p /var/volatile/lib
mount -t unionfs -o dirs=/var/volatile/lib:/var/lib=ro none /var/lib

if [ $? != 0 ]; then
    echo "ERROR: Union mount failed!"
    exit 1
fi