<?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>Kernel – Yeri Tiete</title>
    <link>https://yeri.be/tag/kernel/</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/kernel/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>
    
    <item>
      <title>VMware Server and kernel 2.6.33</title>
      <link>https://yeri.be/vmware-server-and-kernel-2-6-33/</link>
      <pubDate>Mon, 15 Mar 2010 17:08:21 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/vmware-server-and-kernel-2-6-33/</guid>
      <description>&lt;p&gt;Trying to recompile the VMware Server 2.0.2 on kernel 2.6.33 I came upon these two errors:&lt;/p&gt;&#xA;&lt;blockquote&gt;# uname -a&#xA;Linux Sauron 2.6.33 #1 SMP Tue Mar 9 15:09:05 CET 2010 x86_64 AMD Opteron(tm) Processor 248 AuthenticAMD GNU/Linux&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://home.tiete.be/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;This&lt;/a&gt; is a Gentoo machine.&lt;/p&gt;&#xA;&lt;p&gt;Error 1:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;div id=&#34;_mcePaste&#34;&gt;The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match&lt;/div&gt;&#xA;&lt;div id=&#34;_mcePaste&#34;&gt;your running kernel (version 2.6.33).  Even if the module were to compile&lt;/div&gt;&#xA;&lt;div id=&#34;_mcePaste&#34;&gt;successfully, it would not load into the running kernel.&lt;/div&gt;&#xA;&lt;div id=&#34;_mcePaste&#34;&gt;What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]&lt;/div&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;This can be resolved by editing &lt;em&gt;version.h&lt;/em&gt; (usually in &lt;em&gt;/usr/src/linux/include/linux&lt;/em&gt;) and adding this line:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Trying to recompile the VMware Server 2.0.2 on kernel 2.6.33 I came upon these two errors:</p>
<blockquote># uname -a
Linux Sauron 2.6.33 #1 SMP Tue Mar 9 15:09:05 CET 2010 x86_64 AMD Opteron(tm) Processor 248 AuthenticAMD GNU/Linux</blockquote>
<p><a href="http://home.tiete.be/" target="_blank" rel="noopener noreferrer">This</a> is a Gentoo machine.</p>
<p>Error 1:</p>
<blockquote>
<div id="_mcePaste">The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match</div>
<div id="_mcePaste">your running kernel (version 2.6.33).  Even if the module were to compile</div>
<div id="_mcePaste">successfully, it would not load into the running kernel.</div>
<div id="_mcePaste">What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]</div></blockquote>
<p>This can be resolved by editing <em>version.h</em> (usually in <em>/usr/src/linux/include/linux</em>) and adding this line:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#define UTS_RELEASE &#34;2.6.33&#34;</span>
</span></span></code></pre></div><p>Error 2:</p>
<blockquote>The path "/usr/src/linux/include" is a kernel header file directory, but it does not contain the file "linux/autoconf.h" as expected.  This can happen if the kernel has never been built, or if you have invoked the "make mrproper" command in your kernel directory.  In any case, you may want to rebuild your kernel.
What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]</blockquote>
<p>As the latest kernel doesn&rsquo;t seem to contain this file, I took the <a href="https://static.yeri.be/2010/03/autoconf.h" target="_blank" rel="noopener noreferrer">autoconf.h</a> file from 2.6.22.2, and copied it to the correct place. This made VMware compile (until it errored on other stuff, which can be fixed using <a href="https://web.archive.org/web/20101122085804/http://radu.cotescu.com:80/2010/01/19/how-to-install-vmware-server-ubuntu-fedora-opensuse/" target="_blank" rel="noopener noreferrer">this script</a>).</p>
<p>I&rsquo;m fairly clueless what implications it can have to make these changes. So use at your own risk. :)</p>
]]></content:encoded>
      <category>errors</category><category>linux</category>
      <category>gentoo</category><category>kernel</category><category>vmware</category>
    </item>
    
  </channel>
</rss>
