Skip to content

Commit

Permalink
Merge pull request #87 from mkalcok/missing-perf
Browse files Browse the repository at this point in the history
Ubuntu cinc: Include 'perf' in the image.
  • Loading branch information
dceara authored Dec 15, 2023
2 parents 9739613 + 2b70fd4 commit e90de49
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions image/cinc/install_ubuntu_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ apt install -yq --no-install-recommends \
libxslt1.1 \
lksctp-tools \
libsctp-dev \
linux-tools-generic \
make \
meson \
net-tools \
Expand Down Expand Up @@ -64,3 +65,24 @@ systemctl mask \
mkdir -pv /bin
/tmp/generate_dhclient_script_for_fullstack.sh / || \
echo "Failed to generate dhclient script for fullstack!"

# Patch perf script.
# On Ubuntu, '/usr/bin/perf' is a shell script that tries to find perf binary
# that exactly matches current running kernel. This will break if
# ovn-fake-multinode container runs on a host with different kernel than the
# host that built the image.
# It's no ideal, but since the perf should be backwards compatible, we can
# circumvent this by linking '/usr/bin/perf' directly to an available
# binary in '/usr/lib/linux-tools-<version>/perf'
PERF_PATH=""

for PERF_BIN in $(ls /usr/lib/linux-tools-*/perf); do
PERF_PATH=$PERF_BIN
done

if [ -z "$PERF_PATH" ]; then
echo "Failed to find perf binary"
exit 1
fi

ln -s -f "$PERF_PATH" /usr/bin/perf

0 comments on commit e90de49

Please sign in to comment.