15

Every time I update my Pi4, it runs needrestart which complains that I'm using an old kernel version and I should reboot, but rebooting doesn't change anything.

First, I have to precise that:

  1. I installed a full version on the SD Card (latest one in march 2020)
  2. I changed my cmdline.txt on the SDCard so as to boot on a hard disk
  3. The /boot partition is kept on the sd card...
  4. The image on the hard disk was previously used on RPi3B+. I updated it (dist-upgrade, full-upgrade) and it works quite well on the RPi4 except that needrestart says:

Pending kernel upgrade!

Running kernel version: 4.19.97-v7l+

Diagnostics: The currently running kernel version is not the expected kernel version 4.19.97-v8+.

Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting.

The /boot (on the SD card) and /lib/modules (on the hard disk) directories contain:

pi@raspberrypi ~ $ ls /lib/modules/
4.14.78+  4.14.78-v7+  4.19.97+  4.19.97-v7+  4.19.97-v7l+  4.19.97-v8+
pi@raspberrypi ~ $ ls /boot
 bcm2708-rpi-b.dtb        bcm2710-rpi-3-b-plus.dtb   fixup4.dat     kernel7.img        start4.elf
 bcm2708-rpi-b-plus.dtb   bcm2710-rpi-cm3.dtb        fixup4db.dat   kernel7l.img       start4x.elf
 bcm2708-rpi-cm.dtb       bcm2711-rpi-4-b.dtb        fixup4x.dat    kernel8.img        start_cd.elf
 bcm2708-rpi-zero.dtb     bootcode.bin               fixup_cd.dat   kernel.img         start_db.elf
 bcm2708-rpi-zero-w.dtb   cmdline.txt                fixup.dat      LICENCE.broadcom   start.elf
 bcm2709-rpi-2-b.dtb      config.txt                 fixup_db.dat   overlays           start_x.elf
 bcm2710-rpi-2-b.dtb      COPYING.linux              fixup_x.dat    start4cd.elf      'System Volume Information'
 bcm2710-rpi-3-b.dtb      fixup4cd.dat               issue.txt      start4db.elf

I ran for each img in /boot the command:

$ strings /boot/kernelXXX.img | grep -m 1 '^Linux version'

No output except for kernel8.img for which I got:

Linux version 4.19.97-v8+ (dom@buildbot) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)) #1294 SMP PREEMPT Thu Jan 30 13:27:08 GMT 2020

So I made a backup of kernel.img and copied kernel8.img to kernel.img, then reboot, but nothing changed...

Then I made a backup of kernel7l.img and (as the current version is 4.19.97-v7l+) copied kernel8.img to kernel7l.img, and reboot, but then no boot at all...

Back to the kernel7l.img and the initial problem remains...

I saw in another post that I can force it by using kernel=xxx in config.txt but that it is not the normal way it should work so I'd like to avoid doing this if it prevents me from changing to newer versions in the future. I'm also a little shy for using rpi-update with all the warnings around...

What should I do to move to the latest version of the kernel which is already installed on my Pi ???

Olivier
  • 431
  • 1
  • 4
  • 9

1 Answers1

16

Mixing @Dougie 's comment above and this post: https://www.raspberrypi.org/forums/viewtopic.php?t=270251&p=1639417

  1. the v8 kernel is experimental and should not be used
  2. needrestart is confused by this
  3. needrestart is often installed on your Pi because you installed docker

So either ignore the message or uninstall needrestart...

Olivier
  • 431
  • 1
  • 4
  • 9