Raspberry Pi - Upgrade kernel from repos: Difference between revisions
Krystianch (talk | contribs) m (Remove todo) Tag: Manual revert |
TheLastPsion (talk | contribs) (Added information about the -p switch in update-kernel.) |
||
Line 3: | Line 3: | ||
However, if you need a newer kernel that is available in the repositories but is not yet part of a release, you might consider using the {{ic|update-kernel}} script. | However, if you need a newer kernel that is available in the repositories but is not yet part of a release, you might consider using the {{ic|update-kernel}} script. | ||
The catch is, on a Raspberry Pi | The catch is, on a Raspberry Pi 3, 1GB of RAM is not enough to successfully run it. | ||
Also, the script doesn't work in diskless mode because of the read-only modloop mount. | Also, the script doesn't work in diskless mode because of the read-only modloop mount. | ||
There is a workaround, though. | There is a workaround, though. | ||
# Generate boot files, including the new kernel in sys mode. | |||
# Transfer boot files to the target diskless mode microSD card. | |||
== Generate boot files == | == Generate boot files == | ||
Line 18: | Line 17: | ||
This will take a while. | This will take a while. | ||
{{Cmd| | {{Cmd|mkdir /root/tmp | ||
mkdir /root/boot | mkdir /root/boot | ||
TMPDIR{{=}}/root/tmp update-kernel -a armhf -f rpi -M /root/boot}} | TMPDIR{{=}}/root/tmp update-kernel -a armhf -f rpi -M /root/boot}} | ||
Line 28: | Line 27: | ||
Copy all files from {{path|/root/boot}} to the target microSD card's root. | Copy all files from {{path|/root/boot}} to the target microSD card's root. | ||
The Pi should be able to boot from this card and the kernel should now be upgraded. | The Pi should be able to boot from this card and the kernel should now be upgraded. | ||
== Adding kernel modules and firmware == | |||
You can also add modules by using the {{ic|-p}} switch, followed by the package name. | |||
For example, if you wanted to include the ZFS kernel module, you would change the above {{ic|update-kernel}} command line to the following: | |||
{{Cmd|TMPDIR{{=}}/root/tmp update-kernel -a armhf -f rpi -p zfs-rpi -M /root/boot}} | |||
This will add the specified modules into the {{modloop}} volume. | |||
[[Category:Raspberry]] | [[Category:Raspberry]] |
Revision as of 16:58, 19 August 2024
In diskless setups the kernel upgrade is not part of the regular upgrade process. To do that, one can get the new kernel from the latest release tarball.
However, if you need a newer kernel that is available in the repositories but is not yet part of a release, you might consider using the update-kernel
script.
The catch is, on a Raspberry Pi 3, 1GB of RAM is not enough to successfully run it.
Also, the script doesn't work in diskless mode because of the read-only modloop mount.
There is a workaround, though.
- Generate boot files, including the new kernel in sys mode.
- Transfer boot files to the target diskless mode microSD card.
Generate boot files
Grab a fresh microSD card and install Alpine Linux on it.
Boot it on a Raspberry Pi, install the system in sys mode by running setup-disks
and reboot.
Log in as root, then run update-kernel as follows.
This will take a while.
mkdir /root/tmp mkdir /root/boot TMPDIR=/root/tmp update-kernel -a armhf -f rpi -M /root/boot
All files necessary to boot the newest kernel available in repos are now in /root/boot.
Transfer boot files
Copy all files from /root/boot to the target microSD card's root. The Pi should be able to boot from this card and the kernel should now be upgraded.
Adding kernel modules and firmware
You can also add modules by using the -p
switch, followed by the package name.
For example, if you wanted to include the ZFS kernel module, you would change the above update-kernel
command line to the following:
TMPDIR=/root/tmp update-kernel -a armhf -f rpi -p zfs-rpi -M /root/boot
This will add the specified modules into the Template:Modloop volume.