Upgrading kernel

From MiRTA PBX documentation
Jump to navigation Jump to search

Upgrade Kernel

MiRTA PBX is used to run on CentOS 6, 7 and 9, 64bit.

Most modern servers have features that are working not optimal with the stock kernels. This is especially true for CentOS 6, having problems with large memory servers. To avoid these problems, it is possible to upgrade safely the servers to the latest stable Kernel 4.

Download the signature for repository Elrepo

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

Download the repo package:

For CentOS 6:

rpm -Uvh https://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm

For CentOS 7:

rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

Activate the new repo "elrepo-kernel" and then install the kernel-lt and kernel-lt-devel

For CentOS 6, you need to edit the grub.conf and select the boot option for the new kernel

For CentOS 7, it is a bit tricky. First you need to identify the kernel menu entry:

 grep '^menuentry' /boot/grub2/grub.cfg

Then edit the default menu entry and set the one identified above, like GRUB_DEFAULT=0

 /etc/default/grub

Rebuild the grub configuration with

 grub2-mkconfig -o /boot/grub2/grub.cfg

To temporarily try the kernel run the command

 grub2-reboot <id>

Upgrading Kernel modules

If you are upgrading the kernel from 2.6 to 4.4, the GeoIP module requested is different. In this case, once the server restarts, the GeoIP module will fail to start and you may be locked out of your server. It can be a good idea to disable GeoIP support before performing the upgrade and then recompile the right module and then activate back GeoIP.

If you are moving from kernel 2.6 to 4.4, once running kernel 4.4 perform the following steps:

 cd /usr/local/src  
 \rm -r xtables*
 wget http://devel.mirtapbx.com/mirtapbx_support/xtables-addons-2.10.tar.xz
 tar xvf xtables-addons-2.10.tar.xz
 cd xtables-addons-2.10
 wget http://devel.mirtapbx.com/mirtapbx_support/mconfig_1.37
 mv mconfig_1.37 mconfig
 ./configure ; make ; make install

Dahdi module instead, is fully compatible between kernel versions

Updating Kernel modules

MiRTA PBX relies on two kernel modules, geoip and dahdi. The first allows to filter packets based on the geographical location, so you can avoid receiving call attempts from foreign countries, the second make conferences to work. When the kernel is upgraded, during a normal CentOS upgrade, these kernel modules will be not automatically regenerated for the new kernel. In this case, you need to reboot the server into new kernel and recompile both.

Recompiling dahdi

Dahdi installation directory is in /usr/local/src, so it will be enough to run:

cd /usr/local/src/dahdi*
make
make install
service dahdi restart

Recompiling geoip

GeoIP installation directory is in /usr/local/src, so it will be enough to run:

cd /usr/local/src/xtables*
./configure
make
make install

Problems with CentOS 9

The people at Redhat are doing an odd work, by merging changes from newer kernels into the 5.14.0 kernel used by CentOS 9 and derivatives. The result is dahdi is no longer able to compile successfully on some newer versions because the structure of the kernel source is changed, but the installation script still see it as 5.14.0.

For now these are the working tested kernels:

  • 5.14.0-362
  • 5.14.0-378

for now you can download the packages for 362 from

https://demo.mirtapbx.com/mirtapbx_support/kernel-5.14.0-362.tar.gz

Useful commands to list and change the default kernel:

 grubby --info=ALL
 grubby --set-default /boot/vmlinuz-5.14.0-362.18.1.el9_3.x86_64