Revert "Added a call to losetup -f"

This reverts commit b3d9a17a57.
This commit is contained in:
JohnTheCoolingFan 2024-05-20 14:54:27 +03:00 committed by Igor
parent b3d9a17a57
commit 7da42c8a42
4 changed files with 1 additions and 11 deletions

View File

@ -10,8 +10,6 @@
function cli_standard_build_pre_run() {
declare -g ARMBIAN_COMMAND_REQUIRE_BASIC_DEPS="yes" # Require prepare_host_basic to run before the command.
ensure_loop_exists
# "gimme root on a Linux machine"
cli_standard_relaunch_docker_or_sudo
}

View File

@ -40,8 +40,6 @@ function cli_docker_run() {
set_git_build_repo_url_and_commit_vars "docker launcher"
fi
ensure_loop_exists
LOG_SECTION="docker_cli_prepare" do_with_logging docker_cli_prepare
# @TODO: and can be very well said that in CI, we always want FAST_DOCKER=yes, unless we're building the Docker image itself.

View File

@ -99,7 +99,7 @@ function is_root_or_sudo_prefix() {
elif [[ -n "$(command -v doas)" ]]; then
# doas binary found in path, use it.
display_alert "EUID is not 0" "doas binary found, using it" "debug"
__my_sudo_prefix="doas"
__my_sudo_prefix="sudo"
else
# No root and no sudo binary. Bail out
exit_with_error "EUID is not 0 and no sudo binary found - Please install sudo or run as root"

View File

@ -116,9 +116,3 @@ function free_loop_device_retried() {
fi
losetup -d "${1}"
}
# Runs losetup -f as root to ensure that there is a /dev/loopX or /dev/loopXY device existing and available
function ensure_loop_exists() {
local sudo_prefix="" && is_root_or_sudo_prefix sudo_prefix
${sudo_prefix} losetup -f
}