Raspberry Pi does what Microsoft can't!

Techno Spine
46 followers
16 Video Views·Oct 18, 2022
If I buy a PC without Windows pre-installed, I have to either copy Windows Installer to a
flash drive from another computer, or install Windows from a special image server on my network.
That is, assuming I want to run Windows in the first place.
But guess what? This little Raspberry Pi, it can set itself up without any flash drive,
directly over the internet using a new feature called Network Install.
Like Apple's Internet Recovery, you don't have to have any OS installed on your computer to use it,
and you don't need to run a separate server to boot your Pi and image its drive.
Now, one thing I have to make clear right away, because I know you're going to comment on it.
This feature is not netbooting. The Pi supports that too.
This is similar in a sense, but this actually goes deeper.
What this new feature means is you could walk into a store,
buy a Raspberry Pi and any old microSD card, go home, plug it into your network,
and the Pi could set itself up. Sort of.
I mean, you might not be able to find a new Raspberry Pi anywhere right now,
and since the feature's in beta, it's not actually running on existing Pi's unless
you update their firmware. But soon. Once it's out of beta, that'll be possible.
And heck, you can't even do that on Macs. Their Internet Recovery feature is only possible
because Apple burns that into storage that's soldered onto the Mac.
On the Pi, you can use any storage you want.
Heck, you can just set up a Pi with a thumb drive, no other computer required.
This new feature is also cool because at this point,
you can boot a Pi in a bunch of different ways.
You can boot from SD cards or built-in eMMC on the Compute Module.
You can boot from any USB drive, like flash drives, hard drives, or SSDs.
You can netboot using PXEboot. You can even boot Compute Module 4s from NVMe SSDs.
And now you can boot a Pi directly over the Internet using this network installer mode.
Pretty cool. But seeing is believing.
First, I'll show you how to update your existing Pi to be able to do network install.
You have to have a Pi 4, Pi 400, or Compute Module 4 though.
Older Pis don't have the EEPROM that makes this possible.
The EEPROM is inside this tiny chip here.
I actually did a whole video on how the Pi 4 boots itself up using the EEPROM,
so go check that out if you want the gory details. And I do mean gory.
While this feature is in beta, you actually do need another computer to update your Pi's
firmware, which is ironic because the whole point of the feature is to not require another computer,
but it is what it is.
On my Mac, I opened up Raspberry Pi Imager. Then I clicked Choose OS.
In the pop-up, scroll down to MISC Utility Images and click on it.
Then click on Beta Test Bootloader, and in that menu, click on the SD Card Boot.
Then pop a microSD card into your card reader and choose it with Choose Storage.
Click write, then enter your password when prompted.
Since the software needed to flash the firmware is pretty tiny, this should be pretty fast.
Now pop out the microSD card, insert it into your Pi,
then boot up the Pi, ideally with the monitor connected.
The activity LED should start flashing pretty rapidly.
What's interesting about this is the pattern of flashes is actually indicating
individual bytes being written to the EEPROM in real time.
Once that's done, the green LED starts flashing in a steady pattern,
and if you have a monitor plugged in, it should show a green screen,
meaning that the flashing was successful.
Unplug the Pi and take out the microSD card.
And at this point, you're running the Beta Bootloader, and it should be able to do a network install.
Make sure you have a keyboard and ethernet cable plugged in,
and pop in a microSD card that doesn't already have PiOS or any other operating system on it.
If you want to use the same microSD card you used to flash it,
you can actually do that without even erasing it.
Just pull it out of the Pi, then do the next few steps,
and then pop the card back in once Pi Imager is running.
But assuming you have a different card, or erased your original card,
it's time to power on the Raspberry Pi.
And look at that, there's a new fancy looking screen that pops up
when the Pi doesn't detect an operating system.
Hold down the shift key for a few seconds, then when it asks, press the spacebar.
After that, the network installer will connect to the internet
and download the Raspberry Pi Imager to RAM.
The Imager download was pretty slow for me, and heck, right now it doesn't even work with IPv6,
but hopefully those things will get fixed before it gets out of beta.
Anyways, once that download's finished,
the same old Raspberry Pi Imager we all know and love boots up from RAM,
and you can flash the microSD card straight from the Pi itself.
And you know what I thought was really cool about this?
You don't even need a mouse!
Every part of the interface can be reached just using the keyboard,
though advanced configuration takes a bit of tabbing.
But I love that because I don't always have a mouse nearby.
And right now, the installer isn't actually accessible for blind users,
but according to Raspberry Pi, they might integrate Orca,
so assistive devices could work with the Imager's UI.
Anyways, select an OS, select the microSD card, and hit write.
Then watch as the Pi simultaneously downloads and writes the image to your card.
How much RAM you have on your Pi shouldn't be an issue even if you choose a big OS image,
because the image is actually decompressed and written straight through to the microSD card.
Once it's done writing, the Pi will automatically reboot,
and since there's an operating system on the card now, the Pi should boot from it.
Now, what about USB flash drives and SSDs?
Well, I have a T-Cell 4K Fire flash drive that a viewer sent in,
and I've been meaning to test it out on a Pi.
So now's as good a time as ever.
I'll shut down the Pi, pull out the microSD card,
plug in the USB flash drive, and power up the Pi again.
And after holding down shift, then pressing space and waiting for the Imager to start up,
it looks like the USB flash drive is also selectable.
I flashed it, and after that finished, the Pi rebooted off it without any problems.
That's awesome.
One other thing I wanted to try out, though.
What if I had a custom Pi OS image, like a RetroPi build or some other OS I wanted to install,
that I couldn't get to through the Imager's defaults?
Could I just put an image file on a USB flash drive,
pop that into the Pi, and flash it to my card?
Yes, in fact, I can.
I tried it out, and when I chose the Use Custom option in the operating system menu,
it showed all the image files on my flash drive.
I should mention I formatted my flash drive as FAT32.
I'm not sure if it'll work with other formats.
But this makes it even more powerful.
In addition to being able to set up a Pi from scratch anywhere with an internet connection,
I could carry around a flash drive with my favorite OSes and flash them to the Pi too,
all without having another computer.
This is all great, but one question I've been hearing a lot is,
how secure is it?
Well, for anyone who's really, really concerned about it,
I'd recommend never installing something direct over the internet regardless.
You should always use local images you've independently verified.
But for most users, the security in place is adequate.
The imager that runs in the Pi's RAM is verified
using a self-signed certificate that Raspberry Pi created,
and it looks like the cert that they're currently using is valid for about 24 years.
And the imager itself is signed with a separate key
so it can be verified before the Pi boots it.
Once rebooted, the imager actually fetches the current date and time over the web
not using NTP, but using HTTP, since it needs to have a somewhat accurate time and date
so the image downloads will work correctly.
Is the end-to-end security absolutely bulletproof?
No, but it's good enough for me.
Also, since I know some of you will ask,
the source code that actually builds the Raspberry Pi imager buildroot image
that makes this all work is up on GitHub in the imager project's embedded directory.
There are a few other limitations with the current network install process.
Some people are asking about fully headless automated provisioning.
That's actually been possible on the Compute Module 4 for almost a year now.
But right now at least, it still requires extra steps
if you want to try to do that on a Pi 4 or a Pi 400.
Also, you can't do any of this stuff over Wi-Fi for now.
The Pi's EEPROM is already a bit space-constrained.
I've been told that's part of the reason they can't add
SATA boot to the Compute Module 4 yet.
So adding more code to support Wi-Fi in addition to Ethernet for network install
might be impossible, at least with this current generation of Raspberry Pis.
And what about the Compute Module 4?
Updating its bootloader is a little more complicated
because its EEPROM works a bit different.
On the CM4, you need to use the rpi-boot tool to flash the beta bootloader.
Finally, I also wanted to point out two features on the Raspberry Pi
that can come in handy when you mess around with the EEPROM.
You can check your current config with rpi-eeprom-config
and edit it using the dash-dash-edit option.
Or run sudo raspi-config, go to advanced options,
then boot order if you just want to change the boot order on the Pi.
It's great Raspberry Pi is adding this feature.
I think back 10 years ago when Apple released iOS 5 for the iPhone.
Sure, there were big new features like iCloud and iMessage,
but the biggest update?
The one that took the iPhone from a glorified iPod to the behemoth that it is today?
That feature was independence from iTunes.
With iOS 5, you could activate and update iPhones
without ever connecting them to another computer.
I think once network install is out of beta,
a major barrier to first-time Pi owners will disappear.
They won't have to set it up from another computer.
And heck, it works well enough that I'll be using it a lot now too.
But power users like me will still use Imgur on another computer,
but I think for many people this new way of setting up a Pi
might be the only way they ever do it.
If you try it out and find a problem though,
there's a forum topic where Raspberry Pi is asking for feedback.
Also, I mentioned at the beginning of this video
that this feature isn't the same thing as netboot.
That's a different beast, and Wendell over at Level1Techs
just posted a thorough blog post covering netbooting a Raspberry Pi,
so check that out if you're interested.
I plan on covering it in a future video too, so be sure to subscribe.
Until next time, I'm Geoff Geerling.
