feat: PXE debug boot mode for rescue/diagnostics #4

Merged
michal merged 16 commits from wip/ks-debugging into main 2026-03-30 02:59:35 +00:00
Showing only changes of commit 92c65b4672 - Show all commits

View File

@@ -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 <ip> 2323 for raw shell\n`
: "";
console.log(` console.log(`
Debug mode queued for ${hostname} (${mac}). Debug mode queued for ${hostname} (${mac}).
Reboot the machine to enter Fedora rescue mode. Reboot the machine to enter Fedora rescue mode.
${sshdNote}
Once in rescue shell: Once in rescue shell:
# Activate LVM # Activate LVM and mount installed system
vgchange -ay labvg vgchange -ay
# Mount root + other volumes
mkdir -p /mnt/sysroot mkdir -p /mnt/sysroot
mount /dev/labvg/root /mnt/sysroot mount /dev/<vg>/root /mnt/sysroot
cat /mnt/sysroot/etc/fstab # check what else to mount cat /mnt/sysroot/etc/fstab
mount /dev/labvg/var /mnt/sysroot/var mount /dev/<vg>/var /mnt/sysroot/var
mount /dev/labvg/home /mnt/sysroot/home mount /dev/<vg>/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 /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 /dev /mnt/sysroot/dev
mount --bind /proc /mnt/sysroot/proc mount --bind /proc /mnt/sysroot/proc
mount --bind /sys /mnt/sysroot/sys mount --bind /sys /mnt/sysroot/sys
chroot /mnt/sysroot 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
`); `);
}); });
} }