# kernel returns the wrong version number

## MadNoah

I use the standard Gentoo kernel and the Efistub bootloader. 

Recently I upgraded the kernel to version 4.16.5 as shown in this wiki article: 

https://wiki.gentoo.org/wiki/Kernel/Upgrade

Although I uninstalled the old kernel sources and installed the new kernel, 

the command uname -a still gives me the old kernel version. 

However, if you edit the configuration file and reinstall the kernel, the desired effects will occur. 

Can someone explain this strange behavior?

```
# ls /usr/src/        

linux-4.16.5-gentoo/  linux@ 
```

```
# ls /usr/src/linux/

Documentation/  arch/   certs/   distro/   firmware/  include/  ipc/     lib/  net/      scripts/   sound/  usr/   COPYING  Kbuild   MAINTAINERS  Module.symvers  System.map  linux-4.16.5-gentoo@  modules.order  vmlinux.o

LICENSES/       block/  crypto/  drivers/  fs/        init/     kernel/  mm/   samples/  security/  tools/  virt/  CREDITS  Kconfig  Makefile     README          built-in.o  modules.builtin       vmlinux* 
```

```
# ls /boot/

efi/  System.map-4.16.5-gentoo  config-4.16.5-gentoo  vmlinuz-4.16.5-gentoo 
```

```
# uname -a

 Linux homunculus 4.9.95-gentoo #1 SMP Wed Apr 25 23:47:39 CEST 2018 x86_64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz GenuineIntel GNU/Linux 
```

```
# dmesg                                        

[    0.000000] Linux version 4.9.95-gentoo (root@livecd) (gcc version 6.4.0 (Gentoo 6.4.0-r1 p1.3) ) #1 SMP Wed Apr 25 23:47:39 CEST 2018 
```

----------

## fedeliallalinea

You tried to mount boot before ls?

```
# mount /boot

# ls /boot
```

----------

## MadNoah

yes

```
# mount /boot

mount: /boot: /dev/sda1 already mounted on /boot.
```

```
# ls /boot    

efi/  System.map-4.16.5-gentoo*  config-4.16.5-gentoo*  vmlinuz-4.16.5-gentoo*
```

----------

## MadNoah

that was the first thing i was thinking of, because of the dmesg output saying something strange about "root@livecd"

----------

## fedeliallalinea

And output of command

```
$ strings /boot/vmlinuz-4.16.5-gentoo |grep -E "^[1-4]\.[0-9][0-9]*\.[0-9][0-9]*" |awk '{print $1}' |head -1
```

----------

## MadNoah

```
# strings /boot/vmlinuz-4.16.5-gentoo |grep -E "^[1-4]\.[0-9][0-9]*\.[0-9][0-9]*" |awk '{print $1}' |head -1

4.16.5-gentoo
```

----------

## skellr

I think it's booting the stub kernel that is in the EFI directory, not the one in boot.

```
efibootmgr -v
```

----------

## MadNoah

Thanks. Efibootmgr -v gave some strange hexadezimal Output. Re emerging efibootmgr and running the above command resultet in no output. After creating a new boot entry the new kernel was booting without problems.  It is still mysterious to me why the old Kernel was even booting without a boot entry set.

----------

