Cross-compiling the Raspberry Pi OS Linux kernel on macOS
After doing a video testing different external GPUs on a Raspberry Pi last week, I realized two things:
- Compiling the Linux kernel on a Raspberry Pi is slow. It took 54 minutes, and I ended up doing it 7 times during the course of testing for that video.
- 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.
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. For example:
And 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.