Skip to content

Precautions for building on devices with less than 1GB RAM

Maik Allgöwer edited this page Jul 19, 2015 · 4 revisions

Trying to install drive from source on devices with low memory (such as Raspberry Pi, PogoPlug etc.) might throw an error like the following

go get -u github.com/odeke-em/drive/cmd/drive
go build github.com/odeke-em/google-api-go-client/drive/v2: /usr/lib/go/pkg/tool/linux_arm/5g: signal: killed
go build golang.org/x/text/unicode/norm: /usr/lib/go/pkg/tool/linux_arm/5g: signal: killed

On devices with low memory, it is highly recommended to use a swap-partition/file.

If, for whatever reason, you do not want to use swap but still need to build drive from source (there are now binaries for armv6l) you can create a temporary swap file, build drive and delete the swap file afterwards.

as root, create a 1GB swap file

fallocate -l 1G /swap
mkswap /swap
chmod 600 /swap
swapon /swap

get and build drive as usual

go get -u github.com/odeke-em/drive/cmd/drive

again, as root, disable swap and remove the file

swapoff /swap
rm /swap