NAME

Linux::Info::KernelRelease - parses and provide Linux kernel detailed information

SYNOPSIS

Getting the current kernel information:

my $current = Linux::Info::KernelRelease->new( Linux::Info::SysInfo->new->get_release );

Or using a given kernel information:

my $kernel = Linux::Info::KernelRelease->new('2.4.20-0-generic');

Now you can compare both:

if ($current > $kernel) {
    say 'System kernel was upgraded!';
}

DESCRIPTION

This module parses the Linux kernel information obtained from sources like the uname command and others.

This make it easier to fetch each information piece of information from the string and also to compare different kernel versions, since instances of this class overload operators like ">=", ">" and "<".

METHODS

new

Creates a new instance.

Expects as parameter the kernel release information (like from uname -r output). This is required.

Optionally, you can pass the kernel mainline information if available (as from /proc/version_signature on Ubuntu Linux). With this parameter, more information will be available.

get_raw

Returns the raw information stored, as passed to the new method.

get_mainline_version

Returns the mainline kernel-version.

get_abi_bump

Returns the application binary interface (ABI) bump from the kernel.

get_flavour

Returns the kernel flavour parameter.

get_major

From the version, returns the integer corresponding to the major number.

get_minor

From the version, returns the integer corresponding to the minor number.

get_patch

From the version, returns the integer corresponding to the patch number.

SEE ALSO

  • https://ubuntu.com/kernel

  • https://www.unixtutorial.org/use-proc-version-to-identify-your-linux-release/

AUTHOR

Alceu Rodrigues de Freitas Junior, <glasswalk3r@yahoo.com.br>

COPYRIGHT AND LICENSE

This software is copyright (c) 2024 of Alceu Rodrigues de Freitas Junior, <glasswalk3r@yahoo.com.br>

This file is part of Linux Info project.

Linux-Info is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Linux-Info is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Linux Info. If not, see <http://www.gnu.org/licenses/>.