Files
nova/devstack/lib/mdev_samples
Sean Mooney 804bc98759 update nova-next to use ubuntu 24.04
This change updates the nova-next nodeset
to use openstack-two-node-noble and revert to
using qemu without nested virt.

using nested virt was a tempory messure to mitigate the kernel
panics we were seeing related to volume detach while we also explored
using split kernel images. since then we have reverted the other
jobs back to using normal whole disk images and we have not
seen a marked uptic in kernel panics.

as such this change drop the use of nested virt since the other jobs
are not using it an updates the nodeset to move nova-next to test on
ubuneu 24.04 (noble) on python 3.12

Depends-On: https://review.opendev.org/c/openstack/devstack/+/922427
Change-Id: I5059ba3c519efb18947a8f3d24868ce1c9289e3d
2024-08-30 02:29:38 +01:00

47 lines
1.7 KiB
Plaintext

function compile_mdev_samples {
set -x
local kver=$(uname -r)
local kvariant=$(uname -r | awk -F - '{print $NF}')
if [[ "$kvariant" == "kvm" ]]; then
echo "NOTE: The kvm variant of the kernel you are running does not " \
"have the mdev support required to enable the mdev samples."
echo "Install the generic variant and retry."
exit 1
elif [[ "$kvariant" != "generic" ]]; then
echo "NOTE: This may not work on your kernel variant of $kvariant!"
echo "Recommend installing the generic variant kernel instead."
fi
if grep deb-src /etc/apt/sources.list; then
sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list
else
sudo tee -a /etc/apt/sources.list <<EOF
# Added by devstack
deb-src http://archive.ubuntu.com/ubuntu $DISTRO main restricted
deb-src http://archive.ubuntu.com/ubuntu $DISTRO-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu $DISTRO-security main restricted
EOF
fi
cat /etc/apt/sources.list
sudo apt update
sudo apt build-dep -y linux-image-unsigned-$kver
sudo apt install -y libncurses-dev gawk flex bison openssl libssl-dev \
dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf llvm \
linux-headers-$kver
mkdir $NOVA_KERNEL_TEMP
cd $NOVA_KERNEL_TEMP
apt source linux-image-unsigned-$kver > kernel-source.log
cd linux-*/samples/vfio-mdev
sed -i 's/obj-[^ ]*/obj-m/' Makefile
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
sudo depmod
for mod in $NOVA_MDEV_SAMPLES; do
sudo modprobe $mod
done
lsmod | grep mdev
}