summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh19
-rw-r--r--meta/recipes-core/initscripts/initscripts_1.0.bb3
2 files changed, 22 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
8if ! grep -q unionfs /proc/filesystems; then
9 echo "ERROR: unionfs not supported by kernel!"
10 exit 1
11fi
12
13mkdir -p /var/volatile/lib
14mount -t unionfs -o dirs=/var/volatile/lib:/var/lib=ro none /var/lib
15
16if [ $? != 0 ]; then
17 echo "ERROR: Union mount failed!"
18 exit 1
19fi
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 69b9bfbe32..68f80346ef 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -28,6 +28,7 @@ SRC_URI = "file://functions \
28 file://sysfs.sh \ 28 file://sysfs.sh \
29 file://device_table.txt \ 29 file://device_table.txt \
30 file://populate-volatile.sh \ 30 file://populate-volatile.sh \
31 file://read-only-rootfs-hook.sh \
31 file://volatiles \ 32 file://volatiles \
32 file://save-rtc.sh \ 33 file://save-rtc.sh \
33 file://GPLv2.patch" 34 file://GPLv2.patch"
@@ -85,6 +86,7 @@ do_install () {
85 install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default 86 install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default
86 install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d 87 install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d
87 install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d 88 install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
89 install -m 0755 ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d
88 install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d 90 install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d
89 install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core 91 install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core
90 92
@@ -116,6 +118,7 @@ do_install () {
116 update-rc.d -r ${D} bootmisc.sh start 55 S . 118 update-rc.d -r ${D} bootmisc.sh start 55 S .
117 update-rc.d -r ${D} sysfs.sh start 02 S . 119 update-rc.d -r ${D} sysfs.sh start 02 S .
118 update-rc.d -r ${D} populate-volatile.sh start 37 S . 120 update-rc.d -r ${D} populate-volatile.sh start 37 S .
121 update-rc.d -r ${D} read-only-rootfs-hook.sh start 41 S .
119 update-rc.d -r ${D} devpts.sh start 38 S . 122 update-rc.d -r ${D} devpts.sh start 38 S .
120 if [ "${TARGET_ARCH}" = "arm" ]; then 123 if [ "${TARGET_ARCH}" = "arm" ]; then
121 update-rc.d -r ${D} alignment.sh start 06 S . 124 update-rc.d -r ${D} alignment.sh start 06 S .