From 832d4574bea48bccac269fac44dc9e4cb4e51636 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 14 Dec 2019 12:07:40 +0200 Subject: [PATCH] Mount overlayfs after loading fs module --- board/common/overlay/etc/init.d/S01mountall | 12 +++++++++++- .../overlay/usr/share/dataskel/.overlay-usr/.empty | 0 2 files changed, 11 insertions(+), 1 deletion(-) delete mode 100644 board/common/overlay/usr/share/dataskel/.overlay-usr/.empty diff --git a/board/common/overlay/etc/init.d/S01mountall b/board/common/overlay/etc/init.d/S01mountall index 1fa1ac2eca..84f75caa4e 100755 --- a/board/common/overlay/etc/init.d/S01mountall +++ b/board/common/overlay/etc/init.d/S01mountall @@ -6,12 +6,21 @@ mount_fs() { msg_begin "Mounting filesystems" /bin/mount -T /etc/fstab.disk -a && /bin/mount -T /etc/fstab.extra -a && - if grep -qw overlay /proc/filesystems; then /bin/mount -T /data/etc/fstab.overlay -a; fi && if [[ -r /data/etc/fstab.user ]]; then /bin/mount -T /data/etc/fstab.user -a; fi test $? == 0 && msg_done || msg_fail } +mount_overlay() { + modprobe overlay &>/dev/null + grep -qw overlay /proc/filesystems || return + + msg_begin "Mounting overlay filesystems" + grep -oE '/data/.overlay-[^ ]+' /etc/fstab.overlay | xargs mkdir -p + /bin/mount -T /etc/fstab.overlay -a + test $? == 0 && msg_done || msg_fail +} + remount_rw() { msg_begin "Remounting boot partition read-write" mount -o remount,rw /boot @@ -30,6 +39,7 @@ mk_tty_login() { case "$1" in start) mount_fs + mount_overlay # we need to source conf again, now that /data is available source /etc/init.d/os_conf diff --git a/board/common/overlay/usr/share/dataskel/.overlay-usr/.empty b/board/common/overlay/usr/share/dataskel/.overlay-usr/.empty deleted file mode 100644 index e69de29bb2..0000000000