Mount overlayfs after loading fs module

This commit is contained in:
Calin Crisan 2019-12-14 12:07:40 +02:00
parent e96d87aaf7
commit 832d4574be
2 changed files with 11 additions and 1 deletions

View File

@ -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