<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Apt – Yeri Tiete</title>
    <link>https://yeri.be/tag/apt/</link>
    <description>Yeri Tiete&#39;s blog</description>
    <language>en</language>
    <copyright>© Yeri Tiete</copyright>
    <lastBuildDate>Tue, 24 Oct 2023 22:43:24 +0200</lastBuildDate>
    <atom:link href="https://yeri.be/tag/apt/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>RPi kernels in Bookworm</title>
      <link>https://yeri.be/rpi-kernels-in-bookworm/</link>
      <pubDate>Tue, 24 Oct 2023 22:43:24 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/rpi-kernels-in-bookworm/</guid><enclosure url="https://static.yeri.be/2023/10/kernel.jpg" length="0" type="image/jpeg" />
      <description>&lt;p&gt;Raspberry Pi recently &lt;a rel=&#34;noreferrer noopener&#34; href=&#34;https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/&#34; target=&#34;_blank&#34;&gt;launched Bookworm&lt;/a&gt;, and with that, a new kernel package. &lt;/p&gt;&#xA;&lt;p&gt;However, due to the massive changes from Bullseye to Bookworm, they are not suggesting a &lt;code&gt;dist-upgrade&lt;/code&gt;. &lt;/p&gt;&#xA;&lt;blockquote class=&#34;wp-block-quote&#34;&gt;&#xA;&lt;p&gt;In the past, we have suggested procedures for updating an existing image to the new version, but always with the caveat that we do not recommend it, and you do this at your own risk.&lt;/p&gt;&#xA;&lt;p&gt;This time, because the changes to the underlying architecture are so significant, we are not suggesting any procedure for upgrading a Bullseye image to Bookworm; any attempt to do this will almost certainly end up with a non-booting desktop and data loss.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2023/10/kernel.jpg" alt="RPi kernels in Bookworm"></p><p>Raspberry Pi recently <a rel="noreferrer noopener" href="https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/" target="_blank">launched Bookworm</a>, and with that, a new kernel package. </p>
<p>However, due to the massive changes from Bullseye to Bookworm, they are not suggesting a <code>dist-upgrade</code>. </p>
<blockquote class="wp-block-quote">
<p>In the past, we have suggested procedures for updating an existing image to the new version, but always with the caveat that we do not recommend it, and you do this at your own risk.</p>
<p>This time, because the changes to the underlying architecture are so significant, we are not suggesting any procedure for upgrading a Bullseye image to Bookworm; any attempt to do this will almost certainly end up with a non-booting desktop and data loss.</p>
<cite><a href="https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/" target="_blank" rel="noreferrer noopener">Bookworm — the new version of Raspberry Pi OS</a></cite></blockquote>
<p>But screw that, ain't nobody got time to reinstall all their RPis in the wild (and in all fairness, I've had zero issues updating; just some messing around with kernels -- hence the post)...</p>
<p>As this is not very well documented, and Raspberry Pi, across all their versions, has <a href="https://www.baeldung.com/linux/arm64-armel-armhf-overview" target="_blank" rel="noreferrer noopener">4 different architectures</a>, it's confusing. </p>
<p>There's a quick <a rel="noreferrer noopener" href="https://gist.github.com/jauderho/6b7d42030e264a135450ecc0ba521bd8" target="_blank">dirty guide</a> on how to update from <code>raspberrypi-kernel</code> and <code>raspberrypi-bootloader</code> to <code>linux-image-rpi</code>.</p>
<p>However, it's unclear in terms of which kernel to pick, so here goes:</p>
<ul>
<li>RPi3 (including RPi4) and newer in 64 bit<sup data-fn="0f5f6479-f0ea-4fac-a731-9e31357bd843" class="fn"><a href="#0f5f6479-f0ea-4fac-a731-9e31357bd843" id="0f5f6479-f0ea-4fac-a731-9e31357bd843-link">1</a></sup> (aarch64): <br /><code>apt install -y linux-image-rpi-v8 linux-headers-rpi-v8</code></li>
<li>RPi4 and 400 in 32 bit<sup data-fn="dd6d6631-b7cf-4b99-9f8c-4de4e6f782b3" class="fn"><a href="#dd6d6631-b7cf-4b99-9f8c-4de4e6f782b3" id="dd6d6631-b7cf-4b99-9f8c-4de4e6f782b3-link">2</a></sup>:<br /><code>apt install -y linux-image-rpi-v7l linux-headers-rpi-v7l</code></li>
<li>RPi2 (only 32bit) or 3, 3+, Zero 2 W, Compute Modules 3 and 3+ in 32 bit mode<sup data-fn="4be59b98-e820-4499-875e-ce58820aafeb" class="fn"><a href="#4be59b98-e820-4499-875e-ce58820aafeb" id="4be59b98-e820-4499-875e-ce58820aafeb-link">3</a></sup> (armhf): <br /><code>apt install -y linux-image-rpi-v7 linux-headers-rpi-v7</code></li>
<li>RPi1, Zero, Zero W, Compute Module 1 (armel):<br /><code>apt install -y linux-image-rpi-v6 linux-headers-rpi-v6</code></li>
</ul>
<p>This mostly comes from <a rel="noreferrer noopener" href="https://www.raspberrypi.com/documentation/computers/linux_kernel.html#building-the-kernel" target="_blank">here</a>.</p>
<p>So, in short, this is what worked for me. As I use <a href="https://yeri.be/tag/wireguard">Wireguard</a> as well, I needed to remove the package first to prevent conflicts.</p>
<pre class="wp-block-code"><code>apt remove -y wireguard
apt autoremove -y

dpkg --purge --force-depends raspberrypi-kernel raspberrypi-bootloader
umount /boot
fsck -y /boot
mkdir /boot/firmware
sed -i.bak -e "s#boot#boot/firmware#" /etc/fstab
systemctl daemon-reload
mount /boot/firmware
apt install raspi-firmware -y

# rpi3+ 64bit
#apt install linux-image-rpi-v8 linux-headers-rpi-v8
# rpi4+ 32bit
#apt install linux-image-rpi-v7l linux-headers-rpi-v7l
# rpi2 and rest
#apt install linux-image-rpi-v7 linux-headers-rpi-v7
# rpi1
#apt install linux-image-rpi-v6 linux-headers-rpi-v6

sed -i.bak '$ a\auto_initramfs=1' /boot/firmware/config.txt 

apt install wireguard -y
systemctl enable wg-quick@wg0.service
systemctl start wg-quick@wg0.service

# reboot</code></pre>
<p>When running <code>apt install &lt;kernel&gt;</code> -- do write down the package it'll install. The listed packages are just meta packages and will pull a bunch of other packages that actually hold the important files. Running <code>apt --reinstall</code> on those meta packages, for example, won't actually reinstall the kernel.</p>
<p>To roll back, you can purge those packages and reinstall <code>raspberrypi-kernel raspberrypi-bootloader</code> (be aware of the path changes in <code>/boot</code>). If you made a mistake, just <code>apt install --reinstall -y &lt;all the packages you wrote down&gt;</code> and it should reinstall everything.</p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>software</category>
      <category>apt</category><category>kernel</category><category>raspberrypi</category>
    </item>
    
  </channel>
</rss>
