On Tue, Apr 16, 2024 at 08:38:54AM -0400, Josh Marshall wrote: > Hello all, > > I am trying to work on and improve some aspects of the "fanotify" > parts of the VFS subsystem with Amir Goldstein being the person I > brought these to. Amir has me doing some work to see what is going on > since I have observed some unexpected behaviors. In doing so, I have > cobbled together the following iteration pattern which I would like > feedback on. It doesn't feel like it is as concise as it should be in > practice and I am hoping someone can offer pointers on how to improve > it. By the end of this, I would like to have a fully documented and > replicable script to share for certain kinds of non-hardware kernel > development like I am doing here. As a word of warning, I haven't > gotten to fully test this either. It feels like I'm trying to cut > down a hydra with everything new I need to account for. > > ``` > Source: > https://github.com/archlinux/arch-boxes > > Term 1: > guestmount -w -a ~/Downloads/Arch-Linux-x86_64-basic.qcow2 -m > /dev/sda3 ~/mnt/arch/ > <copy sources, files, perform compilation steps, etc as needed to > inside the VM image as needed each development iteration> > cp ~/mnt/ arch/home/arch/linux/boot/x86/vmlinux . > umount ~/mnt/arch > > Term 2: > kvm -s -cpu host -display gtk -vga qxl -accel kvm -drive > format=qcow2,file=$HOME/Downloads/Arch-Linux-x86_64-basic.qcow2 -m 1G > -smp 2 -S > > Term 3: > gdb vmlinux > : target remote:1234 > <set break points> > : continue > > Qemu: > <time sensitive, boot into the right kernel if available> > <perform development tasks> > ``` > Hello, You don't have to mount and copy over the vmlinux file, QEMU/KVM has the -kernel option, which you can use to specify the kernel image: kvm -s cpu host \ -display gtk \ -vga qxl \ -accel kvm \ -m 1G \ -kernel arch/home/arch/linux/boot/x86/vmlinux \ -drive format=qcow2,file=$HOME/Downloads/Arch-Linux-x86_64-basic.qcow2 However you will need mount and copy any modules you build to the /lib/modules directory or you won't be able to load them.