Using Go in picore (tinycore)

117 views
Skip to first unread message

王富民awaw

unread,
Dec 5, 2023, 9:04:35 PM12/5/23
to golang-nuts
Hi Gophers and embedded systems experts

How can I use the latest version of Go, 1.21.5, in picore, which is the raspberry pi port of the lightweight linux OS tinycore?
Although, the x86_64 version includes Go, the picore version doesn't.

To use Go, could I simply download


into the picore OS, and simply use Go straightaway?
If not, can anyone share the steps to compile Go from source on picore?

If anyone is curious why we're not using the default raspberry pi OS,
it is because our users often unplug the pi's power abruptly without proper shutdown causing sd card corruption and eventually OS boot failures. 
To this end, we also evaluated TinyGo, but there are two issues:
    * TinyGo does not have wifi yet.
    * We need to segment live stream from a camera, and thus need ffmpeg

Some people in the raspberry pi community recommend Ultibo for use cases where abrupt power unplugging is required.
However, since Ultibo is not Go, I'd preferably rather not use it, as I really don't want to code in anything other than Go.

Brian Candler

unread,
Dec 6, 2023, 3:21:34 AM12/6/23
to golang-nuts
You should note that you don't necessarily need to install the go compiler on your target machine. You can build ARM binaries on an x86_64 machine for example - set the parameters GOOS and GOARCH. Go is especially good for this sort of cross-compilation, as it doesn't require any special toolchains to be installed. It's out-of-the-box functionality.

But if you do want to run go on the target system itself, then I'd expect just installing the binary distribution should work.  Try it and see!

As for crash safety: it's normally a matter of what type of filesystem is being used.

王富民awaw

unread,
Dec 6, 2023, 4:21:47 AM12/6/23
to golang-nuts
Good point, perhaps cross compiling with GOOS=linux and GOARCH=arm would be the easiest path.
Can anyone share their experiences with regard to actually doing this on tinycore, and it indeed works?

Reply all
Reply to author
Forward
0 new messages