Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

init: remove tty0 debug text + add boot-timing log

Silences the "[init] USB_MOUNTED=1", "[init] GPU: card0 USB=1",
"[init] launching ac-native (SDL3 GPU enabled)...", and crash-info
echoes that flashed as raw white text over the splash for ~1 sec
on every boot. All that information is still captured in:

/mnt/pre-launch.log (existing PCI/ACPI/GPU/ALSA dump)
/mnt/ac-init.log (NEW — ac-native launch/exit/crash events)
/mnt/boot-timing.log (NEW — per-phase timing from kernel-handoff
to ac-native launch)

boot-timing.log format is one row per phase:

kernel-handoff Δ 0.000s @ 1.234s
tmpfs-mounts + creds Δ 0.012s @ 1.246s
gpu-wait + usb-mount converge Δ 0.876s @ 2.122s
power-governor + sound PM Δ 0.008s @ 2.130s
pre-ac-native launch Δ 0.003s @ 2.133s

Δ shows per-phase cost; @ is total seconds of kernel uptime at the
mark. Lets us see where the init spends its time so further boot-
speed optimizations are data-driven — we know which phase is worth
cutting vs which is already <10 ms.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+51 -8
+51 -8
fedac/native/initramfs/init
··· 3 3 4 4 export PATH="/bin:/sbin:/usr/bin:/usr/sbin" 5 5 6 + # Capture kernel-handoff timestamp as early as possible so the boot 7 + # timing log has a meaningful zero. /proc/uptime is the first reliable 8 + # wall-clock source (shell `date` is usually epoch-zero at this point). 9 + # Falls back to 0 if /proc isn't mounted yet — which we fix in the next 10 + # block anyway. 11 + BOOT_INIT_START_SEC=$(awk '{print $1}' /proc/uptime 2>/dev/null || echo 0) 12 + 6 13 mount -t proc proc /proc 2>/dev/null 7 14 mount -t sysfs sysfs /sys 2>/dev/null 8 15 mount -t devtmpfs devtmpfs /dev 2>/dev/null ··· 12 19 mount -t tmpfs tmpfs /tmp 2>/dev/null 13 20 mount -t tmpfs tmpfs /run 2>/dev/null 14 21 mount -t efivarfs efivarfs /sys/firmware/efi/efivars 2>/dev/null 22 + 23 + # Boot-phase timing helper. Appends "phase: +X.XXs @ T.TTs" to 24 + # /run/boot-timing so we can see where seconds are spent between 25 + # kernel handoff and ac-native launch. The full file is copied to 26 + # /mnt/boot-timing.log near the top of the pre-launch diagnostic 27 + # dump (when the USB config partition is available). 28 + BOOT_TIMING_LOG="/run/boot-timing" 29 + : > "$BOOT_TIMING_LOG" 30 + _boot_mark() { 31 + local now=$(awk '{print $1}' /proc/uptime 2>/dev/null || echo 0) 32 + local delta=$(awk "BEGIN{printf \"%.3f\", $now - $BOOT_INIT_START_SEC}") 33 + printf '%-32s Δ%6ss @%7ss\n' "$1" "$delta" "$now" >> "$BOOT_TIMING_LOG" 34 + BOOT_INIT_START_SEC=$now 35 + } 36 + _boot_mark "kernel-handoff" 15 37 # debugfs — needed for ASoC DAPM state inspection in audio-diag. 16 38 # CONFIG_DEBUG_FS must be y in the kernel; mount early so everything 17 39 # downstream (audio-diag, gpio dump, etc) can read it. ··· 63 85 echo "root:x:0:" > /etc/group 64 86 echo "root:x:0:root" > /etc/passwd 65 87 88 + _boot_mark "tmpfs-mounts + creds" 89 + 66 90 # Kick off USB mount in the background — independent of GPU probe, so 67 91 # we overlap the two waits instead of running them serially. The main 68 92 # thread then waits for GPU (below) and finally waits for this mount ··· 113 137 # Converge: wait for the background USB mount to settle, pick up its result. 114 138 wait $USB_MOUNT_PID 2>/dev/null 115 139 [ -f /run/usb-mounted ] && USB_MOUNTED=$(cat /run/usb-mounted 2>/dev/null) && [ -z "$USB_MOUNTED" ] && USB_MOUNTED=0 140 + _boot_mark "gpu-wait + usb-mount converge" 116 141 117 142 # Performance governor (silently skip if cpufreq not available) 118 143 if [ -d /sys/devices/system/cpu/cpu0/cpufreq ]; then ··· 178 203 # Set AC_NOLAUNCH_DIAG=1 on the kernel cmdline to skip the dump entirely 179 204 # (useful for locked-down production kiosks that don't want the sysfs 180 205 # scraping cost at all). 181 - echo "[init] USB_MOUNTED=$USB_MOUNTED" > /dev/tty0 2>/dev/null 206 + _boot_mark "power-governor + sound PM" 207 + # Debug console writes to /dev/tty0 have been removed — they flashed 208 + # raw "[init] USB_MOUNTED=1" style text over the splash for ~1s on 209 + # every boot. Everything useful is still captured in the pre-launch 210 + # log + the new /mnt/boot-timing.log, visible post-hoc on the USB. 182 211 if [ "$USB_MOUNTED" = "1" ]; then 183 212 LOG=/mnt/pre-launch.log 184 213 else ··· 401 430 *" AC_NOLAUNCH_DIAG=1 "*) : ;; 402 431 *) _pre_launch_diag & ;; 403 432 esac 404 - echo "[init] GPU: $(ls /dev/dri/ 2>/dev/null || echo NONE) USB=$USB_MOUNTED" > /dev/tty0 2>/dev/null 433 + # GPU + USB state used to echo here as raw "[init] GPU: card0 USB=1" 434 + # over the splash. Dropped — both are captured in the pre-launch log 435 + # and the new boot-timing log for post-mortem review. 405 436 406 437 # Start Swank server in background (if SBCL image exists) 407 438 SWANK_PID=0 ··· 410 441 SWANK_PID=$! 411 442 fi 412 443 444 + _boot_mark "pre-ac-native launch" 445 + 446 + # Copy the timing log to USB before ac-native takes over stdout/err 447 + # — so the user can post-mortem "how long did each phase take" right 448 + # off the stick without having to dig into kmsg. 449 + if [ "$USB_MOUNTED" = "1" ]; then 450 + cp /run/boot-timing /mnt/boot-timing.log 2>/dev/null 451 + fi 452 + 413 453 # Main loop — ac-native runs as a child process (not PID 1). 414 454 # First attempt: with SDL3/GPU env vars. 415 455 # If it crashes (signal), retry without SDL (AC_NO_SDL=1). 416 456 # If that also crashes, keep retrying without SDL with backoff. 457 + # 458 + # All launch / exit / crash messages are appended to /mnt/ac-crash.log 459 + # (persistent) and the stderr log. We no longer write them to /dev/tty0 460 + # because that paints raw text on top of the splash during the boot 461 + # transition. 417 462 CRASH_COUNT=0 418 463 SDL_ENABLED=1 419 464 while true; do 420 465 if [ "$SDL_ENABLED" = "1" ]; then 421 - echo "[init] launching ac-native (SDL3 GPU enabled)..." > /dev/tty0 2>/dev/null 422 466 LD_LIBRARY_PATH="/lib64" LIBGL_DRIVERS_PATH="/lib64/dri" GBM_DRIVERS_PATH="/lib64/dri" MESA_LOADER_DRIVER_OVERRIDE=iris \ 423 467 /ac-native /piece.mjs >>/mnt/ac-native-stdout.log 2>>/mnt/ac-native-stderr.log & 424 468 else 425 - echo "[init] launching ac-native (DRM only)..." > /dev/tty0 2>/dev/null 426 469 LD_LIBRARY_PATH="/lib64" AC_NO_SDL=1 \ 427 470 /ac-native /piece.mjs >>/mnt/ac-native-stdout.log 2>>/mnt/ac-native-stderr.log & 428 471 fi 429 472 CHILD_PID=$! 430 473 wait $CHILD_PID 431 474 EXIT_CODE=$? 432 - # Save crash info 433 - echo "[init] ac-native (pid $CHILD_PID) exited: code=$EXIT_CODE crash=$CRASH_COUNT sdl=$SDL_ENABLED" > /dev/tty0 2>/dev/null 434 - head -5 /tmp/ac-native-stderr.log > /dev/tty0 2>/dev/null 475 + # Exit info → log files only (not tty0; the splash stays clean). 476 + if [ "$USB_MOUNTED" = "1" ]; then 477 + echo "[init] ac-native pid=$CHILD_PID exit=$EXIT_CODE crash=$CRASH_COUNT sdl=$SDL_ENABLED $(date 2>/dev/null)" >> /mnt/ac-init.log 478 + fi 435 479 # Save crash info to USB if mounted 436 480 if [ "$USB_MOUNTED" = "1" ]; then 437 481 echo "exit=$EXIT_CODE crash=$CRASH_COUNT $(date 2>/dev/null)" >> /mnt/ac-crash.log ··· 474 518 if [ "$SDL_ENABLED" = "1" ] && [ "$EXIT_CODE" -gt 128 ]; then 475 519 # Exit > 128 = killed by signal (128 + signal number) 476 520 SIG=$((EXIT_CODE - 128)) 477 - echo "[init] Signal $SIG with SDL — disabling GPU, retrying with DRM..." > /dev/tty0 2>/dev/null 478 521 SDL_ENABLED=0 479 522 if [ "$USB_MOUNTED" = "1" ]; then 480 523 echo "sdl_crash: signal=$SIG, disabling SDL" >> /mnt/ac-crash.log