systemtap/plans/prepare.sh
Martin Cermak 91acc811a1 CI Tests: Set DEBUGINFOD_URLS based on test FMF context.
Tests are supposed to be executed within defined context, such as e.g.
tmt --root . -c arch=x86_64 -c distro=fedora-38 -c trigger=build run ...

FTR: https://tmt.readthedocs.io/en/stable/spec/plans.html#context

This update sets DEBUGINFOD_URLS based on the provided distro
via the ci.fmf file.
2023-05-19 10:34:46 +02:00

37 lines
866 B
Bash
Executable File

#!/bin/bash
# On Rawhide, the running kernel packages won't probably be avail in
# configured repos. Debuginfo isn't a problem, we access that using
# the debuginfod.
__fedora_install_deps ()
{
TMPD=$(mktemp -d)
pushd $TMPD
koji download-build --rpm kernel-`uname -r` --arch `uname -i`
koji download-build --rpm kernel-devel-`uname -r` --arch `uname -i`
koji download-build --rpm kernel-modules-`uname -r` --arch `uname -i`
dnf -y install kernel{,-devel,-modules}-`uname -r`.rpm
popd
rm -rf $TMPD
}
set -xe
source /etc/os-release
# Install needed packages
if [ "$ID" == "fedora" ]; then
stap-prep || __fedora_install_deps
fi
stap-prep
# Report installed packages
stap-report
# Set up SELinux so that it allows for userspace probing
setsebool allow_execmod on
setsebool allow_execstack on
setsebool deny_ptrace off
set +xe