Compile mdev samples for nova-next
Change-Id: If44964f2b99ee0482600ec31e85ea1d4caeea1b3
This commit is contained in:
parent
b419f1dc56
commit
82f4da91ab
|
@ -464,6 +464,7 @@
|
||||||
NOVNC_FROM_PACKAGE: False
|
NOVNC_FROM_PACKAGE: False
|
||||||
NOVA_USE_UNIFIED_LIMITS: True
|
NOVA_USE_UNIFIED_LIMITS: True
|
||||||
MYSQL_REDUCE_MEMORY: True
|
MYSQL_REDUCE_MEMORY: True
|
||||||
|
NOVA_COMPILE_MDEV_SAMPLES: True
|
||||||
devstack_services:
|
devstack_services:
|
||||||
# Disable OVN services
|
# Disable OVN services
|
||||||
br-ex-tcpdump: false
|
br-ex-tcpdump: false
|
||||||
|
@ -486,6 +487,7 @@
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
# Needed for QoS port heal allocation testing.
|
# Needed for QoS port heal allocation testing.
|
||||||
neutron: https://opendev.org/openstack/neutron
|
neutron: https://opendev.org/openstack/neutron
|
||||||
|
nova: https://opendev.org/openstack/nova
|
||||||
group-vars:
|
group-vars:
|
||||||
subnode:
|
subnode:
|
||||||
devstack_localrc:
|
devstack_localrc:
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
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 jammy main restricted
|
||||||
|
deb-src http://archive.ubuntu.com/ubuntu jammy-updates main restricted
|
||||||
|
deb-src http://archive.ubuntu.com/ubuntu jammy-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
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
NOVA_PLUGINDIR=$(readlink -f $(dirname "${BASH_SOURCE[0]}"))
|
||||||
|
|
||||||
|
source $NOVA_PLUGINDIR/lib/mdev_samples
|
||||||
|
|
||||||
|
if [[ $1 == "stack" ]]; then
|
||||||
|
case $2 in
|
||||||
|
install)
|
||||||
|
if [[ "$NOVA_COMPILE_MDEV_SAMPLES" == True ]]; then
|
||||||
|
async_runfunc compile_mdev_samples
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
extra)
|
||||||
|
if [[ "$NOVA_COMPILE_MDEV_SAMPLES" == True ]]; then
|
||||||
|
async_wait compile_mdev_samples
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
elif [[ $1 == "clean" ]]; then
|
||||||
|
rm -Rf $NOVA_KERNEL_TEMP
|
||||||
|
fi
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Whether or not to compile the mdev sample drivers from source
|
||||||
|
NOVA_COMPILE_MDEV_SAMPLES=$(trueorfalse True NOVA_COMPILE_MDEV_SAMPLES)
|
||||||
|
|
||||||
|
# Insert these mdev sample modules
|
||||||
|
NOVA_MDEV_SAMPLES=${NOVA_MDEV_SAMPLES:-mtty mdpy mdpy-fb mbochs}
|
||||||
|
|
||||||
|
# Temporary directory for kernel source
|
||||||
|
NOVA_KERNEL_TEMP=$DEST/kernel
|
Loading…
Reference in New Issue