Skip to content

Commit 1c12ec2

Browse files
mairasclaude
andcommitted
feat(ramfs): switch to text console before flashing
When the target device runs a graphical desktop, the flash helper's console output is hidden behind the GUI. Switch to VT1 in Phase 1 (before re-exec) so the physical display shows flashing progress and gives a clear visual signal that something drastic is happening. Uses the system chvt command (still available from rootfs in Phase 1). Silently ignored on headless devices or when VTs are unavailable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 369f1bd commit 1c12ec2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

flash-live-system

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,12 +700,15 @@ deploy_ramfs_helper() {
700700
#!/bin/bash
701701
702702
# Phase 1 — runs under /bin/bash from rootfs (safe: dd hasn't started yet).
703-
# Re-exec under busybox sh from tmpfs so that NOTHING running after dd
703+
# Switch to a text console so output is visible on the physical display
704+
# (also serves as a clear visual signal that something drastic is happening).
705+
# Then re-exec under busybox sh from tmpfs so that NOTHING running after dd
704706
# depends on rootfs pages. Output is piped through tee so it appears on
705707
# both /dev/console (physical display) and /dev/shm/flash-helper.log.
706708
707709
if [ -z "$_FLASH_REEXEC" ]; then
708710
export _FLASH_REEXEC=1
711+
chvt 1 2>/dev/null || true
709712
exec /dev/shm/busybox sh -c \
710713
'/dev/shm/busybox sh "$0" "$@" 2>&1 | /dev/shm/busybox tee /dev/shm/flash-helper.log > /dev/console' \
711714
"$0" "$@"

0 commit comments

Comments
 (0)