From 7da42c8a427fe746adddbef710638b980d7de637 Mon Sep 17 00:00:00 2001 From: JohnTheCoolingFan <43478602+JohnTheCoolingFan@users.noreply.github.com> Date: Mon, 20 May 2024 14:54:27 +0300 Subject: [PATCH] Revert "Added a call to losetup -f" This reverts commit b3d9a17a5798ff4a8deec9d1b42d252479cbc1bc. --- lib/functions/cli/cli-build.sh | 2 -- lib/functions/cli/cli-docker.sh | 2 -- lib/functions/host/host-utils.sh | 2 +- lib/functions/image/loop.sh | 6 ------ 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/functions/cli/cli-build.sh b/lib/functions/cli/cli-build.sh index 5a57c3b4cf..2f4ac084bc 100644 --- a/lib/functions/cli/cli-build.sh +++ b/lib/functions/cli/cli-build.sh @@ -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 } diff --git a/lib/functions/cli/cli-docker.sh b/lib/functions/cli/cli-docker.sh index 9ff6ac6b2e..f4e8be0e7d 100644 --- a/lib/functions/cli/cli-docker.sh +++ b/lib/functions/cli/cli-docker.sh @@ -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. diff --git a/lib/functions/host/host-utils.sh b/lib/functions/host/host-utils.sh index 2abed9066c..362035dc67 100644 --- a/lib/functions/host/host-utils.sh +++ b/lib/functions/host/host-utils.sh @@ -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" diff --git a/lib/functions/image/loop.sh b/lib/functions/image/loop.sh index a00d21a77b..446919ef44 100644 --- a/lib/functions/image/loop.sh +++ b/lib/functions/image/loop.sh @@ -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 -}