Skip to content

Commit

Permalink
Update vagrant to kernel version 5.15
Browse files Browse the repository at this point in the history
Signed-off-by: sferna1 <santhosh.fernandes@gmail.com>
  • Loading branch information
sanfern committed Jun 24, 2023
1 parent 97b72c7 commit 007e16b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dev_environment/Vagrantfile
Expand Up @@ -33,6 +33,16 @@ Vagrant.configure("2") do |config|

l3af.vm.synced_folder cfg['host_l3afd_code_dir'], "/home/vagrant/code/l3afd"

l3af.vm.provision "shell", inline: <<-SHELL
wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
chmod +x ubuntu-mainline-kernel.sh
sudo mv ubuntu-mainline-kernel.sh /usr/local/bin/
sudo ubuntu-mainline-kernel.sh -i 5.15.0
SHELL

# restart after upgrade
l3af.vm.provision :reload

# Add Grafana apt repo
l3af.vm.provision "shell", inline: <<-SHELL
sudo apt-get install -y apt-transport-https
Expand Down
21 changes: 21 additions & 0 deletions dev_environment/setup_linux_dev_env.sh
Expand Up @@ -19,6 +19,27 @@ if [ "$VER" != "20" ]; then
fi
fi

# Check for kernel version 5.15
CURRENT_KERNEL_VERSION=$(uname -r | cut -d"." -f1-2)
CURRENT_KERNEL_MAJOR_VERSION=$(echo "${CURRENT_KERNEL_VERSION}" | cut -d"." -f1)
CURRENT_KERNEL_MINOR_VERSION=$(echo "${CURRENT_KERNEL_VERSION}" | cut -d"." -f2)
ALLOWED_KERNEL_VERSION="5.15"
ALLOWED_KERNEL_MAJOR_VERSION=$(echo ${ALLOWED_KERNEL_VERSION} | cut -d"." -f1)
ALLOWED_KERNEL_MINOR_VERSION=$(echo ${ALLOWED_KERNEL_VERSION} | cut -d"." -f2)
if [ "${CURRENT_KERNEL_MAJOR_VERSION}" -lt "${ALLOWED_KERNEL_MAJOR_VERSION}" ]; then
# If the current major version is less than the allowed major version, show an error message and exit.
echo "Error: Kernel ${CURRENT_KERNEL_VERSION} not supported, please update to ${ALLOWED_KERNEL_VERSION}."
exit
fi
if [ "${CURRENT_KERNEL_MAJOR_VERSION}" == "${ALLOWED_KERNEL_MAJOR_VERSION}" ]; then
# If the current major version is equal to the allowed major version, check the minor version.
if [ "${CURRENT_KERNEL_MINOR_VERSION}" -lt "${ALLOWED_KERNEL_MINOR_VERSION}" ]; then
# If the current minor version is less than the allowed minor version, show an error message and exit.
echo "Error: Kernel ${CURRENT_KERNEL_VERSION} not supported, please update to ${ALLOWED_KERNEL_VERSION}."
exit
fi
fi

# Get cpu architecture, arm or amd
ARCH=$(uname -p)

Expand Down

0 comments on commit 007e16b

Please sign in to comment.