V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m51s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m51s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -15,8 +15,11 @@ guard_sourcing
|
||||
#######################################
|
||||
# Exiting chroot of the target system.
|
||||
# Globals:
|
||||
# RECOVERY
|
||||
# TARGET
|
||||
# VAR_CHROOT_ACTIVATED
|
||||
# VAR_NEED_RUN_IN_TARGET
|
||||
# VAR_RUN_RECOVERY
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
@@ -24,20 +27,25 @@ guard_sourcing
|
||||
#######################################
|
||||
exiting_chroot_system() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
declare -a ary_umount=( "/sys/fs/cgroup" "/dev/hugepages" "/dev/mqueue" "/dev/shm" "/dev/pts" "/proc" "/sys" "/dev" )
|
||||
declare var_path=""
|
||||
declare -a ary_umount=( "/sys/fs/cgroup" "/dev/hugepages" "/dev/mqueue" "/dev/shm" "/dev/pts" "/proc" "/sys" "/dev" )
|
||||
declare var_path=""
|
||||
|
||||
declare var_target="${TARGET}"
|
||||
|
||||
### Check for TARGET / RECOVERY.
|
||||
[[ "${VAR_RUN_RECOVERY}" == "true" ]] && var_target="${RECOVERY}"
|
||||
|
||||
for var_path in "${ary_umount[@]}"; do
|
||||
|
||||
umount -l "${TARGET}${var_path}" 2>/dev/null || true
|
||||
do_log "info" "file_only" "4999() Command: [umount -l ${TARGET}${var_path} 2>/dev/null || true] issued."
|
||||
umount -l "${var_target}${var_path}" 2>/dev/null || true
|
||||
do_log "info" "file_only" "4999() Command: [umount -l ${var_target}${var_path} 2>/dev/null || true] issued."
|
||||
|
||||
done
|
||||
|
||||
if [[ "${VAR_NEED_RUN_IN_TARGET:-false}" == "true" ]]; then
|
||||
|
||||
umount -l "${TARGET}/run" 2>/dev/null || true
|
||||
do_log "info" "file_only" "4999() Command: [umount -l ${TARGET}/run 2>/dev/null || true] issued."
|
||||
umount -l "${var_target}/run" 2>/dev/null || true
|
||||
do_log "info" "file_only" "4999() Command: [umount -l ${var_target}/run 2>/dev/null || true] issued."
|
||||
|
||||
fi
|
||||
|
||||
@@ -45,4 +53,7 @@ exiting_chroot_system() {
|
||||
|
||||
guard_dir && return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f exiting_chroot_system
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user