Cross-compiling with go for arm on amd64. Possible?

Polytropon freebsd at edvax.de
Wed Dec 11 19:44:07 UTC 2019


On Wed, 11 Dec 2019 13:01:06 -0600, CyberLeo Kitsana wrote:
> On 12/10/19 9:23 AM, Scott Aitken wrote:
> <snip>> 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.
> 
> Don't use truncate(1) to create swapfiles. On filesystems that support 
> sparse files, it will not allocate any space on the underlying 
> filesystem. This can lead to a deadlock if the kernel attempts to swap 
> and the filesystem runs out of space to allocate. It can also lead to 
> extreme fragmentation, but that's not much of an issue on flash storage.

How about this?



/etc/rc.local:
--------------
SWAP="/ssdswap"
/bin/rm -f $SWAP
/bin/dd if=/dev/zero of=$SWAP bs=16m seek=500 count=0
/sbin/mdconfig -a -t vnode -u 0 -f $SWAP || /bin/sh
/bin/chflags nodump $SWAP
/bin/rm $SWAP
/sbin/swapctl -a /dev/md0
echo -n " swap"



/etc/rc.shutdown.local:
-----------------------
/sbin/swapctl -d /dev/md0 > /dev/null 2>&1
/sbin/mdconfig -d -u 0
echo -n " swap"



This is an untypical and strange method of creating "swap file
on demand" on early SSDs (historically grown), but it works. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list