#!/bin/sh arch="$(uname -r | egrep -o '[a-z0-9]+$')" apt-get -y install linux-headers-${arch} linux-image-${arch}-dbg 2>&1 target_kernel="$(dpkg -l linux-headers-\* | awk '/^ii/ { print $2 ; exit }' | sed s/linux-headers-//)" # FIXME: https://bugs.debian.org/1040545 stap -p 4 -r "$target_kernel" -e 'probe oneshot { println("hello world") }' -m hello 2>&1 # Ensure hello.ko was produced test -f hello.ko