<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>It's Pi all the way down... - usb</title><link href="https://waldorf.waveform.org.uk/" rel="alternate"></link><link href="https://waldorf.waveform.org.uk/feeds/usb.atom.xml" rel="self"></link><id>https://waldorf.waveform.org.uk/</id><updated>2023-08-01T17:02:11+01:00</updated><entry><title>You boot — no, u-boot first!</title><link href="https://waldorf.waveform.org.uk/2021/you-boot-no-u-boot-first.html" rel="alternate"></link><published>2021-05-05T00:00:00+01:00</published><updated>2023-08-01T17:02:11+01:00</updated><author><name>Dave Jones</name></author><id>tag:waldorf.waveform.org.uk,2021-05-05:/2021/you-boot-no-u-boot-first.html</id><summary type="html">&lt;p class="first last"&gt;Bypassing U-Boot to enable &lt;span class="caps"&gt;USB&lt;/span&gt; boot on Ubuntu&amp;nbsp;Focal&lt;/p&gt;
</summary><content type="html">&lt;p&gt;A frequently asked question on the various #ubuntu-* channels I lurk around on
FreeNode is that of getting Ubuntu Focal (20.04) booting from &lt;span class="caps"&gt;USB&lt;/span&gt; on a Pi. The
major issue here is that Focal still uses U-Boot and that doesn&amp;#8217;t work with
&lt;span class="caps"&gt;USB&lt;/span&gt; boot on the Pi (our U-Boot build does now support both the &lt;span class="caps"&gt;USB2&lt;/span&gt; and &lt;span class="caps"&gt;USB3&lt;/span&gt;
ports on the Pi 4, but the &lt;span class="caps"&gt;MSD&lt;/span&gt; support doesn&amp;#8217;t work for some&amp;nbsp;reason).&lt;/p&gt;
&lt;p&gt;However, U-Boot isn&amp;#8217;t critical to booting Ubuntu. In fact, on the armhf images
it&amp;#8217;s basically redundant. On the arm64 images though it does have one very
important job: decompressing the gzip&amp;#8217;d&amp;nbsp;kernel.&lt;/p&gt;
&lt;p&gt;How come the kernel doesn&amp;#8217;t decompress itself? Because arm64 kernels can&amp;#8217;t. For
whatever reason, the Linux kernel includes self-extraction code for x86 and
armhf … but not arm64 where &amp;#8220;that&amp;#8217;s the bootloader&amp;#8217;s job&amp;#8221;. Around the time of
Focal&amp;#8217;s release, the Pi&amp;#8217;s native bootloader didn&amp;#8217;t support any kind of
extraction, so we shipped a U-Boot script to handle decompressing the gzip&amp;#8217;d&amp;nbsp;kernel.&lt;/p&gt;
&lt;p&gt;Later on in 2020, the Pi&amp;#8217;s bootloader got an upgrade to support decompressing
gzip&amp;#8217;d kernels but Focal&amp;#8217;s boot sequence still uses U-Boot because forcing a
boot sequence change on existing installations is not something I&amp;#8217;m keen to do
unless absolutely necessary (that said, it&amp;#8217;s something that&amp;#8217;ll need tackling
for the upgrade to the next &lt;span class="caps"&gt;LTS&lt;/span&gt;).&lt;/p&gt;
&lt;div class="section" id="on-a-fresh-install"&gt;
&lt;h2&gt;On a Fresh&amp;nbsp;Install&lt;/h2&gt;
&lt;p&gt;First let&amp;#8217;s tackle installing a completely new Focal image on a &lt;span class="caps"&gt;USB&lt;/span&gt; &lt;span class="caps"&gt;SSD&lt;/span&gt; and
adapting it so it&amp;#8217;ll boot from &lt;span class="caps"&gt;USB&lt;/span&gt;. Bear in mind your Pi 4 will already need to
be configured to &lt;a class="reference external" href="https://waldorf.waveform.org.uk/2020/installing-the-new-pi-ubuntu-desktop.html#usb-hdd-ssd"&gt;boot from &lt;span class="caps"&gt;USB&lt;/span&gt;&lt;/a&gt; so do that first if you haven&amp;#8217;t already (this
is one-time setup though so if you can already boot your Pi 4 from &lt;span class="caps"&gt;USB&lt;/span&gt;, you&amp;#8217;re
all&amp;nbsp;set).&lt;/p&gt;
&lt;p&gt;Flash the Focal arm64 image (which must be point release 2 or later) straight
to your &lt;span class="caps"&gt;SSD&lt;/span&gt; drive. The easiest way to do this is with the &lt;a class="reference external" href="https://www.raspberrypi.org/software/"&gt;Raspberry Pi imaging
utility&lt;/a&gt;:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;Slot your &lt;span class="caps"&gt;SSD&lt;/span&gt; drive into a &lt;span class="caps"&gt;USB3&lt;/span&gt; enclosure of some sort (personally I find
the &lt;a class="reference external" href="https://www.amazon.co.uk/gp/product/B00IJNDBM4"&gt;Inateck &lt;span class="caps"&gt;FE2004&lt;/span&gt;&lt;/a&gt; works nicely) and plug that into your &lt;span class="caps"&gt;PC&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Start up the imaging&amp;nbsp;utility&lt;/li&gt;
&lt;li&gt;Select &amp;#8220;&lt;span class="caps"&gt;CHOOSE&lt;/span&gt; &lt;span class="caps"&gt;OS&lt;/span&gt;&amp;#8221;, &amp;#8220;Other general purpose &lt;span class="caps"&gt;OS&lt;/span&gt;&amp;#8221;, &amp;#8220;Ubuntu&amp;#8221;, &amp;#8220;Ubuntu Server
20.04.2 &lt;span class="caps"&gt;LTS&lt;/span&gt; (RPi3/4/400)&amp;#8221; (if you&amp;#8217;re reading this from the future, any later
point release like .3 will be fine&amp;nbsp;too)&lt;/li&gt;
&lt;li&gt;Select &amp;#8220;&lt;span class="caps"&gt;CHOOSE&lt;/span&gt; &lt;span class="caps"&gt;STORAGE&lt;/span&gt;&amp;#8221; and pick your &lt;span class="caps"&gt;SSD&lt;/span&gt; drive (if you&amp;#8217;ve no other
removable storage attached it&amp;#8217;ll probably be the only thing&amp;nbsp;listed)&lt;/li&gt;
&lt;li&gt;Select &amp;#8220;&lt;span class="caps"&gt;WRITE&lt;/span&gt;&amp;#8221; and twiddle thumbs / make coffee while everything&amp;nbsp;finishes&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now, jump to the &amp;#8220;Boot Surgery&amp;#8221; section&amp;nbsp;below!&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="from-an-existing-install"&gt;
&lt;h2&gt;From an Existing&amp;nbsp;Install&lt;/h2&gt;
&lt;p&gt;Converting an existing &lt;span class="caps"&gt;SD&lt;/span&gt; card installation is a very similar procedure. First
we&amp;#8217;ll deal with transferring the content of the &lt;span class="caps"&gt;SD&lt;/span&gt; card to the &lt;span class="caps"&gt;SSD&lt;/span&gt;. I&amp;#8217;m
assuming here that your &lt;span class="caps"&gt;SSD&lt;/span&gt; is at least as large as your &lt;span class="caps"&gt;SD&lt;/span&gt; card. If that isn&amp;#8217;t
the case you&amp;#8217;ll need to go and read about shrinking partitions and such-like
but it sounds rather unlikely so I&amp;#8217;m going to skip all that&amp;nbsp;here.&lt;/p&gt;
&lt;p&gt;The first step is simply to make sure that your installation is up to date. You
&lt;em&gt;must&lt;/em&gt; have an updated bootloader for this to work, so boot your &lt;span class="caps"&gt;SD&lt;/span&gt; card and
run a typical &lt;tt class="docutils literal"&gt;sudo apt update&lt;/tt&gt;, &lt;tt class="docutils literal"&gt;sudo apt upgrade&lt;/tt&gt; cycle. Then shut the Pi
down, and get a machine running Linux other than your Pi with an &lt;span class="caps"&gt;SD&lt;/span&gt; card reader
and a &lt;span class="caps"&gt;USB&lt;/span&gt;&amp;nbsp;port.&lt;/p&gt;
&lt;div class="admonition note"&gt;
&lt;p class="first admonition-title"&gt;Note&lt;/p&gt;
&lt;p class="last"&gt;It is possible to do this on a Pi, especially one that&amp;#8217;s already &lt;span class="caps"&gt;USB&lt;/span&gt; booted
where you can use the internal &lt;span class="caps"&gt;SD&lt;/span&gt; reader as a source, and a spare &lt;span class="caps"&gt;USB&lt;/span&gt; port
as a target, but that&amp;#8217;s rather circular so for the purposes of this article
let&amp;#8217;s assume you&amp;#8217;ve got an Ubuntu &lt;span class="caps"&gt;PC&lt;/span&gt; lying&amp;nbsp;around!&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;On your &lt;span class="caps"&gt;PC&lt;/span&gt;, insert your &lt;span class="caps"&gt;SD&lt;/span&gt; card and your &lt;span class="caps"&gt;SSD&lt;/span&gt; in some appropriate &lt;span class="caps"&gt;USB&lt;/span&gt; enclosure.
I&amp;#8217;m going to assume your &lt;span class="caps"&gt;SD&lt;/span&gt; card appears as &lt;tt class="docutils literal"&gt;/dev/mmcblk0&lt;/tt&gt; and your &lt;span class="caps"&gt;USB&lt;/span&gt;
enclosed &lt;span class="caps"&gt;SSD&lt;/span&gt; as &lt;tt class="docutils literal"&gt;/dev/sdf&lt;/tt&gt; below. If you want to be certain, &lt;em&gt;before&lt;/em&gt;
inserting the devices run &lt;code class="bash"&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;dmesg&lt;span class="w"&gt; &lt;/span&gt;-w&lt;/code&gt; and watch the output as you insert
them. The device names should be apparent from the&amp;nbsp;output.&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;First, ensure nothing on the &lt;span class="caps"&gt;SD&lt;/span&gt; card or &lt;span class="caps"&gt;SSD&lt;/span&gt; is mounted: &lt;code class="bash"&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;umount&lt;span class="w"&gt;
&lt;/span&gt;/dev/mmcblk0p1&lt;/code&gt;, &lt;code class="bash"&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;umount&lt;span class="w"&gt; &lt;/span&gt;/dev/mmblk0p2&lt;/code&gt;, …, &lt;code class="bash"&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;umount&lt;span class="w"&gt;
&lt;/span&gt;/dev/sdf1&lt;/code&gt;, &lt;code class="bash"&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;umount&lt;span class="w"&gt; &lt;/span&gt;/dev/sdf2&lt;/code&gt;. Check the output of &lt;code class="bash"&gt;mount&lt;/code&gt;
to make sure no partitions from these devices are still&amp;nbsp;mounted.&lt;/li&gt;
&lt;li&gt;Next transfer everything from the source to the target with good ol&amp;#8217;
disk-destroyer: &lt;code class="bash"&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;dd&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/dev/mmcblk0&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;of&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/dev/sdf&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;bs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;16M&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;progress&lt;/code&gt;; be &lt;strong&gt;damned sure&lt;/strong&gt; you get the &lt;tt class="docutils literal"&gt;of=&lt;/tt&gt; device name
correct&amp;nbsp;here!&lt;/li&gt;
&lt;li&gt;Be warned this transfer will take &lt;em&gt;much&lt;/em&gt; longer than just writing a normal
image as it&amp;#8217;ll include all the blank unused blocks on the &lt;span class="caps"&gt;SD&lt;/span&gt; card too, so
prepare for much thumb twiddling / coffee&amp;nbsp;drinking!&lt;/li&gt;
&lt;li&gt;Run &lt;code class="bash"&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;sync&lt;/code&gt; (probably unnecessary but no harm in a little&amp;nbsp;paranoia)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now continue with&amp;nbsp;…&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="boot-surgery"&gt;
&lt;h2&gt;Boot&amp;nbsp;Surgery&lt;/h2&gt;
&lt;p&gt;Now for some surgery on the boot configuration. Unplug the &lt;span class="caps"&gt;SSD&lt;/span&gt;&amp;#8217;s enclosure from
your &lt;span class="caps"&gt;PC&lt;/span&gt; and then plug it back in so that the freshly written boot partition
(labelled &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;system-boot&lt;/span&gt;&lt;/tt&gt;) auto-mounts (if your &lt;span class="caps"&gt;PC&lt;/span&gt; is running Linux, the
&lt;tt class="docutils literal"&gt;writable&lt;/tt&gt; partition will likely auto-mount too, but &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;system-boot&lt;/span&gt;&lt;/tt&gt; should
auto-mount on everything including Windows and Mac &lt;span class="caps"&gt;OS&lt;/span&gt;&amp;nbsp;X).&lt;/p&gt;
&lt;p&gt;On the &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;system-boot&lt;/span&gt;&lt;/tt&gt; partition that&amp;#8217;s mounted, find the &lt;tt class="docutils literal"&gt;config.txt&lt;/tt&gt; file
and open it in a text editor (I &lt;em&gt;think&lt;/em&gt; Notepad can handle &lt;span class="caps"&gt;UNIX&lt;/span&gt; line-endings
these days; Windows users please let me know if this isn&amp;#8217;t the case!). It
should look like&amp;nbsp;this:&lt;/p&gt;
&lt;div class="topic"&gt;
&lt;p class="topic-title"&gt;config.txt&lt;/p&gt;
&lt;pre class="code ini literal-block"&gt;
&lt;span class="ln"&gt; 1 &lt;/span&gt;&lt;span class="c1"&gt;# Please DO NOT modify this file; if you need to modify the boot config, the&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt; 2 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# &amp;quot;usercfg.txt&amp;quot; file is the place to include user changes. Please refer to&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt; 3 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# the README file for a description of the various configuration files on&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt; 4 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# the boot partition.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt; 5 &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt; 6 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# The unusual ordering below is deliberate; older firmwares (in particular the&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt; 7 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# version initially shipped with bionic) don't understand the conditional&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt; 8 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# [sections] below and simply ignore them. The Pi4 doesn't boot at all with&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt; 9 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# firmwares this old so it's safe to place at the top. Of the Pi2 and Pi3, the&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;10 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# Pi3 uboot happens to work happily on the Pi2, so it needs to go at the bottom&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;11 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# to support old firmwares.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;12 &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;13 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="k"&gt;[pi4]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;14 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;kernel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;uboot_rpi_4.bin&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;15 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;max_framebuffers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;2&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;16 &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;17 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="k"&gt;[pi2]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;18 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;kernel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;uboot_rpi_2.bin&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;19 &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;20 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="k"&gt;[pi3]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;21 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;kernel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;uboot_rpi_3.bin&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;22 &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;23 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="k"&gt;[all]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;24 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;arm_64bit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;25 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;device_tree_address&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;0x03000000&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;26 &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;27 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# The following settings are &amp;quot;defaults&amp;quot; expected to be overridden by the&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;28 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# included configuration. The only reason they are included is, again, to&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;29 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# support old firmwares which don't understand the &amp;quot;include&amp;quot; command.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;30 &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;31 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;enable_uart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;32 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;cmdline&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;cmdline.txt&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;33 &lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;34 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;include syscfg.txt&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="ln"&gt;35 &lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="na"&gt;include usercfg.txt&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;First off, ignore that warning at the top (I wrote it, so take it from me that
you can ignore it!). I&amp;#8217;ve covered why it&amp;#8217;s there and &lt;a class="reference external" href="https://waldorf.waveform.org.uk/2020/boot-configuration-with-pibootctl.html"&gt;why it was wrong&lt;/a&gt;
before, so go read that if you&amp;#8217;re interested, but for now all that&amp;#8217;s important
is that you can happily modify this file without breaking stuff (if you&amp;#8217;re
reasonably careful). In fact, feel free to delete that comment&amp;nbsp;:-)&lt;/p&gt;
&lt;p&gt;Now, comment out all the &lt;tt class="docutils literal"&gt;kernel=&lt;/tt&gt; lines pointing to U-boot, and the
&lt;tt class="docutils literal"&gt;device_tree_address=&lt;/tt&gt; line. Then under the &lt;code class="ini"&gt;&lt;span class="k"&gt;[all]&lt;/span&gt;&lt;/code&gt; section add
&lt;tt class="docutils literal"&gt;kernel=vmlinuz&lt;/tt&gt;, and &lt;tt class="docutils literal"&gt;initramfs initrd.img followkernel&lt;/tt&gt;. Your file should
wind up looking something like&amp;nbsp;this:&lt;/p&gt;
&lt;div class="topic"&gt;
&lt;p class="topic-title"&gt;config.txt&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span id="line-1"&gt;&lt;span class="linenos"&gt; 1&lt;/span&gt;&lt;span class="c1"&gt;# The unusual ordering below is deliberate; older firmwares (in particular the&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-2"&gt;&lt;span class="linenos"&gt; 2&lt;/span&gt;&lt;span class="c1"&gt;# version initially shipped with bionic) don&amp;#39;t understand the conditional&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-3"&gt;&lt;span class="linenos"&gt; 3&lt;/span&gt;&lt;span class="c1"&gt;# [sections] below and simply ignore them. The Pi4 doesn&amp;#39;t boot at all with&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-4"&gt;&lt;span class="linenos"&gt; 4&lt;/span&gt;&lt;span class="c1"&gt;# firmwares this old so it&amp;#39;s safe to place at the top. Of the Pi2 and Pi3, the&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-5"&gt;&lt;span class="linenos"&gt; 5&lt;/span&gt;&lt;span class="c1"&gt;# Pi3 uboot happens to work happily on the Pi2, so it needs to go at the bottom&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-6"&gt;&lt;span class="linenos"&gt; 6&lt;/span&gt;&lt;span class="c1"&gt;# to support old firmwares.&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-7"&gt;&lt;span class="linenos"&gt; 7&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-8"&gt;&lt;span class="linenos"&gt; 8&lt;/span&gt;&lt;span class="k"&gt;[pi4]&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-9"&gt;&lt;span class="hll"&gt;&lt;span class="linenos"&gt; 9&lt;/span&gt;&lt;span class="c1"&gt;#kernel=uboot_rpi_4.bin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span id="line-10"&gt;&lt;span class="linenos"&gt;10&lt;/span&gt;&lt;span class="na"&gt;max_framebuffers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-11"&gt;&lt;span class="linenos"&gt;11&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-12"&gt;&lt;span class="linenos"&gt;12&lt;/span&gt;&lt;span class="k"&gt;[pi2]&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-13"&gt;&lt;span class="hll"&gt;&lt;span class="linenos"&gt;13&lt;/span&gt;&lt;span class="c1"&gt;#kernel=uboot_rpi_2.bin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span id="line-14"&gt;&lt;span class="linenos"&gt;14&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-15"&gt;&lt;span class="linenos"&gt;15&lt;/span&gt;&lt;span class="k"&gt;[pi3]&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-16"&gt;&lt;span class="hll"&gt;&lt;span class="linenos"&gt;16&lt;/span&gt;&lt;span class="c1"&gt;#kernel=uboot_rpi_3.bin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span id="line-17"&gt;&lt;span class="linenos"&gt;17&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-18"&gt;&lt;span class="linenos"&gt;18&lt;/span&gt;&lt;span class="k"&gt;[all]&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-19"&gt;&lt;span class="linenos"&gt;19&lt;/span&gt;&lt;span class="na"&gt;arm_64bit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-20"&gt;&lt;span class="hll"&gt;&lt;span class="linenos"&gt;20&lt;/span&gt;&lt;span class="c1"&gt;#device_tree_address=0x03000000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span id="line-21"&gt;&lt;span class="hll"&gt;&lt;span class="linenos"&gt;21&lt;/span&gt;&lt;span class="na"&gt;kernel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;vmlinuz&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span id="line-22"&gt;&lt;span class="hll"&gt;&lt;span class="linenos"&gt;22&lt;/span&gt;&lt;span class="na"&gt;initramfs initrd.img followkernel&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span id="line-23"&gt;&lt;span class="linenos"&gt;23&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-24"&gt;&lt;span class="linenos"&gt;24&lt;/span&gt;&lt;span class="c1"&gt;# The following settings are &amp;quot;defaults&amp;quot; expected to be overridden by the&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-25"&gt;&lt;span class="linenos"&gt;25&lt;/span&gt;&lt;span class="c1"&gt;# included configuration. The only reason they are included is, again, to&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-26"&gt;&lt;span class="linenos"&gt;26&lt;/span&gt;&lt;span class="c1"&gt;# support old firmwares which don&amp;#39;t understand the &amp;quot;include&amp;quot; command.&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-27"&gt;&lt;span class="linenos"&gt;27&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-28"&gt;&lt;span class="linenos"&gt;28&lt;/span&gt;&lt;span class="na"&gt;enable_uart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-29"&gt;&lt;span class="linenos"&gt;29&lt;/span&gt;&lt;span class="na"&gt;cmdline&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;cmdline.txt&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-30"&gt;&lt;span class="linenos"&gt;30&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-31"&gt;&lt;span class="linenos"&gt;31&lt;/span&gt;&lt;span class="na"&gt;include syscfg.txt&lt;/span&gt;
&lt;/span&gt;&lt;span id="line-32"&gt;&lt;span class="linenos"&gt;32&lt;/span&gt;&lt;span class="na"&gt;include usercfg.txt&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Obviously if you want to undo the changes you can simply comment out the lines
you&amp;#8217;ve added and uncomment the ones you commented out (one of the joys of
textual configuration being that leaving obsolete stuff commented out for
reversion is&amp;nbsp;trivial!).&lt;/p&gt;
&lt;p&gt;Save your changes, and &lt;strong&gt;safely remove&lt;/strong&gt; your &lt;span class="caps"&gt;USB&lt;/span&gt; enclosure however that&amp;#8217;s done
in your particular &lt;span class="caps"&gt;OS&lt;/span&gt; (&lt;em&gt;don&amp;#8217;t just unplug it&lt;/em&gt;, you need to make sure
everything&amp;#8217;s unmounted&amp;nbsp;cleanly).&lt;/p&gt;
&lt;img alt="An oddly angled picture captured to show the initial login screen of Ubuntu Server 20.04.2, and the USB-connected SSD underneath the Pi 4 it booted from. The SSD enclosure is labelled and the words &amp;quot;Ubuntu 20.04.2 LTS&amp;quot; on the screen are distorted for effect." src="https://waldorf.waveform.org.uk/images/focal-on-usb.jpg" /&gt;
&lt;p&gt;And you&amp;#8217;re done! Connect the enclosure to a free &lt;span class="caps"&gt;USB3&lt;/span&gt; port on your Pi 4 and you
should be good to&amp;nbsp;go.&lt;/p&gt;
&lt;/div&gt;
</content><category term="misc"></category><category term="pi"></category><category term="ubuntu"></category><category term="u-boot"></category><category term="boot"></category><category term="usb"></category></entry></feed>