Sample Header Ad - 728x90

linux kernel - (virtual) bluetooth device for testing

0 votes
0 answers
28 views
I want to test and debug linux kernel internals within the bluetooth stack, i.e. /net/bluetooth. I have a (rather minimal) kernel, manually built, with debug symbols, and a busybox at the moment, running in qemu. Now I want to investigate specific bluetooth functions from the kernel. I thought, a virtual device would be easiest but it seems harder than expected. I found there is btvirt from bluez for dealing with virtual bluetooth devices. I have tried manually building bluez statically. Doesn't work, btvirt is still (at least partly) dynamically linked (and hence doesn't work in my vm):
# in bluez repo
autoreconf -vfi
./configure --enable-static --enable-debug --enable-test --enable-testing --enable-deprecated --enable-experimental --enable-logger CFLAGS=-static LDFLAGS=-static
make
ldd emulator/btvirt  # output below
	linux-vdso.so.1 (0x00007f7225f23000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7225cf5000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f7225f25000)
Also, I tried clang instead of gcc, without success. musl-gcc yielded some error about readline when trying to ./configure I have not followed further yet. What options do I have/which route would be the easiest? 1. Should I abandon my minimal kernel and use a full debian/ubuntu instead? I need debugging symbols and might want to pin to specific versions, so I guess, I would have to manually build the debian/ubuntu kernel (i.e. in accordance with some minimum build flags these distros need/expect), right? 2. How much work is it/should I try to expand my custom small setup with libc, linker etc? 3. Am I on the right track at all? I assume(d) that kernel bluetooth developers might use virtual devices. (Am I correct on that one? If people have experience here, I'd be curious.) Or is this rather hopeless and should I try to pass-through a USB bluetooth device instead? Thanks in advance, I'll be happy to provide further info if needed.
Asked by nox (161 rep)
Jul 7, 2025, 05:11 PM
Last activity: Jul 7, 2025, 08:29 PM