You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.1 KiB
32 lines
1.1 KiB
#!/usr/bin/bash
|
|
#
|
|
# Author: Dmitry Razumov <asmeron@ublinux.com>
|
|
# Copyright (c) 2021-2025 UBLinux <support@ublinux.com>
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
#
|
|
|
|
ENABLED=yes
|
|
[[ ${ENABLED} == "yes" ]] || { return 0 2>/dev/null && return 0 || exit 0; }
|
|
|
|
PATH=/usr/lib/ublinux/scripts:${PATH}
|
|
EXT="ubm"
|
|
|
|
COREMODS=".*/[0-9]{3}-core-[0-9]{4}-.*\.${EXT}|.*/[0-9]{3}-ublinux-[0-9]{4}-.*\.${EXT}"
|
|
#IMAGES=/mnt/live/memory/images
|
|
IMAGES=/memory/bundles
|
|
[[ -f /etc/initvars ]] && . /etc/initvars && IMAGES=${SYSMNT}/bundles
|
|
|
|
sync; sync; sync; echo 3 > /proc/sys/vm/drop_caches
|
|
# Umount any modules squashfs
|
|
grep -E " squashfs" /proc/mounts | cut -d " " -f2 | sed '1!G;h;$!d' | grep -Ev " ${COREMODS}" | while read ITEM; do
|
|
mount -t aufs -o remount,del:"${ITEM}" aufs / 2>/dev/null
|
|
#umount ${ITEM} 2>/dev/null || umount -l ${ITEM} 2>/dev/null
|
|
umount -l ${ITEM} >/dev/null 2>&1
|
|
done
|
|
|
|
# Umount any modules from /memory/bundles
|
|
#grep -E "${IMAGES}" /proc/mounts | cut -d " " -f2 | grep -Ev " ${COREMODS}" | while read ITEM ; do
|
|
#mount -t aufs -o remount,del:"${ITEM}" aufs / 2>/dev/null
|
|
#done
|