Raspberry Pi – Updating the device’s firmware and kernel


To totally unlock this section you need to Log-in

The Raspberry Pi firmware is a critical piece of software, not linked to the operating system that we will use, as it will be flashed directly over the device and it will update the core software functions of the device. The following are the steps to keep the Raspberry Pi devices up to date.

On Raspberry Pi, the rpi-update will be the command/tool that we will use to check for firmware updates, available on the official repositories: this tool will download the most recent firmware and also updates kernel and its modules.

IMPORTANT NOTE: in general, the Firmware is a small package of code that usually lives on a special chip of a computer that helps the software know how to talk to the hardware. However, in the case of the Raspberry Pi, the firmware will live on the first partition of the SD card. Since the place the firmware is stored is actually flashed to the first partition of the SD card (sort of like a BIOS), you will not need to run this on every device. Once you load a new version of software or firmware onto an SD card, any device you plug that card into will be running that version.

All we have to do is running the rpi-update without any parameter (sudo rpi-update if using the pi user):

root@raspberrypi:~# rpi-update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Performing self-update
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
#############################################################
This update bumps to rpi-4.14.y linux tree
Be aware there could be compatibility issues with some drivers
Discussion here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=197689
##############################################################
*** Downloading specific firmware revision (this will take a few minutes)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 168 0 168 0 0 386 0 --:--:-- --:--:-- --:--:-- 387
100 56.2M 100 56.2M 0 0 2415k 0 0:00:23 0:00:23 --:--:-- 1721k
*** Updating firmware
*** Updating kernel modules
*** depmod 4.14.94-v7+
*** depmod 4.14.94+
*** Updating VideoCore libraries
*** Using HardFP libraries
*** Updating SDK
*** Running ldconfig
*** Storing current firmware revision
*** Deleting downloaded files
*** Syncing changes to disk
*** If no errors appeared, your firmware was successfully updated to 699879be36d90225232de87e9ae589be7209b14c
*** A reboot is needed to activate the new firmware

After this process you will need to do a reboot. But before that, let's capture the kernel version for historical reasons:

root@raspberrypi:~# uname -a
Linux becky 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

Now let’s reboot:

root@raspberrypi:~# shutdown -r now
Connection to 192.168.x.y closed by remote host.

Let's check kernel version again when Raspberry Pi is back online:

greys@raspberrypi:~ $ uname -a
Linux becky 4.14.94-v7+ #1193 SMP Tue Jan 22 15:34:30 GMT 2019 armv7l GNU/Linux

As expected, the kernel version got upgraded from 4.14.79-v7 to 4.14.94-v7.

Now that older kernel version is not holding any software updates back, let’s update everything on the Raspberry Pi.

First, we update software repos and get the latest packages information from them:

root@raspberrypi:~# apt-get update
...

And now deploy all the possible upgrades:

root@raspberrypi:~# apt-get upgrade
...

rpi-update GitHub repository


Summary
Article Name
Raspberry Pi - Updating the device's firmware and kernel
Description
The rpi-update command should periodically run on a Raspberry Pi device, to keep his firmware, kernel and kernel modules updated, using Raspberry Pi OS.
Author
Publisher Name
Heelpbook.net