From 5ac87042ecbabc8903cb3251b52696baec77ba15 Mon Sep 17 00:00:00 2001 From: Rizal Martin <49640119+rizalmart@users.noreply.github.com> Date: Sun, 24 Mar 2024 22:59:19 +0000 Subject: [PATCH] Update sfs_load.overlay: Workarounds for /etc, /run, and /var The problem with symlink method for loading sfs modules on the fly on overlay is that files under /etc, /run, and /var where got read-only. To fix this issue simply exclude those folder when creating symlinks. Then perform copy of files of /etc, /run, and /var from sfs module to rootfs --- .../rootfs-skeleton/usr/sbin/sfs_load.overlay | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/woof-code/rootfs-skeleton/usr/sbin/sfs_load.overlay b/woof-code/rootfs-skeleton/usr/sbin/sfs_load.overlay index 0599c9b6750..ed1f4d89e48 100755 --- a/woof-code/rootfs-skeleton/usr/sbin/sfs_load.overlay +++ b/woof-code/rootfs-skeleton/usr/sbin/sfs_load.overlay @@ -182,7 +182,28 @@ if [ $# -ne 0 ]; then done < <(find "$MNT" -mindepth 1 | cut -f 4- -d / | sort -r) [ $PUPMODE -eq 12 ] && sync "$LIST" - cp -asn "$MNT"/* / + #link anything except /etc, /run, and /var + for fld1 in $(ls $MNT 2>/dev/null | grep -vE '\/etc|\/run|\/var') + do + if [ "$fld1" != "" ]; then + if [ ! -d "/$fld1" ] && [ ! -L "/$fld1" ]; then + mkdir -p "/$fld1" + fi + cp -rasn "$MNT/$fld1"/* "/$fld1"/ + fi + done + + #copy files in /etc, /run, and /var + for fld1 in etc run var + do + if [ "$fld1" != "" ]; then + if [ ! -d "/$fld1" ] && [ ! -L "/$fld1" ]; then + mkdir -p "/$fld1" + fi + cp -ran "$MNT/$fld1"/* "/$fld1"/ + fi + done + /etc/rc.d/rc.update w pidof -s jwm > /dev/null && jwm -reload [ $CLI -eq 0 ] && kill $PID @@ -312,4 +333,4 @@ export DIALOG=' ' -exec gtkdialog -p DIALOG \ No newline at end of file +exec gtkdialog -p DIALOG