From 92c65b46725a407ad3d6942e7fe9a5a0e358b4ca Mon Sep 17 00:00:00 2001 From: Michal Date: Sun, 29 Mar 2026 23:59:38 +0100 Subject: [PATCH] fix: generic rescue instructions in debug command output Co-Authored-By: Claude Opus 4.6 (1M context) --- bastion/src/cli/src/commands/debug.ts | 33 ++++++++++++--------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/bastion/src/cli/src/commands/debug.ts b/bastion/src/cli/src/commands/debug.ts index 49e2847..aa3ccd7 100644 --- a/bastion/src/cli/src/commands/debug.ts +++ b/bastion/src/cli/src/commands/debug.ts @@ -117,38 +117,33 @@ export function registerDebugCommand(parent: Command): void { } } + const sshdNote = opts.sshd + ? `\nSSH + nc listener will start automatically. Watch bastion logs for the IP callback. + Password: debug | nc 2323 for raw shell\n` + : ""; + console.log(` Debug mode queued for ${hostname} (${mac}). Reboot the machine to enter Fedora rescue mode. - +${sshdNote} Once in rescue shell: - # Activate LVM - vgchange -ay labvg - - # Mount root + other volumes + # Activate LVM and mount installed system + vgchange -ay mkdir -p /mnt/sysroot - mount /dev/labvg/root /mnt/sysroot - cat /mnt/sysroot/etc/fstab # check what else to mount - mount /dev/labvg/var /mnt/sysroot/var - mount /dev/labvg/home /mnt/sysroot/home + mount /dev//root /mnt/sysroot + cat /mnt/sysroot/etc/fstab + mount /dev//var /mnt/sysroot/var + mount /dev//home /mnt/sysroot/home - # Boot the installed system in a container + # Boot installed system in a container /mnt/sysroot/usr/bin/systemd-nspawn -D /mnt/sysroot --boot - # Or just chroot for quick fixes + # Or chroot for quick fixes mount --bind /dev /mnt/sysroot/dev mount --bind /proc /mnt/sysroot/proc mount --bind /sys /mnt/sysroot/sys chroot /mnt/sysroot - - # Check initramfs size - ls -lh /mnt/sysroot/boot/initramfs-*.img - - # Rebuild initramfs without amdgpu - chroot /mnt/sysroot - echo 'omit_drivers+=" amdgpu "' > /etc/dracut.conf.d/omit-amdgpu.conf - dracut -f --regenerate-all `); }); }