gokrazy / firmware

bootloader files for the Raspberry Pi 3, Pi 4, Pi 5 and Pi Zero 2 W
https://gokrazy.org
Other
22 stars 2 forks source link

Orange Pi CM4 #315

Open kaigoh opened 5 months ago

kaigoh commented 5 months ago

Hi all,

Firstly great project, nicely done!

As issue https://github.com/gokrazy/firmware/issues/307 describes, I'd like to get gokrazy booting on a non-Raspberry Pi device due to the availability and cost issues affecting the OG boards. I'm currently in the process of migrating the hardware elements of my project to work with the Orange Pi CM4, and as part of that I'm working through the software side. I've got a custom operating system image built using the Orange Pi guides on their wiki, which boots and runs brilliantly.

However, I'm by no means a kernel wizard, so am really lost with what I'd need to do to get a gokrazy build running. Can I extract elements from my working OS image? If so, what do I need to extract? I have their board support package, but no idea what to do with it with regards to gokrazy.

I don't expect my hand to be held, but some guidance and pointers would be really appreciated.

Thanks 😎👍

stapelberg commented 5 months ago

Hey @kaigoh

gokrazy doesn’t have unusual kernel requirements, so chances are that overwriting a working OS image’s root file system with the gokrazy root file system might just work (when booting with init=/gokrazy/init). See gok overwrite --help for how to produce only a root file system or only a boot file system.

You can check out the kernel options that gokrazy builds with for arm64 (Raspberry Pi) or (and those are much shorter) for amd64 (PC).

I hope this gives you a starting point, and feel free to ask follow-up questions.

PS: https://github.com/gokrazy/gokrazy/issues/101 might contain some useful pointers from Odroid HC2 support.