STAP-ONBOOT(8)
β¨ STAP-ONBOOT β¨
okay bestie, gather round π this is the stap-onboot page from the System Manager's Manual β section 8, admin girlies only. it's giving "let's run SystemTap scripts before the root filesystem even wakes up" energy and honestly? iconic.
πΈ NAME πΈ
stap-onboot β embed SystemTap scripts into an initramfs so they run at early boot π¦
β¨ SYNOPSIS β¨
stap-onboot [OPTIONS] [SCRIPT...]
π DESCRIPTION π
so like, stap-onboot takes your SystemTap scripts, compiles them, and then uses dracut to tuck them all cozy inside an initramfs π which means those scripts get to run during early boot β before the root filesystem is even mounted. main character behaviour, fr fr.
why would you want that? two reasons, bestie:
- debugging early-boot issues π (the messy part of boot nobody wants to look at)
- applying CVE band-aid scripts that need to run as early as physically possible π©Ή
scripts get read from /etc/systemtap/script.d/ β¨ and compiled modules get cached in /var/cache/systemtap/KERNEL/ π§
π OPTIONS π
-bβ back up the existing initramfs before you overwrite it π«Ά the backup gets saved with a.bakextension. safety first, no cap.-cconfigfile β point at an alternate config file instead of the default/etc/systemtap/configπ-opath.img β set the output initramfs file path π by default the initramfs for the current kernel gets updated at/boot/initramfs-KERNEL.img-rkernelrelease β pick which kernel release to build the initramfs for π defaults to the currently running kernel, i.e.uname -r
π¦ ARGUMENTS π¦
SCRIPTβ one or more script names (without the.stpextension, ok?) to compile and embed in the initramfs π those scripts must exist in/etc/systemtap/script.d/β and if you pass no scripts at all? you get a clean initramfs with zero SystemTap scripts in it. a little palate cleanser π§Ό
π EXAMPLES π
compile and embed myScript.stp into the initramfs, and back up the original while you're at it:
# stap-onboot -b myScript
build an initramfs for a whole different kernel, go off:
# stap-onboot -r 6.1.0-1.fc37.x86_64 earlyDebug
custom initramfs in a specific location? say less:
# stap-onboot -o /tmp/test-initramfs.img bandaid
and if you wanna remove all the SystemTap scripts from the initramfs:
# stap-onboot
π FILES π
/etc/systemtap/script.d/SCRIPT.stpβ the source SystemTap scripts that get embedded β¨/etc/systemtap/configβ config file for script options π each script can have options defined asSCRIPTNAME_OPT=.../var/cache/systemtap/KERNEL/β the directory where compiled.komodules get cached π§/boot/initramfs-KERNEL.imgβ default output location for the generated initramfs πΈ/usr/lib/dracut/modules.d/99stapβ dracut module directory for the SystemTap integration π
π SEE ALSO π
stap(1), staprun(8), dracut(8), systemd.service(5)
and that's the whole page bestie!! π this was STAP-ONBOOT(8) straight outta the System Manager's Manual, section 8, mwah π go forth and embed those scripts, you've got this π«Άβ¨π
π¦ where this page comes from
- arch rolling: systemtap 5.6-1 Β· GPL-2.0-or-later
- centos-stream 10: systemtap-initscript 5.6-3.el10 Β· GPL-2.0-or-later
- centos-stream 9: systemtap-initscript 5.6-3.el9 Β· GPL-2.0-or-later
- fedora 43: systemtap-initscript 5.6-1.fc43 Β· GPL-2.0-or-later
- fedora 44: systemtap-initscript 5.6-1.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms