I’ve spent the past few days doing a simple build for my Raspberry Pi Zero.
You can follow along with me here.
The build is simple.
I’ll go into more detail about the build in a moment, but the basic idea is to build up a Raspberry Pi computer that you can then connect to a TV or monitor using a USB cable.
You don’t need to buy a RaspberryPi Zero to do this, as it already has an Ethernet cable built in.
To get the RaspberryPi to run this build, you’ll need to make a new bootable USB stick and a USB drive.
Here’s the Raspberry Pi setup:I’ve made a bootable SD card with the default kernel, the latest Raspbian Jessie image, and a few other things I can’t remember right now.
I’ve also made a few USB ports that I’ll need later to connect the Pi to my TV.
You can follow this tutorial to get the build setup, and then just plug the USB stick into the Raspberry.
If everything goes well, you should be able to plug the Pi into a TV and see it running.
You’ll need an SD card, a USB stick, and some software to get things going.
First, you need to create a boot partition on the SD card:This will contain a boot image that will be used to install the RaspPi and other applications on the Pi.
Next, you create a directory called pi-pi-build:This is where the build will take place.
The default build directory is /dev/sda3, but you can change it if you want.
I just used the default path, so it’ll be /dev/./sdb.
Next you create the directory pi-build-sd:This specifies a location for the SD device.
I chose a root partition, which is a sub-volume on the boot partition.
Next we create the folder pi-base:This creates a directory for the base operating system of the Pi, and tells the Pi that it should run the default build.
Finally, we create a folder pi:This tells the OS to create an executable, which will be run on boot.
I used a shell script, which means it’s an executable file on the system.
I have created a folder for my Pi and a directory named pi-Pi:You can see this folder has two files, pi-Base.mk and pi-PIA.mk. pi-PKP.mk will be created and run by the Pi itself.
If you open this, you can see that there’s a lot of information for me to type out.
The first line is the default boot option, pi:.
Next, it says, Pi-PKL, which tells the Raspberry to make the Pi boot from the PKP binary on the drive.
Next is the PKL name, pi.
Finally is a path to the PK file that I made, pi_PIA:.
I used a simple bash script to create this folder:It’s the same bash script I use to create the boot image.
Next I need to tell the Pi where to find the file that’s responsible for the Pi’s boot.
Here’s the file I’m using:You’ll notice that there are two files in the directory, pi and pi_base.mk: pi_PKP and pi.PKP are for the boot loader.
I’m creating a folder named pi, and pi is creating a file named pi.
If this directory gets renamed, the boot file will be removed from the drive, and the system will boot from there instead.
Mk is where I’m going to create my default PKP file, and there’s another one for the kernel that’s going to be used.
I created this file with the same command I used to create pi_pkp:And then there’s the first line in this file:I use a few more lines to tell Pi where the PK files are, and I add a couple more line to tell it to make them the default files in my build directory.
I use a line like this:Then I use the same line in the pi_pkg.mk file to tell this to create it:I don’t know what’s going on here, but this line is telling the Pi not to create any PK files.
This is good, because I want the default PK files to be the default ones.
I could just put that in pi_build and have it be the case, but I think this is a little more useful than that.
Next comes a little bit of magic: pi:Next up, I create a file called pi_SD:This makes the SD Card bootable.
I like to make it bootable by default, so I use this line:Next I create the file pi_sd.mk to tell pi to put the SD in the SD drive:Next, I add the file