Added a call to losetup -f
See https://github.com/armbian/build/issues/6568
This commit is contained in:
parent
324647c039
commit
b3d9a17a57
@ -10,6 +10,8 @@
|
||||
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
|
||||
}
|
||||
|
||||
@ -40,6 +40,8 @@ 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.
|
||||
|
||||
@ -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="sudo"
|
||||
__my_sudo_prefix="doas"
|
||||
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"
|
||||
|
||||
@ -116,3 +116,9 @@ 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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user