1

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 ???

  • Ignore this. The V8 kernel is the experimental 64-bit kernel and you're not using it. Also stop running sudo rpi-update unless you fully understand what it does and how to recover your system in 20 minutes when it breaks something. – Dougie Apr 10 at 18:28
  • Thanks @Dougie . Actually, as said in the post, I didn't use rpi-update as far as I remember and didn't want to. So I don't really know how the v8 kernel was installed... Also for those interested, it appears that needrestart is pulled by docker (that I installed a while ago for testing things) – Olivier Apr 11 at 8:18
  • I think they're delivering the v8 kernel with the raspberrypi-kernel package now. I wouldn't know as I'm working with rpi-update on testing the 5.4 kernel (which is extremely experimental stuff that the RPF folks release a couple of weeks ago). – Dougie Apr 11 at 15:29
1

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...

| improve this answer | |
  • I wonder how much of this stuff is done by the docker package. It did extremely bad things to networking on the machine I installed it on. I've never seen the needrestart stuff on a plain Raspbian system. – Dougie Apr 11 at 15:31
  • There is another issue I haven't seen before. in /lib/modules there are modules of an old version 4.14.78*+. Maybe this is confusing needrestart? Move them away and test reboot. – Ingo Apr 11 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.