Ubuntu 16.04.3 LTS - LINUX_VERSION_CODE parece incorreto

0

Descobri que LINUX_VERSION_CODE definido em /usr/include/linux/version.h na minha máquina Ubuntu 16.04.3 LTS é (equivalente a) 4.4.90, enquanto espera-se que seja 4.10.0.

bash% lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:    16.04
Codename:   xenial

bash% bash% uname -r
4.10.0-28-generic

bash% cat /usr/include/linux/version.h 
#define LINUX_VERSION_CODE 263258
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

bash% perl
my $version=263258;
my $a=($version >> 16) & 0xff;
my $b=($version >> 8) & 0xff;
my $c=$version & 0xff;
print "$version -> $a.$b.$c\n";
263258 -> 4.4.90

Portanto, uma macro de pré-processamento como a seguir não funciona.

#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0).
// do something
#endif

Isso significa que tenho algum problema de instalação? Ou é recomendável não usar o LINUX_VERSION_CODE no Ubuntu?

    
por Ryujiro Shibuya 05.12.2017 / 10:26

1 resposta

0

Parece que você tem um arquivo de cabeçalhos de kernel específico da versão instalado que não corresponde ao seu kernel em execução, provavelmente. Costumava haver um meta-pacote que manteria o atual instalado, não importa o quê.

Aqui está a referência

    
por RobotHumans 05.12.2017 / 10:39