mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
initscripts: fix read-only-rootfs-hook.sh to avoid using unionfs
Unionfs isn't available everywhere, and we can get similar results (if not quite as neatly) by using bind mounts + tmpfs and copying the data over. (From OE-Core rev: 5a8ba93efa554c3b4d3b48ca8d668419a8c77f42) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
cf569f5def
commit
1b7785c537
@@ -4,16 +4,9 @@
|
||||
|
||||
[ "$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
|
||||
if [ "$1" = "start" ] ; then
|
||||
mkdir -p /var/volatile/lib
|
||||
cp -a /var/lib/* /var/volatile/lib
|
||||
mount --bind /var/volatile/lib /var/lib
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user