From 5e7859202409462f93333642b78c4fe5e2b8abcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Wed, 29 Apr 2026 11:29:43 +0400 Subject: [PATCH] Add sandbox boot logs cmd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- GNUmakefile | 4 ++++ contrib/lima/sandbox.sh | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 7a382d07e..22fd4d28a 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -390,6 +390,10 @@ sandbox-create: ## Create a Lima sandbox VM for this worktree sandbox-start: ## Start the Lima sandbox VM ./contrib/lima/sandbox.sh start +.PHONY: sandbox-boot-logs +sandbox-boot-logs: ## Show the Lima sandbox VM boot logs + ./contrib/lima/sandbox.sh boot-logs + .PHONY: sandbox-stop sandbox-stop: ## Stop (hibernate) the Lima sandbox VM ./contrib/lima/sandbox.sh stop diff --git a/contrib/lima/sandbox.sh b/contrib/lima/sandbox.sh index b73ec8f3a..a8a14131a 100755 --- a/contrib/lima/sandbox.sh +++ b/contrib/lima/sandbox.sh @@ -18,6 +18,7 @@ Usage: $(basename "$0") [options] Commands: create [--cpus C] [--memory M] [--disk D] Create a new sandbox VM start Start a stopped sandbox + boot-logs Show boot logs stop Stop the sandbox restart Stop + start the sandbox delete Delete the sandbox entirely @@ -85,6 +86,10 @@ cmd_start() { cmd_status } +cmd_boot_logs() { + limactl shell probo-sandbox-fix -- sudo tail -f /var/log/cloud-init-output.log +} + cmd_stop() { echo "Stopping sandbox: ${VM_NAME}" limactl stop "${VM_NAME}" @@ -157,12 +162,13 @@ command="$1" shift case "${command}" in - create) cmd_create "$@" ;; - start) cmd_start ;; - stop) cmd_stop ;; - restart) cmd_restart ;; - delete) cmd_delete ;; - ssh) cmd_ssh ;; + create) cmd_create "$@" ;; + start) cmd_start ;; + boot-logs) cmd_boot_logs ;; + stop) cmd_stop ;; + restart) cmd_restart ;; + delete) cmd_delete ;; + ssh) cmd_ssh ;; exec) if [[ "${1:-}" == "--" ]]; then shift; fi cmd_exec "$@"