From dc48caa9596318898f6053362e7047867938ae36 Mon Sep 17 00:00:00 2001 From: Adolfo Delorenzo Date: Thu, 14 May 2026 15:27:50 -0600 Subject: [PATCH] debug: log every step of pre-switch_root mount sequence to /dev/console The ARM64 generic boot is failing with 'Segmentation fault' from a child process before any visible init output. Adding per-step debug lines to narrow down which mount/mkdir crashes. To revert: git revert before tagging v0.3.0. Co-Authored-By: Claude Opus 4.7 (1M context) --- init/init.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/init/init.sh b/init/init.sh index 1ad9088..cd99091 100755 --- a/init/init.sh +++ b/init/init.sh @@ -14,6 +14,12 @@ # kubesolo.cloudinit= Path to cloud-init config # kubesolo.flags= Extra flags for KubeSolo binary +# Redirect ALL output to /dev/console for visibility during early boot. +# This is temporary v0.3 ARM64 debugging — revert when generic ARM64 is stable. +exec >/dev/console 2>&1 +echo "[KSOLO-DBG] init.sh PID=$$ shell=$(readlink -f /proc/$$/exe 2>/dev/null || echo unknown)" +echo "[KSOLO-DBG] uname=$(uname -a 2>&1)" + set -e # --- Switch root: escape initramfs so runc pivot_root works --- @@ -22,11 +28,22 @@ set -e # set up container root filesystems. To fix this, we copy the rootfs to a # tmpfs and switch_root to it. The sentinel file prevents infinite loops. if [ ! -f /etc/.switched_root ]; then + echo "[KSOLO-DBG] entering switch_root block" + echo "[KSOLO-DBG] mount proc..." mount -t proc proc /proc 2>/dev/null || true + echo "[KSOLO-DBG] mount proc exit=$?" + echo "[KSOLO-DBG] mount sysfs..." mount -t sysfs sysfs /sys 2>/dev/null || true + echo "[KSOLO-DBG] mount sysfs exit=$?" + echo "[KSOLO-DBG] mount devtmpfs..." mount -t devtmpfs devtmpfs /dev 2>/dev/null || true + echo "[KSOLO-DBG] mount devtmpfs exit=$?" + echo "[KSOLO-DBG] mkdir /mnt/newroot..." mkdir -p /mnt/newroot + echo "[KSOLO-DBG] mkdir /mnt/newroot exit=$?" + echo "[KSOLO-DBG] mount tmpfs /mnt/newroot..." mount -t tmpfs -o size=400M,mode=755 tmpfs /mnt/newroot + echo "[KSOLO-DBG] mount tmpfs exit=$?" echo "[init] Copying rootfs to tmpfs..." >&2 # Copy each top-level directory explicitly (BusyBox cp -ax on rootfs is broken) for d in bin sbin usr lib lib64 etc var opt; do