Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Dec 2019 02:23:23 +1100
From:      Scott Aitken <freebsd-lists-5@thismonkey.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Cross-compiling with go for arm on amd64. Possible?
Message-ID:  <20191210152323.GA47078@thismonkey.com>
In-Reply-To: <mailman.73.1575979201.5391.freebsd-questions@freebsd.org>
References:  <mailman.73.1575979201.5391.freebsd-questions@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> Scott Aitken <freebsd-lists-5@thismonkey.com> writes:
> 
> > Unfortunately I'm using an SD image from the FreeBSD website which doesn't 
> > have a swap partition, and then chews up any free space with 'growfs' on 
> > first boot.  (Something to remember for next time - add swap before growfs 
> > runs).
> >
> > So I don't have any swap.  I had forgotten about that when I first posted.  
> > (I could plug in a USB stick for swap).
> >
> > Still if anyone has had success in cross-compiling in Go for arm I'd I'd love 
> > to know.
> 
> I had set up a swap partition after I used dd to put the image on the
> card, and before I booted the image.  You can use a USB device, or you
> can just try a swapfile[1].  I just tested the following sequence:
> 
> #-------------- Start code snip
> dd if=/dev/zero of=/var/swapfile bs=1m count=200
> echo 'md none swap sw,late,file=/var/swapfile 0 0' >>/etc/fstab
> swapon -aL
> #-------------- End code snip
> 
> That will give you 200MB on a swapfile, which I think will be enough.
> You can try more if you want, but a swap partition would probably be
> better.
> 
> [1] - The handbook also shows how to create a swapfile at:
> https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/adding-swap-space.html 
> 
> -- 
> Carl Johnson		carlj@peak.org
>
Great idea Carl,

rather than the dd I did:
# truncate -s 512M /var/swapfile
# ls -als /var/swapfile
96 -rw-r--r--  1 root  wheel  536870912 Dec 11 02:08 /var/swapfile

The fstab info was very helpful, thanks.  I've now got a 512M swapfile.

I think way back in my original post I said that I'd downloaded a pre-built 
binary for the Pi on the dnscrypt2 github site so I don't need to build go 
any more (at least not at the moment).

But I'm sure the swapfile will save my bacon in the future.

Many thanks for your help,
Scott



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191210152323.GA47078>