From 48b4dd35fadfbb50a6302f9f4535c3c69997758c Mon Sep 17 00:00:00 2001 From: JohnTheCoolingFan Date: Wed, 10 Jul 2024 17:24:44 +0300 Subject: [PATCH 1/2] Added MKNOD capability to docker container --- lib/functions/cli/cli-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/functions/cli/cli-docker.sh b/lib/functions/cli/cli-docker.sh index f4e8be0e7d9b..847f09484596 100644 --- a/lib/functions/cli/cli-docker.sh +++ b/lib/functions/cli/cli-docker.sh @@ -74,7 +74,7 @@ function cli_docker_run() { case "${DOCKER_SUBCMD}" in shell) display_alert "Launching Docker shell" "docker-shell" "info" - docker run -it "${DOCKER_ARGS[@]}" "${DOCKER_ARMBIAN_INITIAL_IMAGE_TAG}" /bin/bash + docker run -it --cap-add MKNOD "${DOCKER_ARGS[@]}" "${DOCKER_ARMBIAN_INITIAL_IMAGE_TAG}" /bin/bash ;; purge) From f95d4d1b70d70455037434be2b8b7c7e573e3c3b Mon Sep 17 00:00:00 2001 From: JohnTheCoolingFan Date: Wed, 10 Jul 2024 18:08:40 +0300 Subject: [PATCH 2/2] Added comment explaining why MKNOD capability is needed --- lib/functions/cli/cli-docker.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/functions/cli/cli-docker.sh b/lib/functions/cli/cli-docker.sh index 847f09484596..01a92fda0f83 100644 --- a/lib/functions/cli/cli-docker.sh +++ b/lib/functions/cli/cli-docker.sh @@ -74,6 +74,9 @@ function cli_docker_run() { case "${DOCKER_SUBCMD}" in shell) display_alert "Launching Docker shell" "docker-shell" "info" + # The MKNOD capability is required for loop device search function. + # In case there are no loop devices available, losetup -f would not be able to create a loop + # device, yet it will output a loop device path docker run -it --cap-add MKNOD "${DOCKER_ARGS[@]}" "${DOCKER_ARMBIAN_INITIAL_IMAGE_TAG}" /bin/bash ;;