How would I go about upgrading the CentOS-5.11 kernel from 2.6.18-398 to 2.6.24 (or newer)? I'm trying to setup automated VeraCrypt Encrypted Volume on NAS devices. Currently there are known bugs with any kernel version older then 2.6.24. Also I can't upgrade to CentOS-6 for this particular environment.
CentOS/RHEL 5 kernels are not just vanilla 2.6.18; they contain innumerable backports of features and bug fixes from newer kernels. They're pinned to a specific kernel release number to maintain ABI compatibility.
You could certainly download and build a newer 2.6 kernel, but it will lack all of the extra stuff provided with the CentOS/RHEL kernel, which may pose other compatibility problems with the rest of the system.
I suggest the following:
- Verify whether Veracrypt is truly certified for use on CentOS/RHEL 5. If it is, and there are known bugs, Veracrypt may have a workaround.
- Check the changelog for 2.6.18-419, as the bugs you're worried about may indeed be fixed in it.
In the end, @steve is correct. CentOS 5 is EOL, and the proper path forward is to upgrade. Unless the 2.6.18-419 kernel contains fixes for the bugs you're worried about, I submit that what you're being asked to do is unreasonable.
Looking at http://vault.centos.org/5.11/updates/x86_64/RPMS/ suggests the most recent update (25-Feb-2017) is kernel-2.6.18-419.
Furthermore, https://en.wikipedia.org/wiki/CentOS#End-of-support_schedule suggests CentOS 5 doesn't get updates any more.
You need to rethink this and upgrade to an OS that's actually supported/maintained.