| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# NB: $moddir only works in install() |
| 4 |
. @dracutstap@/params.conf |
| 5 |
|
| 6 |
# Return 0 --> install stap module |
| 7 |
# Return 1 --> skip stap module |
| 8 |
# Return 255 --> install stap module only if explicitly requested |
| 9 |
check() { |
| 10 |
# Do not include stap module if there are no scripts to include |
| 11 |
[ "$ONBOOT_SCRIPTS" ] || return 1 |
| 12 |
# We're disabled by default: the initscript explicitly uses dracut's |
| 13 |
# '--add stap' when creating the initramfs. Otherwise, we might be |
| 14 |
# mistakenly included during e.g. kernel updates. |
| 15 |
return 255 |
| 16 |
} |
| 17 |
|
| 18 |
# We don't depend on anything |
| 19 |
depends() { |
| 20 |
echo "" |
| 21 |
} |
| 22 |
|
| 23 |
install() { |
| 24 |
|
| 25 |
# These programs are very likely to already be included by other |
| 26 |
# dracut modules so we're really not adding any weight |
| 27 |
dracut_install bash mkdir |
| 28 |
|
| 29 |
# The real payload... |
| 30 |
inst "$STAPRUN" |
| 31 |
inst "$STAPIO" |
| 32 |
for script in $ONBOOT_SCRIPTS; do |
| 33 |
inst "$CACHE_PATH/$script.ko" |
| 34 |
done |
| 35 |
|
| 36 |
# start-staprun.sh will need a copy of params.conf |
| 37 |
inst_simple "$moddir/params.conf" "/etc/systemtap-params.conf" |
| 38 |
inst_hook cmdline 01 "$moddir/start-staprun.sh" |
| 39 |
} |
| 40 |
|