diff --git a/package/base-files/files/etc/init.d/umount b/package/base-files/files/etc/init.d/umount index 3f0193456b..6c5770e7b4 100755 --- a/package/base-files/files/etc/init.d/umount +++ b/package/base-files/files/etc/init.d/umount @@ -11,11 +11,14 @@ stop() { if [ ! -f /rom/rom/note ]; then sync /overlay umount /overlay + sync /ext_overlay + umount /ext_overlay else # pivot mount --move /dev /rom/dev mount --move /tmp /rom/tmp mount --move /sys /rom/sys + mount --move /ext_overlay /rom/ext_overlay mount --move /overlay /rom/overlay mount --move /proc /rom/proc if pivot_root /rom /rom/mnt; then @@ -25,6 +28,8 @@ stop() { umount /mnt sync /overlay umount /overlay + sync /ext_overlay + umount /ext_overlay else mount --move /rom/proc /proc mount --move /rom/dev /dev diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index 493ac28e6f..5e50d529f7 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -18,7 +18,7 @@ include /lib/upgrade supivot() { # /bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1 - mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \ + mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay $1/ext_overlay && \ /bin/mount -o noatime,move /proc $1/proc && \ pivot_root $1 $1$2 || { /bin/umount -l $1 $1 @@ -29,6 +29,7 @@ supivot() { # /bin/mount -o noatime,move $2/dev /dev /bin/mount -o noatime,move $2/tmp /tmp /bin/mount -o noatime,move $2/overlay /overlay 2>&- + /bin/mount -o noatime,move $2/ext_overlay /ext_overlay 2>&- return 0 } @@ -155,9 +156,14 @@ if [ -n "$ROOTFS_TYPE" -a "$ROOTFS_TYPE" != "tmpfs" -a "$ROOTFS_TYPE" != "rootfs switch_to_ramfs fi +grep /ext_overlay /proc/mounts > /dev/null && { + /bin/mount -o noatime,remount,ro /ext_overlay + /usr/bin/umount -R -d -l /ext_overlay 2>/dev/null || /bin/umount -l /ext_overlay +} + grep /overlay /proc/mounts > /dev/null && { /bin/mount -o noatime,remount,ro /overlay - /usr/bin/umount -R -d -l /overlay || /bin/umount -l /overlay + /usr/bin/umount -R -d -l /overlay 2>/dev/null || /bin/umount -l /overlay } # Exec new shell from ramfs