

I wanted my cross-compile environment to be close to the Pi OS, and work with the Raspberry Pi Kernel Building directions out of the box, so I created a Vagrantfile that used the debian/buster64 base box. I wanted to compile the Raspberry Pi OS kernel with support for 9000 MTU on the built-in Gigabit network interface for some ethernet benchmarking I was doing (it only supports 1500 MTU out of the box, and the driver doesn't allow changing MTU on the fly), and I had to put that kernel on four Pi 4 model Bs, so this was the perfect time to start cross-compiling on my fast Core i9 Mac. That didn't pan out, and I didn't want to rely on something that used paid ext4 software that may or may not work with virtualization, so ultimately I went back to my old faithful, Vagrant + VirtualBox. And that's a lotta layers of abstraction.Īnd my second attempt was to see if osxfuse could be made to help ( I've used osxfuse to mount Raspberry Pi microSD cards before.). For example:Īnd on the Pi Forums, it seems like nobody worth their salt compiles the kernel on the Pi either, so I figured-since I'm probably going to have to do it again another thousand times in my life-I might as well put together a guide for how to do it on a Mac.Īnd my first attempt was to use Docker for Mac, but that attempt faltered once I realized there's no way to mount a microSD card ('device') into Docker for Mac, unless you hack things through VirtualBox with Docker inside or use Docker Machine. To the second point, about every fifth comment was telling me to cross-compile Linux on a faster machine instead of doing it on the Pi itself. If you ever want to figure out a better way to do something, write a blog post or create a video showing the less optimal way of doing it.It took 54 minutes, and I ended up doing it 7 times during the course of testing for that video. Compiling the Linux kernel on a Raspberry Pi is slow.After doing a video testing different external GPUs on a Raspberry Pi last week, I realized two things:
